# HG changeset patch # User Raimund Renkert # Date 1395821446 -3600 # Node ID 0c06a608e15f7a8bfadfbb5c8154c3a0da6ac5c1 # Parent f09a0817e3bcc553c152158e0dacb4e3a215bd4e Create the mainwindow content. diff -r f09a0817e3bc -r 0c06a608e15f ui/mainwindow.cpp --- a/ui/mainwindow.cpp Tue Mar 25 09:23:47 2014 +0100 +++ b/ui/mainwindow.cpp Wed Mar 26 09:10:46 2014 +0100 @@ -9,6 +9,11 @@ #include #include #include +#include +#include +#include +#include +#include // The amount of time in minutes stay silent if we have // something to say @@ -26,6 +31,7 @@ createActions(); createTrayIcon(); createMenuBar(); + createContent(); qRegisterMetaType("SSLConnection::ErrorCode"); connect(mTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), @@ -213,6 +219,35 @@ setMenuBar(mMenuBar); } +void MainWindow::createContent() +{ + // Create a central widget containing the main layout. + QWidget *base = new QWidget; + + QVBoxLayout *mainLayout = new QVBoxLayout; + QHBoxLayout *certLayout = new QHBoxLayout; + QHBoxLayout *bottomLayout = new QHBoxLayout; + + QGroupBox *certBox = new QGroupBox(tr("Managed Certificates")); + QListWidget *certificates = new QListWidget; + QListWidget *details = new QListWidget; + certLayout->addWidget(certificates); + certLayout->addWidget(details); + certBox->setLayout(certLayout); + + QPushButton *update = new QPushButton("Search for Updates"); + connect(update, SIGNAL(clicked()), this, SLOT(checkUpdates())); + bottomLayout->insertStretch(0, 10); + bottomLayout->addWidget(update); + mainLayout->addWidget(certBox); + mainLayout->addLayout(bottomLayout); + + // QMainWindow allready has a layout. All child layouts and widgets are + // managed in the central widget. + base->setLayout(mainLayout); + setCentralWidget(base); +} + void MainWindow::showSettings() { qDebug() << "show settingsdialog"; } @@ -226,3 +261,4 @@ { qDebug() << "show aboutdialog"; } + diff -r f09a0817e3bc -r 0c06a608e15f ui/mainwindow.h --- a/ui/mainwindow.h Tue Mar 25 09:23:47 2014 +0100 +++ b/ui/mainwindow.h Wed Mar 26 09:10:46 2014 +0100 @@ -63,6 +63,7 @@ void createTrayIcon(); void createActions(); void createMenuBar(); + void createContent(); QString mCurMessage; QString mInstalledSWVersion;