changeset 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 abac76b855b2
files ui/mainwindow.cpp ui/mainwindow.h
diffstat 2 files changed, 32 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- 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 <QHBoxLayout>
 #include <QVBoxLayout>
 #include <QGroupBox>
-#include <QPushButton>
 #include <QSplitter>
 #include <QLabel>
 #include <QImage>
@@ -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);
+}
--- 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 <QMenuBar>
 #include <QListWidget>
 #include <QTextEdit>
+#include <QPushButton>
 
 #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

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