# HG changeset patch # User Raimund Renkert # Date 1396438581 -7200 # Node ID 1ae15ea738501fe5c752801327e00682ea7da44e # Parent 89e8783866f8278b13eccffa588f76773de1ffba Some GUI desing and layout changes. diff -r 89e8783866f8 -r 1ae15ea73850 ui/mainwindow.cpp --- a/ui/mainwindow.cpp Wed Apr 02 09:27:24 2014 +0200 +++ b/ui/mainwindow.cpp Wed Apr 02 13:36:21 2014 +0200 @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -239,10 +238,11 @@ QHBoxLayout *mainLayout = new QHBoxLayout; QVBoxLayout *infoLayout = new QVBoxLayout; QVBoxLayout *certLayout = new QVBoxLayout; + QVBoxLayout *detailLayout = new QVBoxLayout; QHBoxLayout *headerLayout = new QHBoxLayout; QVBoxLayout *headerTextLayout = new QVBoxLayout; QVBoxLayout *toolLayout = new QVBoxLayout; - QHBoxLayout *toolButtonLayout = new QHBoxLayout; + QHBoxLayout *bottomLayout = new QHBoxLayout; // The certificate list QGroupBox *certBox = new QGroupBox(tr("Managed Certificates")); @@ -267,28 +267,37 @@ headerLayout->setStretch(0, 0); headerLayout->setStretch(1, 10); - // The tools to update the certificate list/software and install - // certificates. + // The settings. QCheckBox *autoUpdateOption = new QCheckBox(tr("autoupdate")); toolLayout->addWidget(autoUpdateOption); // connect(autoUpdateOption, SIGNAL(stateChanged()), this, SLOT(setAutoUpdate())); - QPushButton *update = new QPushButton(tr("Search for Updates")); - connect(update, SIGNAL(clicked()), this, SLOT(checkUpdates())); - QPushButton *install = new QPushButton(tr("Install selected")); -// connect(update, SIGNAL(clicked()), this, SLOT(installCertificates())); - toolButtonLayout->addWidget(update); - toolButtonLayout->addWidget(install); - toolButtonLayout->insertStretch(2, 10); - toolLayout->addLayout(toolButtonLayout); + + // The buttons. + bottomLayout->setAlignment(Qt::AlignBottom); + installButton = new QPushButton(tr("Install selected")); + installButton->setFixedHeight(80); + connect(installButton, SIGNAL(clicked()), this, SLOT(resizeButtons())); + quitButton = new QPushButton(tr("Quit")); + quitButton->setFixedHeight(20); + connect(quitButton, SIGNAL(clicked()), qApp, SLOT(quit())); + bottomLayout->insertStretch(0, 10); + bottomLayout->addWidget(installButton); + bottomLayout->setAlignment(installButton, Qt::AlignBottom); + bottomLayout->addWidget(quitButton); + bottomLayout->setAlignment(quitButton, Qt::AlignBottom); // The certificate details + QGroupBox *detailBox = new QGroupBox(tr("Details")); certificateDetails = new QTextEdit; certificateDetails->setReadOnly(true); + detailLayout->addWidget(certificateDetails); + detailBox->setLayout(detailLayout); infoLayout->addSpacing(20); infoLayout->addLayout(headerLayout); infoLayout->addLayout(toolLayout); - infoLayout->addWidget(certificateDetails); + infoLayout->addWidget(detailBox); + infoLayout->addLayout(bottomLayout); mainLayout->addWidget(certBox); mainLayout->addLayout(infoLayout); @@ -375,3 +384,9 @@ details.append("\rInstalled: 1.1.1971\rRemoved: 1.1.1971"); certificateDetails->setPlainText(details); } + +void MainWindow::resizeButtons() +{ + installButton->setFixedHeight(20); + quitButton->setFixedHeight(80); +} diff -r 89e8783866f8 -r 1ae15ea73850 ui/mainwindow.h --- a/ui/mainwindow.h Wed Apr 02 09:27:24 2014 +0200 +++ b/ui/mainwindow.h Wed Apr 02 13:36:21 2014 +0200 @@ -12,6 +12,7 @@ #include #include #include +#include #include "downloader.h" #include "certificatelist.h" @@ -53,6 +54,7 @@ void showHelp(); void showAbout(); void showDetails(QListWidgetItem*); + void resizeButtons(); private: /** @brief check the integrity of available files. @@ -88,6 +90,8 @@ QListWidget *certificateList; QTextEdit *certificateDetails; + QPushButton *installButton; + QPushButton *quitButton; }; #endif // MAINWINDOW_H