LibrePCB Developers Documentation
outputjobsdialog.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_OUTPUTJOBSDIALOG_H
21#define LIBREPCB_EDITOR_OUTPUTJOBSDIALOG_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
27
28#include <QtCore>
29#include <QtWidgets>
30
31/*******************************************************************************
32 * Namespace / Forward Declarations
33 ******************************************************************************/
34namespace librepcb {
35
36class Project;
37class WorkspaceSettings;
38
39namespace editor {
40
41class UndoStack;
42
43namespace Ui {
44class OutputJobsDialog;
45}
46
47/*******************************************************************************
48 * Class OutputJobsDialog
49 ******************************************************************************/
50
54class OutputJobsDialog final : public QDialog {
55 Q_OBJECT
56
57public:
58 // Constructors / Destructor
59 OutputJobsDialog() = delete;
60 OutputJobsDialog(const OutputJobsDialog& other) = delete;
61 explicit OutputJobsDialog(const WorkspaceSettings& settings, Project& project,
62 UndoStack& undoStack, const QString& settingsPrefix,
63 QWidget* parent = nullptr) noexcept;
64 ~OutputJobsDialog() noexcept;
65
66 // General Methods
67 virtual void reject() noexcept override;
68
69 // Operator Overloads
70 OutputJobsDialog& operator=(const OutputJobsDialog& rhs) = delete;
71
72signals:
74
75private: // Methods
76 void addClicked() noexcept;
77 void copyClicked() noexcept;
78 void moveUpClicked() noexcept;
79 void moveDownClicked() noexcept;
80 void removeClicked() noexcept;
81 void openOutputDirectory() noexcept;
82 void removeUnknownFiles() noexcept;
83 void runJob(std::shared_ptr<OutputJob> job, bool open = false) noexcept;
84 void currentItemChanged(QListWidgetItem* current,
85 QListWidgetItem* previous) noexcept;
86 void buttonBoxClicked(QAbstractButton* button) noexcept;
87 bool applyChanges() noexcept;
88 void updateJobsList() noexcept;
89 void jobListEdited(const OutputJobList& list, int index,
90 const std::shared_ptr<const OutputJob>& obj,
91 OutputJobList::Event event) noexcept;
92 void writeTitleLine(const QString& msg) noexcept;
93 void writeOutputFileLine(const FilePath& fp) noexcept;
94 void writeUnknownFileLine(const FilePath& fp) noexcept;
95 void writeStrikeThroughLine(const QString& msg) noexcept;
96 void writeWarningLine(const QString& msg) noexcept;
97 void writeErrorLine(const QString& msg) noexcept;
98 void writeSuccessLine() noexcept;
99 void writeLogLine(const QString& line) noexcept;
100
101private: // Data
105 const QString mSettingsPrefix;
107 QScopedPointer<Ui::OutputJobsDialog> mUi;
108
109 // Slots
111};
112
113/*******************************************************************************
114 * End of File
115 ******************************************************************************/
116
117} // namespace editor
118} // namespace librepcb
119
120#endif
This class represents absolute, well-formatted paths to files or directories.
Definition: filepath.h:129
Base class for all output job types.
Definition: outputjob.h:50
The Project class represents a whole (opened) project with all its content.
Definition: project.h:71
Container for all workspace related settings.
Definition: workspacesettings.h:60
The OutputJobsDialog class.
Definition: outputjobsdialog.h:54
void writeLogLine(const QString &line) noexcept
Definition: outputjobsdialog.cpp:684
void removeClicked() noexcept
Definition: outputjobsdialog.cpp:304
void removeUnknownFiles() noexcept
Definition: outputjobsdialog.cpp:326
void writeStrikeThroughLine(const QString &msg) noexcept
Definition: outputjobsdialog.cpp:663
void writeWarningLine(const QString &msg) noexcept
Definition: outputjobsdialog.cpp:667
void copyClicked() noexcept
Definition: outputjobsdialog.cpp:271
void addClicked() noexcept
Definition: outputjobsdialog.cpp:213
void writeSuccessLine() noexcept
Definition: outputjobsdialog.cpp:678
void writeTitleLine(const QString &msg) noexcept
Definition: outputjobsdialog.cpp:644
OutputJobList mJobs
Definition: outputjobsdialog.h:106
const QString mSettingsPrefix
Definition: outputjobsdialog.h:105
QScopedPointer< Ui::OutputJobsDialog > mUi
Definition: outputjobsdialog.h:107
void writeOutputFileLine(const FilePath &fp) noexcept
Definition: outputjobsdialog.cpp:649
void writeUnknownFileLine(const FilePath &fp) noexcept
Definition: outputjobsdialog.cpp:655
void openOutputDirectory() noexcept
Definition: outputjobsdialog.cpp:318
UndoStack & mUndoStack
Definition: outputjobsdialog.h:104
void jobListEdited(const OutputJobList &list, int index, const std::shared_ptr< const OutputJob > &obj, OutputJobList::Event event) noexcept
Definition: outputjobsdialog.cpp:620
Project & mProject
Definition: outputjobsdialog.h:103
const WorkspaceSettings & mSettings
Definition: outputjobsdialog.h:102
void moveDownClicked() noexcept
Definition: outputjobsdialog.cpp:294
void runJob(std::shared_ptr< OutputJob > job, bool open=false) noexcept
Definition: outputjobsdialog.cpp:379
void updateJobsList() noexcept
Definition: outputjobsdialog.cpp:581
bool applyChanges() noexcept
Definition: outputjobsdialog.cpp:569
OutputJobList::OnEditedSlot mOnJobsEditedSlot
Definition: outputjobsdialog.h:110
OutputJobsDialog(const OutputJobsDialog &other)=delete
virtual void reject() noexcept override
Definition: outputjobsdialog.cpp:195
void moveUpClicked() noexcept
Definition: outputjobsdialog.cpp:284
void currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous) noexcept
Definition: outputjobsdialog.cpp:484
void buttonBoxClicked(QAbstractButton *button) noexcept
Definition: outputjobsdialog.cpp:550
void writeErrorLine(const QString &msg) noexcept
Definition: outputjobsdialog.cpp:673
The UndoStack class holds UndoCommand objects and provides undo/redo commands.
Definition: undostack.h:106
Definition: occmodel.cpp:77