LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
projectlibraryupdater.h
Go to the documentation of this file.
1 /*
2  * LibrePCB - Professional EDA for everyone!
3  * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4  * https://librepcb.org/
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef LIBREPCB_PROJECTLIBRARYUPDATER_H
21 #define LIBREPCB_PROJECTLIBRARYUPDATER_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
27 #include <librepcb/common/uuid.h>
28 
29 #include <QtCore>
30 #include <QtWidgets>
31 
32 #include <memory>
33 
34 /*******************************************************************************
35  * Namespace / Forward Declarations
36  ******************************************************************************/
37 namespace librepcb {
38 
39 class TransactionalFileSystem;
40 
41 namespace workspace {
42 class Workspace;
43 class WorkspaceLibraryDb;
44 } // namespace workspace
45 
46 namespace application {
47 
48 class ControlPanel;
49 
50 namespace Ui {
51 class ProjectLibraryUpdater;
52 }
53 
54 /*******************************************************************************
55  * Class ProjectLibraryUpdater
56  ******************************************************************************/
57 
65 class ProjectLibraryUpdater : public QMainWindow {
66  Q_OBJECT
67 
68 public:
70  const FilePath& project,
71  ControlPanel& cp) noexcept;
73 
74 private slots:
75  void btnUpdateClicked();
76 
77 private:
78  void log(const QString& msg) noexcept;
79  QString prettyPath(const FilePath& fp) const noexcept;
80  void updateElements(
81  std::shared_ptr<TransactionalFileSystem> fs, const QString& type,
82  FilePath (workspace::WorkspaceLibraryDb::*getter)(const Uuid&) const);
83 
84 private:
88  QScopedPointer<Ui::ProjectLibraryUpdater> mUi;
89 };
90 
91 /*******************************************************************************
92  * End of File
93  ******************************************************************************/
94 
95 } // namespace application
96 } // namespace librepcb
97 
98 #endif // LIBREPCB_PROJECTLIBRARYUPDATER_H
The Workspace class represents a workspace with all its data (library, projects, settings, ...)
Definition: workspace.h:65
QScopedPointer< Ui::ProjectLibraryUpdater > mUi
Definition: projectlibraryupdater.h:88
ProjectLibraryUpdater(workspace::Workspace &ws, const FilePath &project, ControlPanel &cp) noexcept
Definition: projectlibraryupdater.cpp:56
The ProjectLibraryUpdater class.
Definition: projectlibraryupdater.h:65
QString prettyPath(const FilePath &fp) const noexcept
Definition: projectlibraryupdater.cpp:161
The ControlPanel class.
Definition: controlpanel.h:80
void btnUpdateClicked()
Definition: projectlibraryupdater.cpp:78
ControlPanel & mControlPanel
Definition: projectlibraryupdater.h:87
This class represents absolute, well-formatted paths to files or directories.
Definition: filepath.h:130
void updateElements(std::shared_ptr< TransactionalFileSystem > fs, const QString &type, FilePath(workspace::WorkspaceLibraryDb::*getter)(const Uuid &) const)
Definition: projectlibraryupdater.cpp:165
The WorkspaceLibraryDb class.
Definition: workspacelibrarydb.h:52
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58
void log(const QString &msg) noexcept
Definition: projectlibraryupdater.cpp:155
workspace::Workspace & mWorkspace
Definition: projectlibraryupdater.h:85
FilePath mProjectFilePath
Definition: projectlibraryupdater.h:86
~ProjectLibraryUpdater()
Definition: projectlibraryupdater.cpp:71