comparison ui/mainwindow.cpp @ 205:a3f542bf38f7

Added header for mainwindow.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 26 Mar 2014 15:21:34 +0100
parents fe424c5fc875
children 9c51c472e596
comparison
equal deleted inserted replaced
201:45f6b62f91e7 205:a3f542bf38f7
12 #include <QHBoxLayout> 12 #include <QHBoxLayout>
13 #include <QVBoxLayout> 13 #include <QVBoxLayout>
14 #include <QGroupBox> 14 #include <QGroupBox>
15 #include <QPushButton> 15 #include <QPushButton>
16 #include <QSplitter> 16 #include <QSplitter>
17 #include <QLabel>
18 #include <QImage>
17 19
18 // The amount of time in minutes stay silent if we have 20 // The amount of time in minutes stay silent if we have
19 // something to say 21 // something to say
20 #define NAG_INTERVAL_MINUTES 2 22 #define NAG_INTERVAL_MINUTES 2
21 23
226 { 228 {
227 // Create a central widget containing the main layout. 229 // Create a central widget containing the main layout.
228 QWidget *base = new QWidget; 230 QWidget *base = new QWidget;
229 231
230 QVBoxLayout *mainLayout = new QVBoxLayout; 232 QVBoxLayout *mainLayout = new QVBoxLayout;
233 QHBoxLayout *headerLayout = new QHBoxLayout;
234 QVBoxLayout *headerTextLayout = new QVBoxLayout;
231 QHBoxLayout *certLayout = new QHBoxLayout; 235 QHBoxLayout *certLayout = new QHBoxLayout;
232 QHBoxLayout *bottomLayout = new QHBoxLayout; 236 QHBoxLayout *bottomLayout = new QHBoxLayout;
237
238 QImage *logoImage = new QImage(":/img/logo.png");
239 QLabel *logo = new QLabel;
240 logo->setBackgroundRole(QPalette::Base);
241 logo->setScaledContents(true);
242 logo->setPixmap(QPixmap::fromImage(*logoImage));
243 QLabel *title = new QLabel("<h3>" + tr("Certificate Installer") + "</h3>");
244 QLabel *subTitle = new QLabel("This Software installs and removes Certificates");
245 headerTextLayout->addWidget(title);
246 headerTextLayout->addWidget(subTitle);
247 headerLayout->addWidget(logo);
248 headerLayout->addLayout(headerTextLayout);
233 249
234 QGroupBox *certBox = new QGroupBox(tr("Managed Certificates")); 250 QGroupBox *certBox = new QGroupBox(tr("Managed Certificates"));
235 certificateList = new QListWidget; 251 certificateList = new QListWidget;
236 connect(certificateList, SIGNAL(itemClicked(QListWidgetItem*)), 252 connect(certificateList, SIGNAL(itemClicked(QListWidgetItem*)),
237 this, SLOT(showDetails(QListWidgetItem*))); 253 this, SLOT(showDetails(QListWidgetItem*)));
245 261
246 QPushButton *update = new QPushButton("Search for Updates"); 262 QPushButton *update = new QPushButton("Search for Updates");
247 connect(update, SIGNAL(clicked()), this, SLOT(checkUpdates())); 263 connect(update, SIGNAL(clicked()), this, SLOT(checkUpdates()));
248 bottomLayout->insertStretch(0, 10); 264 bottomLayout->insertStretch(0, 10);
249 bottomLayout->addWidget(update); 265 bottomLayout->addWidget(update);
266 mainLayout->addLayout(headerLayout);
250 mainLayout->addWidget(certBox); 267 mainLayout->addWidget(certBox);
251 mainLayout->addLayout(bottomLayout); 268 mainLayout->addLayout(bottomLayout);
252 269
253 // QMainWindow allready has a layout. All child layouts and widgets are 270 // QMainWindow allready has a layout. All child layouts and widgets are
254 // managed in the central widget. 271 // managed in the central widget.

http://wald.intevation.org/projects/trustbridge/