Changeset View
Changeset View
Standalone View
Standalone View
src/dialogs/profilesdialog.h
1 | /* Atelier KDE Printer Host for 3D Printing | 1 | /* Atelier KDE Printer Host for 3D Printing | ||
---|---|---|---|---|---|
2 | Copyright (C) <2016> | 2 | Copyright (C) <2016> | ||
3 | Author: Lays Rodrigues - lays.rodrigues@kde.org | 3 | Author: Lays Rodrigues - lays.rodrigues@kde.org | ||
4 | 4 | Chris Rizzitello - rizzitello@kde.org | |||
5 | This program is free software: you can redistribute it and/or modify | 5 | This program is free software: you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by | ||
7 | the Free Software Foundation, either version 3 of the License, or | 7 | the Free Software Foundation, either version 3 of the License, or | ||
8 | (at your option) any later version. | 8 | (at your option) any later version. | ||
9 | 9 | | |||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. | ||
14 | 14 | | |||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | 17 | */ | ||
18 | #pragma once | 18 | #pragma once | ||
19 | 19 | #include <QAbstractButton> | |||
20 | #include <QDialog> | 20 | #include <QDialog> | ||
21 | #include <QSettings> | 21 | #include <QSettings> | ||
22 | 22 | | |||
23 | namespace Ui | 23 | namespace Ui | ||
24 | { | 24 | { | ||
25 | class ProfilesDialog; | 25 | class ProfilesDialog; | ||
26 | } | 26 | } | ||
27 | 27 | | |||
28 | class ProfilesDialog : public QDialog | 28 | class ProfilesDialog : public QDialog | ||
29 | { | 29 | { | ||
30 | Q_OBJECT | 30 | Q_OBJECT | ||
31 | 31 | | |||
32 | public: | 32 | public: | ||
33 | explicit ProfilesDialog(QWidget *parent = nullptr); | 33 | explicit ProfilesDialog(QWidget *parent = nullptr); | ||
34 | ~ProfilesDialog(); | 34 | ~ProfilesDialog(); | ||
35 | 35 | | |||
36 | private: | 36 | private: | ||
37 | Ui::ProfilesDialog *ui; | 37 | Ui::ProfilesDialog *ui; | ||
38 | QSettings m_settings; | 38 | QSettings m_settings; | ||
39 | QStringList detectFWPlugins() const; | 39 | void askToSave(); | ||
40 | void accept(); | 40 | void buttonBoxClicked(QAbstractButton *btn); | ||
41 | QStringList detectFWPlugins(); | ||||
42 | QStringList firmwaresInPath(const QString &path); | ||||
41 | void loadSettings(const QString ¤tProfile = QString()); | 43 | void loadSettings(const QString ¤tProfile = QString()); | ||
42 | void removeProfile(); | 44 | void removeProfile(); | ||
45 | void save(); | ||||
43 | void saveSettings(); | 46 | void saveSettings(); | ||
44 | void updateCBProfiles(); | 47 | void updateCBProfiles(); | ||
48 | void setModified(bool modified); | ||||
49 | bool m_modified; | ||||
45 | 50 | | |||
46 | signals: | 51 | signals: | ||
47 | void updateProfiles(); | 52 | void updateProfiles(); | ||
48 | }; | 53 | }; | ||
49 | 54 | | |||
50 | namespace SERIAL | 55 | namespace SERIAL | ||
51 | { | 56 | { | ||
52 | static const QStringList BAUDS = { | 57 | static const QStringList BAUDS = { | ||
Show All 15 Lines |