LibrePCB Developers Documentation
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_EDITOR_PROJECTLIBRARYUPDATER_H
21#define LIBREPCB_EDITOR_PROJECTLIBRARYUPDATER_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
28
29#include <QtCore>
30#include <QtWidgets>
31
32#include <memory>
33
34/*******************************************************************************
35 * Namespace / Forward Declarations
36 ******************************************************************************/
37namespace librepcb {
38
39class TransactionalFileSystem;
40class Workspace;
41class WorkspaceLibraryDb;
42
43namespace editor {
44
45class ControlPanel;
46
47namespace Ui {
48class ProjectLibraryUpdater;
49}
50
51/*******************************************************************************
52 * Class ProjectLibraryUpdater
53 ******************************************************************************/
54
62class ProjectLibraryUpdater : public QDialog {
63 Q_OBJECT
64
65public:
66 explicit ProjectLibraryUpdater(Workspace& ws, const FilePath& project,
67 ControlPanel& cp) noexcept;
69
70private slots:
71 void btnUpdateClicked();
72
73private:
74 void log(const QString& msg) noexcept;
75 QString prettyPath(const FilePath& fp) const noexcept;
76 template <typename T>
77 void updateElements(std::shared_ptr<TransactionalFileSystem> fs,
78 const QString& type);
79
80private:
84 QScopedPointer<Ui::ProjectLibraryUpdater> mUi;
85};
86
87/*******************************************************************************
88 * End of File
89 ******************************************************************************/
90
91} // namespace editor
92} // namespace librepcb
93
94#endif
This class represents absolute, well-formatted paths to files or directories.
Definition: filepath.h:129
The Workspace class represents a workspace with all its data (library, projects, settings,...
Definition: workspace.h:54
The ControlPanel class.
Definition: controlpanel.h:63
The ProjectLibraryUpdater class.
Definition: projectlibraryupdater.h:62
FilePath mProjectFilePath
Definition: projectlibraryupdater.h:82
ProjectLibraryUpdater(Workspace &ws, const FilePath &project, ControlPanel &cp) noexcept
Definition: projectlibraryupdater.cpp:56
~ProjectLibraryUpdater()
Definition: projectlibraryupdater.cpp:71
QScopedPointer< Ui::ProjectLibraryUpdater > mUi
Definition: projectlibraryupdater.h:84
void btnUpdateClicked()
Definition: projectlibraryupdater.cpp:78
void updateElements(std::shared_ptr< TransactionalFileSystem > fs, const QString &type)
Definition: projectlibraryupdater.cpp:177
ControlPanel & mControlPanel
Definition: projectlibraryupdater.h:83
Workspace & mWorkspace
Definition: projectlibraryupdater.h:81
void log(const QString &msg) noexcept
Definition: projectlibraryupdater.cpp:166
QString prettyPath(const FilePath &fp) const noexcept
Definition: projectlibraryupdater.cpp:172
Definition: occmodel.cpp:77