LibrePCB Developers Documentation
newprojectwizardpage_metadata.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_NEWPROJECTWIZARDPAGE_METADATA_H
21#define LIBREPCB_EDITOR_NEWPROJECTWIZARDPAGE_METADATA_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
27
28#include <QtCore>
29#include <QtWidgets>
30
31/*******************************************************************************
32 * Namespace / Forward Declarations
33 ******************************************************************************/
34namespace librepcb {
35
36class Workspace;
37
38namespace editor {
39
40namespace Ui {
41class NewProjectWizardPage_Metadata;
42}
43
44/*******************************************************************************
45 * Class NewProjectWizardPage_Metadata
46 ******************************************************************************/
47
51class NewProjectWizardPage_Metadata final : public QWizardPage {
52 Q_OBJECT
53
54public:
55 // Constructors / Destructor
57 QWidget* parent = nullptr) noexcept;
59 delete;
61
62 // Setters
63 void setProjectName(const QString& name) noexcept;
64 void setLocationOverride(const FilePath& dir) noexcept;
65
66 // Getters
67 QString getProjectName() const noexcept;
68 QString getProjectAuthor() const noexcept;
69 bool isLicenseSet() const noexcept;
70 FilePath getProjectLicenseFilePath() const noexcept;
71 FilePath getFullFilePath() const noexcept { return mFullFilePath; }
72
73 // Operator Overloadings
75 const NewProjectWizardPage_Metadata& rhs) = delete;
76
77private: // GUI Action Handlers
78 void nameChanged(const QString& name) noexcept;
79 void pathChanged(const QString& fp) noexcept;
80 void chooseLocationClicked() noexcept;
81
82private: // Methods
83 bool isComplete() const noexcept override;
84 bool validatePage() noexcept override;
85 void setStatusMessage(const QString& msg) const noexcept;
86
87private: // Data
93};
94
95/*******************************************************************************
96 * End of File
97 ******************************************************************************/
98
99} // namespace editor
100} // namespace librepcb
101
102#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 NewProjectWizardPage_Metadata class.
Definition: newprojectwizardpage_metadata.h:51
bool isLicenseSet() const noexcept
Definition: newprojectwizardpage_metadata.cpp:170
NewProjectWizardPage_Metadata & operator=(const NewProjectWizardPage_Metadata &rhs)=delete
bool mLocationOverridden
Definition: newprojectwizardpage_metadata.h:91
void setStatusMessage(const QString &msg) const noexcept
Definition: newprojectwizardpage_metadata.cpp:283
void nameChanged(const QString &name) noexcept
Definition: newprojectwizardpage_metadata.cpp:189
FilePath mFullFilePath
Definition: newprojectwizardpage_metadata.h:92
QString getProjectName() const noexcept
Definition: newprojectwizardpage_metadata.cpp:162
~NewProjectWizardPage_Metadata() noexcept
Definition: newprojectwizardpage_metadata.cpp:130
void setLocationOverride(const FilePath &dir) noexcept
Definition: newprojectwizardpage_metadata.cpp:151
void pathChanged(const QString &fp) noexcept
Definition: newprojectwizardpage_metadata.cpp:207
NewProjectWizardPage_Metadata(const NewProjectWizardPage_Metadata &other)=delete
bool isComplete() const noexcept override
Definition: newprojectwizardpage_metadata.cpp:228
const Workspace & mWorkspace
Definition: newprojectwizardpage_metadata.h:88
bool validatePage() noexcept override
Definition: newprojectwizardpage_metadata.cpp:266
QScopedPointer< Ui::NewProjectWizardPage_Metadata > mUi
Definition: newprojectwizardpage_metadata.h:89
void setProjectName(const QString &name) noexcept
Definition: newprojectwizardpage_metadata.cpp:146
void chooseLocationClicked() noexcept
Definition: newprojectwizardpage_metadata.cpp:215
NewProjectWizardPage_Metadata(const Workspace &ws, QWidget *parent=nullptr) noexcept
Definition: newprojectwizardpage_metadata.cpp:48
QString getProjectAuthor() const noexcept
Definition: newprojectwizardpage_metadata.cpp:166
FilePath mLocation
Definition: newprojectwizardpage_metadata.h:90
FilePath getFullFilePath() const noexcept
Definition: newprojectwizardpage_metadata.h:71
FilePath getProjectLicenseFilePath() const noexcept
Definition: newprojectwizardpage_metadata.cpp:174
Definition: occmodel.cpp:77