Sun, 20 Mar 2022 21:24:13 +0100
Profile Styles now on the mainscreen.
56 | 1 | /** |
2 | * ProfileStyles.cpp is part of bmsapp. | |
3 | * | |
4 | * bmsapp is free software: you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation, either version 3 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * bmsapp is distributed in the hope that it will be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | */ | |
17 | #include "ProfileStyles.h" | |
18 | #include "EditProfileStyle.h" | |
76
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
19 | #include "MainWindow.h" |
56 | 20 | #include "config.h" |
21 | #include "bmsapp.h" | |
22 | ||
23 | ||
76
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
24 | ProfileStyles::ProfileStyles(QWidget *parent) : QDialog(parent) |
56 | 25 | { |
26 | qDebug() << "ProfileStyles start"; | |
27 | ||
76
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
28 | gridLayout = new QGridLayout(this); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
29 | gridLayout->setObjectName(QString::fromUtf8("gridLayout")); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
30 | tableStyles = new QTableWidget(this); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
31 | tableStyles->setObjectName(QString::fromUtf8("tableStyles")); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
32 | tableStyles->setEnabled(true); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
33 | QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
34 | sizePolicy.setHorizontalStretch(0); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
35 | sizePolicy.setVerticalStretch(0); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
36 | tableStyles->setSizePolicy(sizePolicy); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
37 | tableStyles->setMinimumSize(QSize(1049, 0)); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
38 | gridLayout->addWidget(tableStyles, 0, 0, 1, 1); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
39 | |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
40 | groupBox = new QGroupBox(this); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
41 | groupBox->setObjectName(QString::fromUtf8("groupBox")); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
42 | groupBox->setEnabled(true); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
43 | groupBox->setFlat(false); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
44 | horizontalLayout = new QHBoxLayout(groupBox); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
45 | horizontalLayout->setSpacing(6); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
46 | horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
47 | horizontalLayout->setContentsMargins(0, 0, 0, 0); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
48 | |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
49 | quitButton = new QPushButton(groupBox); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
50 | quitButton->setObjectName(QString::fromUtf8("quitButton")); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
51 | quitButton->setMinimumSize(QSize(80, 24)); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
52 | quitButton->setText(tr("Quit")); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
53 | QIcon icon; |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
54 | icon.addFile(QString::fromUtf8(":icons/silk/door_out.png"), QSize(), QIcon::Normal, QIcon::Off); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
55 | quitButton->setIcon(icon); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
56 | horizontalLayout->addWidget(quitButton, 0, Qt::AlignLeft); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
57 | |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
58 | insertButton = new QPushButton(groupBox); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
59 | insertButton->setObjectName(QString::fromUtf8("insertButton")); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
60 | insertButton->setMinimumSize(QSize(80, 24)); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
61 | insertButton->setText(tr("New")); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
62 | QIcon icon3; |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
63 | icon3.addFile(QString::fromUtf8(":icons/silk/table_row_insert.png"), QSize(), QIcon::Normal, QIcon::Off); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
64 | insertButton->setIcon(icon3); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
65 | horizontalLayout->addWidget(insertButton, 0, Qt::AlignRight); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
66 | gridLayout->addWidget(groupBox, 1, 0, 1, 1); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
67 | |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
68 | connect(quitButton, SIGNAL(clicked()), parent, SLOT(fromProfileStyles())); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
69 | connect(insertButton, SIGNAL(clicked()), this, SLOT(on_insertButton_clicked())); |
56 | 70 | emit refreshTable(); |
71 | } | |
72 | ||
73 | ||
74 | void ProfileStyles::refreshTable() | |
75 | { | |
76 | QString w; | |
77 | QWidget* pWidget; | |
78 | QLabel *label; | |
79 | QHBoxLayout* pLayout; | |
80 | ||
81 | qDebug() << "ProfileStyles reload"; | |
82 | ||
83 | QSqlQuery query("SELECT * FROM profile_styles ORDER BY style_guide,style_letter,name"); | |
84 | const QStringList labels({tr("Guide"), tr("Gr"), tr("Name"), tr("OG"), tr("OG"), tr("FG"), tr("FG"), | |
85 | tr("IBU"), tr("IBU"), tr("EBC"), tr("EBC"), tr("Co2"), tr("Co2"), tr("ABV"), tr("ABV"), tr("Edit")}); | |
86 | ||
76
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
87 | this->tableStyles->setColumnCount(16); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
88 | this->tableStyles->setColumnWidth(0, 100); /* Guide */ |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
89 | this->tableStyles->setColumnWidth(1, 25); /* Group */ |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
90 | this->tableStyles->setColumnWidth(2, 300); /* Name */ |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
91 | this->tableStyles->setColumnWidth(3, 50); /* OG */ |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
92 | this->tableStyles->setColumnWidth(4, 50); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
93 | this->tableStyles->setColumnWidth(5, 50); /* FG */ |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
94 | this->tableStyles->setColumnWidth(6, 50); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
95 | this->tableStyles->setColumnWidth(7, 40); /* IBU */ |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
96 | this->tableStyles->setColumnWidth(8, 40); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
97 | this->tableStyles->setColumnWidth(9, 40); /* EBC */ |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
98 | this->tableStyles->setColumnWidth(10, 40); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
99 | this->tableStyles->setColumnWidth(11, 40); /* Co2 */ |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
100 | this->tableStyles->setColumnWidth(12, 40); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
101 | this->tableStyles->setColumnWidth(13, 40); /* ABV */ |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
102 | this->tableStyles->setColumnWidth(14, 40); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
103 | this->tableStyles->setColumnWidth(15, 80); /* Edit button */ |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
104 | this->tableStyles->setRowCount(query.size()); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
105 | this->tableStyles->setHorizontalHeaderLabels(labels); |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
106 | this->tableStyles->verticalHeader()->hide(); |
56 | 107 | |
108 | QTableWidgetItem *rightitem = new QTableWidgetItem(); | |
109 | rightitem->setTextAlignment(Qt::AlignRight); | |
110 | ||
111 | query.first(); | |
112 | for (int ridx = 0 ; ridx < query.size() ; ridx++ ) { | |
76
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
113 | this->tableStyles->setItem(ridx, 0, new QTableWidgetItem(query.value(5).toString())); /* Guide */ |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
114 | this->tableStyles->setItem(ridx, 1, new QTableWidgetItem(query.value(4).toString())); /* Goup */ |
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
115 | this->tableStyles->setItem(ridx, 2, new QTableWidgetItem(query.value(1).toString())); /* Name */ |
56 | 116 | |
117 | w = QString("%1").arg(query.value(7).toDouble(), 4, 'f', 3, '0' ); /* OG */ | |
118 | QTableWidgetItem *item = new QTableWidgetItem(w); | |
119 | item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); | |
76
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
120 | this->tableStyles->setItem(ridx, 3, item); |
56 | 121 | |
122 | w = QString("%1").arg(query.value(8).toDouble(), 4, 'f', 3, '0' ); /* OG */ | |
123 | item = new QTableWidgetItem(w); | |
124 | item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); | |
76
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
125 | this->tableStyles->setItem(ridx, 4, item); |
56 | 126 | |
127 | w = QString("%1").arg(query.value(9).toDouble(), 4, 'f', 3, '0' ); /* FG */ | |
128 | item = new QTableWidgetItem(w); | |
129 | item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); | |
76
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
130 | this->tableStyles->setItem(ridx, 5, item); |
56 | 131 | |
132 | w = QString("%1").arg(query.value(10).toDouble(), 4, 'f', 3, '0' ); /* FG */ | |
133 | item = new QTableWidgetItem(w); | |
134 | item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); | |
76
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
135 | this->tableStyles->setItem(ridx, 6, item); |
56 | 136 | |
137 | w = QString("%1").arg(query.value(11).toDouble(), 1, 'f', 0, '0' ); /* IBU */ | |
138 | item = new QTableWidgetItem(w); | |
139 | item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); | |
76
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
140 | this->tableStyles->setItem(ridx, 7, item); |
56 | 141 | |
142 | w = QString("%1").arg(query.value(12).toDouble(), 1, 'f', 0, '0' ); /* IBU */ | |
143 | item = new QTableWidgetItem(w); | |
144 | item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); | |
76
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
145 | this->tableStyles->setItem(ridx, 8, item); |
56 | 146 | |
147 | w = QString("%1").arg(query.value(13).toDouble(), 1, 'f', 0, '0' ); /* EBC */ | |
148 | item = new QTableWidgetItem(w); | |
149 | item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); | |
76
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
150 | this->tableStyles->setItem(ridx, 9, item); |
56 | 151 | |
152 | w = QString("%1").arg(query.value(14).toDouble(), 1, 'f', 0, '0' ); /* EBC */ | |
153 | item = new QTableWidgetItem(w); | |
154 | item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); | |
76
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
155 | this->tableStyles->setItem(ridx, 10, item); |
56 | 156 | |
157 | w = QString("%1").arg(query.value(15).toDouble(), 2, 'f', 1, '0' ); /* Co2 */ | |
158 | item = new QTableWidgetItem(w); | |
159 | item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); | |
76
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
160 | this->tableStyles->setItem(ridx, 11, item); |
56 | 161 | |
162 | w = QString("%1").arg(query.value(16).toDouble(), 2, 'f', 1, '0' ); /* Co2 */ | |
163 | item = new QTableWidgetItem(w); | |
164 | item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); | |
76
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
165 | this->tableStyles->setItem(ridx, 12, item); |
56 | 166 | |
167 | w = QString("%1").arg(query.value(17).toDouble(), 2, 'f', 1, '0' ); /* ABV */ | |
168 | item = new QTableWidgetItem(w); | |
169 | item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); | |
76
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
170 | this->tableStyles->setItem(ridx, 13, item); |
56 | 171 | |
172 | w = QString("%1").arg(query.value(18).toDouble(), 2, 'f', 1, '0' ); /* ABV */ | |
173 | item = new QTableWidgetItem(w); | |
174 | item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); | |
76
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
175 | this->tableStyles->setItem(ridx, 14, item); |
56 | 176 | |
177 | /* Add the Edit button */ | |
178 | pWidget = new QWidget(); | |
179 | QPushButton* btn_edit = new QPushButton(); | |
180 | btn_edit->setObjectName(QString("%1").arg(query.value(0).toString())); /* Send record with the button */ | |
181 | btn_edit->setText(tr("Edit")); | |
182 | connect(btn_edit, SIGNAL(clicked()), this, SLOT(on_editButton_clicked())); | |
183 | pLayout = new QHBoxLayout(pWidget); | |
184 | pLayout->addWidget(btn_edit); | |
185 | pLayout->setContentsMargins(5, 0, 5, 0); | |
186 | pWidget->setLayout(pLayout); | |
76
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
187 | this->tableStyles->setCellWidget(ridx, 15, pWidget); |
56 | 188 | query.next(); |
189 | } | |
190 | } | |
191 | ||
192 | ||
76
93395c4d6c8d
Profile Styles now on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
56
diff
changeset
|
193 | ProfileStyles::~ProfileStyles() {} |
56 | 194 | |
195 | ||
196 | void ProfileStyles::edit(int recno) | |
197 | { | |
198 | EditProfileStyle dialog(recno, this); | |
199 | /* Signal from editor if a refresh is needed */ | |
200 | connect(&dialog, SIGNAL(entry_changed()), this, SLOT(refreshTable())); | |
201 | dialog.setModal(true); | |
202 | dialog.exec(); | |
203 | } | |
204 | ||
205 | ||
206 | void ProfileStyles::on_editButton_clicked() | |
207 | { | |
208 | QPushButton *pb = qobject_cast<QPushButton *>(QObject::sender()); | |
209 | int recno = pb->objectName().toInt(); | |
210 | edit(recno); | |
211 | } | |
212 | ||
213 | ||
214 | void ProfileStyles::on_insertButton_clicked() | |
215 | { | |
216 | edit(-1); | |
217 | } | |
218 | ||
219 |