-
Notifications
You must be signed in to change notification settings - Fork 917
Expand file tree
/
Copy pathprefsdialog.h
More file actions
120 lines (102 loc) · 3.66 KB
/
prefsdialog.h
File metadata and controls
120 lines (102 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*******************************************************************
Part of the Fritzing project - http://fritzing.org
Copyright (c) 2007-2019 Fritzing
Fritzing is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Fritzing is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Fritzing. If not, see <http://www.gnu.org/licenses/>.
********************************************************************/
#ifndef PREFSDIALOG_H
#define PREFSDIALOG_H
#include <QDialog>
#include <QFileInfoList>
#include <QHash>
#include <QLabel>
#include <QTabWidget>
#include <QRadioButton>
#include <QLineEdit>
#include <QDoubleValidator>
#include <QPointer>
#include "../program/platform.h"
#include "../mainwindow/mainwindow.h"
#include "../project_properties.h"
struct ViewInfoThing
{
QString viewName;
QString shortName;
int index;
bool curvy;
};
class PrefsDialog : public QDialog
{
Q_OBJECT
public:
PrefsDialog(const QString & language, QWidget *parent = 0);
~PrefsDialog();
bool cleared();
QHash<QString, QString> & settings();
QHash<QString, QString> & tempSettings();
void initLayout(QFileInfoList & languages, QList<Platform *> platforms, MainWindow * mainWindow);
void initViewInfo(int index, const QString & viewName, const QString & shortName, bool curvy);
protected:
QWidget * createLanguageForm(QFileInfoList & languages);
QWidget* createOtherForm();
QWidget* createColorForm();
QWidget * createZoomerForm();
QWidget * createAutosaveForm();
QWidget *createProgrammerForm(QList<Platform *> platforms);
QWidget *createGerberBetaFeaturesForm();
QWidget *createProjectPropertiesForm();
void updateWheelText();
void initGeneral(QWidget * general, QFileInfoList & languages);
void initBreadboard(QWidget *, ViewInfoThing *);
void initSchematic(QWidget *, ViewInfoThing *);
void initPCB(QWidget *, ViewInfoThing *);
void initCode(QWidget *widget, QList<Platform *> platforms);
void initBetaFeatures(QWidget *widget);
QWidget * createCurvyForm(ViewInfoThing *);
protected Q_SLOTS:
void changeLanguage(int);
void clear();
void setConnectedColor();
void setUnconnectedColor();
void changeWheelBehavior();
void toggleAutosave(bool);
void changeAutosavePeriod(int);
void curvyChanged();
void chooseProgrammer();
void setSimulationTimeStepMode(const bool &timeStepMode);
void setSimulationNumberOfSteps(const QString &numberOfSteps);
void setSimulationTimeStep(const QString &timeStep);
void setSimulationAnimationTime(const QString &animationTime);
void setSimulationSpiceOptions(const QString &spiceOptions);
protected:
QPointer<QTabWidget> m_tabWidget;
QPointer<QWidget> m_general;
QPointer<QWidget> m_breadboard;
QPointer<QWidget> m_schematic;
QPointer<QWidget> m_pcb;
QPointer<QWidget> m_code;
QPointer<QWidget> m_beta_features;
QPointer<QLabel> m_wheelLabel;
QPointer<QLabel> m_connectedColorLabel;
QPointer<QLabel> m_unconnectedColorLabel;
QList<Platform *> m_platforms;
QHash<QString, QLineEdit *> m_programmerLEs;
QHash<QString, QString> m_settings;
QHash<QString, QString> m_tempSettings;
QString m_name;
class TranslatorListModel * m_translatorListModel = nullptr;
bool m_cleared = false;
int m_wheelMapping = 0;
ViewInfoThing m_viewInfoThings[3];
MainWindow * m_mainWindow;
QSharedPointer<ProjectProperties> m_projectProperties;
};
#endif