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 /*******************************************************************************
33  * Namespace / Forward Declarations
34  ******************************************************************************/
35 namespace librepcb {
36 
37 namespace workspace {
38 class Workspace;
39 class WorkspaceLibraryDb;
40 } // namespace workspace
41 
42 namespace application {
43 
44 class ControlPanel;
45 
46 namespace Ui {
47 class ProjectLibraryUpdater;
48 }
49 
50 /*******************************************************************************
51  * Class ProjectLibraryUpdater
52  ******************************************************************************/
53 
61 class ProjectLibraryUpdater : public QMainWindow {
62  Q_OBJECT
63 
64 public:
66  const FilePath& project,
67  ControlPanel& cp) noexcept;
69 
70 private slots:
71  void btnUpdateClicked();
72 
73 private:
74  void log(const QString& msg) noexcept;
75  QString prettyPath(const FilePath& fp) const noexcept;
76  void updateElements(
77  const QString& type,
78  FilePath (workspace::WorkspaceLibraryDb::*getter)(const Uuid&) const);
79 
80 private:
84  QScopedPointer<Ui::ProjectLibraryUpdater> mUi;
85 };
86 
87 /*******************************************************************************
88  * End of File
89  ******************************************************************************/
90 
91 } // namespace application
92 } // namespace librepcb
93 
94 #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:84
ProjectLibraryUpdater(workspace::Workspace &ws, const FilePath &project, ControlPanel &cp) noexcept
Definition: projectlibraryupdater.cpp:54
The ProjectLibraryUpdater class.
Definition: projectlibraryupdater.h:61
QString prettyPath(const FilePath &fp) const noexcept
Definition: projectlibraryupdater.cpp:171
The ControlPanel class.
Definition: controlpanel.h:80
void updateElements(const QString &type, FilePath(workspace::WorkspaceLibraryDb::*getter)(const Uuid &) const)
Definition: projectlibraryupdater.cpp:175
void btnUpdateClicked()
Definition: projectlibraryupdater.cpp:76
ControlPanel & mControlPanel
Definition: projectlibraryupdater.h:83
This class represents absolute, well-formatted paths to files or directories.
Definition: filepath.h:130
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:165
workspace::Workspace & mWorkspace
Definition: projectlibraryupdater.h:81
FilePath mProjectFilePath
Definition: projectlibraryupdater.h:82
~ProjectLibraryUpdater()
Definition: projectlibraryupdater.cpp:69