Mercurial > trustbridge
comparison ui/mainwindow.cpp @ 271:1ae15ea73850
Some GUI desing and layout changes.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 02 Apr 2014 13:36:21 +0200 |
parents | 89e8783866f8 |
children | 90432cb1f374 |
comparison
equal
deleted
inserted
replaced
267:89e8783866f8 | 271:1ae15ea73850 |
---|---|
10 #include <QFile> | 10 #include <QFile> |
11 #include <QTimer> | 11 #include <QTimer> |
12 #include <QHBoxLayout> | 12 #include <QHBoxLayout> |
13 #include <QVBoxLayout> | 13 #include <QVBoxLayout> |
14 #include <QGroupBox> | 14 #include <QGroupBox> |
15 #include <QPushButton> | |
16 #include <QSplitter> | 15 #include <QSplitter> |
17 #include <QLabel> | 16 #include <QLabel> |
18 #include <QImage> | 17 #include <QImage> |
19 #include <QCheckBox> | 18 #include <QCheckBox> |
20 | 19 |
237 | 236 |
238 // Layouts and Container | 237 // Layouts and Container |
239 QHBoxLayout *mainLayout = new QHBoxLayout; | 238 QHBoxLayout *mainLayout = new QHBoxLayout; |
240 QVBoxLayout *infoLayout = new QVBoxLayout; | 239 QVBoxLayout *infoLayout = new QVBoxLayout; |
241 QVBoxLayout *certLayout = new QVBoxLayout; | 240 QVBoxLayout *certLayout = new QVBoxLayout; |
241 QVBoxLayout *detailLayout = new QVBoxLayout; | |
242 QHBoxLayout *headerLayout = new QHBoxLayout; | 242 QHBoxLayout *headerLayout = new QHBoxLayout; |
243 QVBoxLayout *headerTextLayout = new QVBoxLayout; | 243 QVBoxLayout *headerTextLayout = new QVBoxLayout; |
244 QVBoxLayout *toolLayout = new QVBoxLayout; | 244 QVBoxLayout *toolLayout = new QVBoxLayout; |
245 QHBoxLayout *toolButtonLayout = new QHBoxLayout; | 245 QHBoxLayout *bottomLayout = new QHBoxLayout; |
246 | 246 |
247 // The certificate list | 247 // The certificate list |
248 QGroupBox *certBox = new QGroupBox(tr("Managed Certificates")); | 248 QGroupBox *certBox = new QGroupBox(tr("Managed Certificates")); |
249 certificateList = new QListWidget; | 249 certificateList = new QListWidget; |
250 certificateList->setItemDelegate(new CertificateItemDelegate); | 250 certificateList->setItemDelegate(new CertificateItemDelegate); |
265 headerLayout->addWidget(logo); | 265 headerLayout->addWidget(logo); |
266 headerLayout->addLayout(headerTextLayout); | 266 headerLayout->addLayout(headerTextLayout); |
267 headerLayout->setStretch(0, 0); | 267 headerLayout->setStretch(0, 0); |
268 headerLayout->setStretch(1, 10); | 268 headerLayout->setStretch(1, 10); |
269 | 269 |
270 // The tools to update the certificate list/software and install | 270 // The settings. |
271 // certificates. | |
272 QCheckBox *autoUpdateOption = new QCheckBox(tr("autoupdate")); | 271 QCheckBox *autoUpdateOption = new QCheckBox(tr("autoupdate")); |
273 toolLayout->addWidget(autoUpdateOption); | 272 toolLayout->addWidget(autoUpdateOption); |
274 // connect(autoUpdateOption, SIGNAL(stateChanged()), this, SLOT(setAutoUpdate())); | 273 // connect(autoUpdateOption, SIGNAL(stateChanged()), this, SLOT(setAutoUpdate())); |
275 QPushButton *update = new QPushButton(tr("Search for Updates")); | 274 |
276 connect(update, SIGNAL(clicked()), this, SLOT(checkUpdates())); | 275 // The buttons. |
277 QPushButton *install = new QPushButton(tr("Install selected")); | 276 bottomLayout->setAlignment(Qt::AlignBottom); |
278 // connect(update, SIGNAL(clicked()), this, SLOT(installCertificates())); | 277 installButton = new QPushButton(tr("Install selected")); |
279 toolButtonLayout->addWidget(update); | 278 installButton->setFixedHeight(80); |
280 toolButtonLayout->addWidget(install); | 279 connect(installButton, SIGNAL(clicked()), this, SLOT(resizeButtons())); |
281 toolButtonLayout->insertStretch(2, 10); | 280 quitButton = new QPushButton(tr("Quit")); |
282 toolLayout->addLayout(toolButtonLayout); | 281 quitButton->setFixedHeight(20); |
282 connect(quitButton, SIGNAL(clicked()), qApp, SLOT(quit())); | |
283 bottomLayout->insertStretch(0, 10); | |
284 bottomLayout->addWidget(installButton); | |
285 bottomLayout->setAlignment(installButton, Qt::AlignBottom); | |
286 bottomLayout->addWidget(quitButton); | |
287 bottomLayout->setAlignment(quitButton, Qt::AlignBottom); | |
283 | 288 |
284 // The certificate details | 289 // The certificate details |
290 QGroupBox *detailBox = new QGroupBox(tr("Details")); | |
285 certificateDetails = new QTextEdit; | 291 certificateDetails = new QTextEdit; |
286 certificateDetails->setReadOnly(true); | 292 certificateDetails->setReadOnly(true); |
293 detailLayout->addWidget(certificateDetails); | |
294 detailBox->setLayout(detailLayout); | |
287 | 295 |
288 infoLayout->addSpacing(20); | 296 infoLayout->addSpacing(20); |
289 infoLayout->addLayout(headerLayout); | 297 infoLayout->addLayout(headerLayout); |
290 infoLayout->addLayout(toolLayout); | 298 infoLayout->addLayout(toolLayout); |
291 infoLayout->addWidget(certificateDetails); | 299 infoLayout->addWidget(detailBox); |
300 infoLayout->addLayout(bottomLayout); | |
292 | 301 |
293 mainLayout->addWidget(certBox); | 302 mainLayout->addWidget(certBox); |
294 mainLayout->addLayout(infoLayout); | 303 mainLayout->addLayout(infoLayout); |
295 | 304 |
296 | 305 |
373 qDebug() << "show details"; | 382 qDebug() << "show details"; |
374 QString details = item->data(Qt::UserRole).toString(); | 383 QString details = item->data(Qt::UserRole).toString(); |
375 details.append("\rInstalled: 1.1.1971\rRemoved: 1.1.1971"); | 384 details.append("\rInstalled: 1.1.1971\rRemoved: 1.1.1971"); |
376 certificateDetails->setPlainText(details); | 385 certificateDetails->setPlainText(details); |
377 } | 386 } |
387 | |
388 void MainWindow::resizeButtons() | |
389 { | |
390 installButton->setFixedHeight(20); | |
391 quitButton->setFixedHeight(80); | |
392 } |