-
Notifications
You must be signed in to change notification settings - Fork 0
/
settingstabpage.cpp
executable file
·120 lines (89 loc) · 3.85 KB
/
settingstabpage.cpp
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
#include "settingstabpage.hpp"
#include "preferences.hpp"
#include <QGroupBox>
#include <QLayout>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QColorDialog>
#include <QLineEdit>
#include <QPushButton>
#include <QGridLayout>
#include <QLabel>
const int LINE_EDIT_WIDTH = 120;
SettingsTabPage::SettingsTabPage()
{
// Preferences *prefs = Preferences::instance();
// connect(textEdit1, SIGNAL(textChanged(QString)), prefs, SLOT(setTurbineName1(QString)));
// connect(prefs,SIGNAL(turbineName1Changed(QString)), this, SLOT(setTurbineName1(QString)));
// connect(textEdit2, SIGNAL(textChanged(QString)), prefs, SLOT(setTurbineName2(QString)));
// connect(prefs,SIGNAL(turbineName2Changed(QString)), this, SLOT(setTurbineName2(QString)));
// connect(textEdit3, SIGNAL(textChanged(QString)), prefs, SLOT(setTurbineName3(QString)));
// connect(prefs,SIGNAL(turbineName3Changed(QString)), this, SLOT(setTurbineName3(QString)));
// connect(textEdit4, SIGNAL(textChanged(QString)), prefs, SLOT(setTurbineName4(QString)));
// connect(prefs,SIGNAL(turbineName4Changed(QString)), this, SLOT(setTurbineName4(QString)));
// connect(textEdit5, SIGNAL(textChanged(QString)), prefs, SLOT(setTurbineName5(QString)));
// connect(prefs,SIGNAL(turbineName5Changed(QString)), this, SLOT(setTurbineName5(QString)));
QVBoxLayout *vlayout = new QVBoxLayout;
QHBoxLayout *settingsLayout = new QHBoxLayout;
QHBoxLayout *buttonLayout = new QHBoxLayout;
vlayout->addLayout(settingsLayout);
vlayout->addLayout(buttonLayout);
QPushButton *applyButton = new QPushButton("&Apply");
applyButton->setFixedWidth(100);
buttonLayout->addWidget(applyButton, 0, Qt::AlignRight);
applyButton->setDisabled(true);
QGroupBox *turbinesBox = new QGroupBox("Turbines Settings");
QGroupBox *plotBox = new QGroupBox("Plot Settings");
settingsLayout->addWidget(turbinesBox);
settingsLayout->addWidget(plotBox);
QGridLayout *turbinesNamesGrid = new QGridLayout;
turbinesBox->setLayout(turbinesNamesGrid);
QLabel *label1 = new QLabel("<font color='black'>Turbine 1: </font>");
turbinesNamesGrid->addWidget(label1,0,0);
QLineEdit *lineEdit1 = new QLineEdit;
lineEdit1->setFixedWidth(LINE_EDIT_WIDTH);
turbinesNamesGrid->addWidget(lineEdit1, 0, 1);
QLabel *label2 = new QLabel("<font color='black'>Turbine 2: </font>");
turbinesNamesGrid->addWidget(label2,1,0);
QLineEdit *lineEdit2 = new QLineEdit;
lineEdit1->setFixedWidth(LINE_EDIT_WIDTH);
turbinesNamesGrid->addWidget(lineEdit2, 1, 1);
QLabel *label3 = new QLabel("<font color='black'>Turbine 3: </font>");
turbinesNamesGrid->addWidget(label3,2,0);
QLineEdit *lineEdit3 = new QLineEdit;
lineEdit1->setFixedWidth(LINE_EDIT_WIDTH);
turbinesNamesGrid->addWidget(lineEdit3, 2, 1);
QLabel *label4 = new QLabel("<font color='black'>Turbine 4: </font>");
turbinesNamesGrid->addWidget(label4,3,0);
QLineEdit *lineEdit4 = new QLineEdit;
lineEdit1->setFixedWidth(LINE_EDIT_WIDTH);
turbinesNamesGrid->addWidget(lineEdit4, 3, 1);
QLabel *label5 = new QLabel("<font color='black'>Turbine 5: </font>");
turbinesNamesGrid->addWidget(label5,4,0);
QLineEdit *lineEdit5 = new QLineEdit;
lineEdit1->setFixedWidth(LINE_EDIT_WIDTH);
turbinesNamesGrid->addWidget(lineEdit5, 4, 1);
QGridLayout *plotGrid = new QGridLayout;
plotBox->setLayout(plotGrid);
this->setLayout(vlayout);
}
void SettingsTabPage::setTurbineName1(QString name)
{
groupBox1->setTitle(name);
}
void SettingsTabPage::setTurbineName2(QString name)
{
groupBox2->setTitle(name);
}
void SettingsTabPage::setTurbineName3(QString name)
{
groupBox3->setTitle(name);
}
void SettingsTabPage::setTurbineName4(QString name)
{
groupBox4->setTitle(name);
}
void SettingsTabPage::setTurbineName5(QString name)
{
groupBox5->setTitle(name);
}