[PATCH 5 of 5] (issue60) Make windows smaller and change details buttons to icon only

Wald Commits scm-commit at wald.intevation.org
Mon Jul 14 18:27:55 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1405355266 -7200
# Node ID 399bc0df073d4c94d553c284c7d6cd8b31c875e3
# Parent  2e954efcb3f196733f1e208fd3ea3b4444a06757
(issue60) Make windows smaller and change details buttons to icon only

diff -r 2e954efcb3f1 -r 399bc0df073d ui/icons.qrc
--- a/ui/icons.qrc	Mon Jul 14 18:26:55 2014 +0200
+++ b/ui/icons.qrc	Mon Jul 14 18:27:46 2014 +0200
@@ -19,5 +19,7 @@
     <file>img/security-high.png</file>
     <file>img/trash-empty.png</file>
     <file>img/update-list.png</file>
+    <file>img/arrow-left-double.png</file>
+    <file>img/arrow-down-double.png</file>
 </qresource>
 </RCC>
diff -r 2e954efcb3f1 -r 399bc0df073d ui/img/arrow-down-double.png
Binary file ui/img/arrow-down-double.png has changed
diff -r 2e954efcb3f1 -r 399bc0df073d ui/img/arrow-left-double.png
Binary file ui/img/arrow-left-double.png has changed
diff -r 2e954efcb3f1 -r 399bc0df073d ui/mainwindow.cpp
--- a/ui/mainwindow.cpp	Mon Jul 14 18:26:55 2014 +0200
+++ b/ui/mainwindow.cpp	Mon Jul 14 18:27:46 2014 +0200
@@ -80,7 +80,7 @@
     createActions();
     createTrayIcon();
     setupGUI();
-    resize(1065, 600);
+    resize(900, 600);
     setMinimumWidth(760);
     qRegisterMetaType<SSLConnection::ErrorCode>("SSLConnection::ErrorCode");
     qRegisterMetaType<Certificate::Status>("Certificate::Status");
@@ -533,9 +533,7 @@
         mLastUpdateCheckContents = new QLabel(lastUpdateCheck);
     } else {
         mLastUpdateCheck = new QLabel(tr("Last successful update check:"));
-        mLastUpdateCheckContents = new QLabel(QString());
-        mLastUpdateCheck->hide();
-        mLastUpdateCheckContents->hide();
+        mLastUpdateCheckContents = new QLabel(tr("No connection with the updateserver."));
     }
     QPushButton *searchUpdates = new QPushButton();
     searchUpdates->setStyleSheet("QPushButton {border-style: outset; border-width: 0px;}");
@@ -585,7 +583,7 @@
     updatesHeaderLayout->addWidget(mUpdatesTip, 5, 0, 1, 4);
     updatesHeaderActionButtonLayout->addWidget(mInstallButton);
     updatesHeaderActionButtonLayout->addWidget(mQuitButton);
-    updatesHeaderLayout->addLayout(updatesHeaderActionButtonLayout, 6, 0, 1, 3, Qt::AlignLeft);
+    updatesHeaderLayout->addLayout(updatesHeaderActionButtonLayout, 6, 0, 1, -1, Qt::AlignRight);
     updatesHeaderLayout->setRowMinimumHeight(7, 10);
 
     /* The central panels. */
@@ -598,14 +596,17 @@
         new QLabel("<h3>" +
             tr("Install new trusted certificates (%1/%2)").arg(0).arg(0) +
             "</h3>");
-    mUpdatesDetailsNew = new QPushButton(tr("Show details"));
+    mUpdatesDetailsNew = new QPushButton();
+    mUpdatesDetailsNew->setToolTip(tr("Show details"));
+    mUpdatesDetailsNew->setStyleSheet("QPushButton {border-style: outset; border-width: 0px;}");
+    mUpdatesDetailsNew->setIcon(QIcon(":/img/arrow-left-double.png"));
     connect(mUpdatesDetailsNew,
         SIGNAL(clicked()),
         this,
         SLOT(toggleUpdatesNew()));
     updatesNewLayout->addWidget(mUpdatesNewCertificates);
+    updatesNewLayout->addWidget(mUpdatesDetailsNew);
     updatesNewLayout->addStretch(1);
-    updatesNewLayout->addWidget(mUpdatesDetailsNew);
     mUpdatesNew = new CertificateListWidget(this);
     connect(mUpdatesNew, SIGNAL(certListChanged(int)),
         this, SLOT(listChanged(int)));
@@ -615,14 +616,17 @@
         new QLabel("<h3>" +
             tr("Remove revoked certificates (%1/%2)").arg(0).arg(0) +
             "</h3>");
-    mUpdatesDetailsRemove = new QPushButton(tr("Show details"));
+    mUpdatesDetailsRemove = new QPushButton();
+    mUpdatesDetailsRemove->setToolTip(tr("Show details"));
+    mUpdatesDetailsRemove->setStyleSheet("QPushButton {border-style: outset; border-width: 0px;}");
+    mUpdatesDetailsRemove->setIcon(QIcon(":/img/arrow-left-double.png"));
     connect(mUpdatesDetailsRemove,
         SIGNAL(clicked()),
         this,
         SLOT(toggleUpdatesRemove()));
     updatesRemoveLayout->addWidget(mUpdatesRemoveCertificates);
+    updatesRemoveLayout->addWidget(mUpdatesDetailsRemove);
     updatesRemoveLayout->addStretch(1);
-    updatesRemoveLayout->addWidget(mUpdatesDetailsRemove);
     mUpdatesRemove = new CertificateListWidget(this);
     connect(mUpdatesRemove, SIGNAL(certListChanged(int)),
         this, SLOT(listChanged(int)));
@@ -632,7 +636,10 @@
         new QLabel("<h3>" +
             tr("Manually changed certificates (%1)").arg(0) +
             "</h3>");
-    mUpdatesDetailsManual = new QPushButton(tr("Show details"));
+    mUpdatesDetailsManual = new QPushButton();
+    mUpdatesDetailsManual->setToolTip(tr("Show details"));
+    mUpdatesDetailsManual->setStyleSheet("QPushButton {border-style: outset; border-width: 0px;}");
+    mUpdatesDetailsManual->setIcon(QIcon(":/img/arrow-left-double.png"));
     connect(mUpdatesDetailsManual,
         SIGNAL(clicked()),
         this,
@@ -640,8 +647,8 @@
     mUpdatesDetailsManual->hide();
     mUpdatesManualCertificates->hide();
     updatesManualLayout->addWidget(mUpdatesManualCertificates);
+    updatesManualLayout->addWidget(mUpdatesDetailsManual);
     updatesManualLayout->addStretch(1);
-    updatesManualLayout->addWidget(mUpdatesDetailsManual);
     mUpdatesManual = new CertificateListWidget(this);
     mUpdatesManual->hide();
     connect(mUpdatesManual, SIGNAL(certChanged(bool, const Certificate&)),
@@ -919,7 +926,8 @@
 
     if (mUpdatesManual->certificates().size()) {
         mUpdatesDetailsManual->show();
-        mUpdatesDetailsManual->setText(tr("Show details"));
+        mUpdatesDetailsManual->setIcon(QIcon(":/img/arrow-left-double.png"));
+        mUpdatesDetailsManual->setToolTip(tr("Show details"));
         mUpdatesManualCertificates->show();
     } else {
         mUpdatesDetailsManual->hide();
@@ -934,7 +942,8 @@
                 .arg(mUpdatesNew->certificates().size()) +
                 "</h3>");
         mUpdatesDetailsNew->show();
-        mUpdatesDetailsNew->setText(tr("Show details"));
+        mUpdatesDetailsNew->setIcon(QIcon(":/img/arrow-left-double.png"));
+        mUpdatesDetailsNew->setToolTip(tr("Show details"));
         mUpdatesNewCertificates->show();
     } else {
         mUpdatesDetailsNew->hide();
@@ -949,7 +958,8 @@
                 .arg(mUpdatesRemove->certificates().size()) +
                 "</h3>");
         mUpdatesRemoveCertificates->show();
-        mUpdatesDetailsRemove->setText(tr("Show details"));
+        mUpdatesDetailsRemove->setIcon(QIcon(":/img/arrow-left-double.png"));
+        mUpdatesDetailsRemove->setToolTip(tr("Show details"));
         mUpdatesDetailsRemove->show();
     } else {
         mUpdatesRemoveCertificates->hide();
@@ -1224,33 +1234,39 @@
 
 void MainWindow::toggleUpdatesNew() {
     if (!mUpdatesNew->isVisible()) {
-        mUpdatesDetailsNew->setText(tr("Hide details"));
+        mUpdatesDetailsNew->setToolTip(tr("Hide details"));
+        mUpdatesDetailsNew->setIcon(QIcon(":/img/arrow-down-double.png"));
         mUpdatesNew->show();
     }
     else {
         mUpdatesNew->hide();
-        mUpdatesDetailsNew->setText(tr("Show details"));
+        mUpdatesDetailsNew->setToolTip(tr("Show details"));
+        mUpdatesDetailsNew->setIcon(QIcon(":/img/arrow-left-double.png"));
     }
 }
 
 void MainWindow::toggleUpdatesRemove() {
     if (!mUpdatesRemove->isVisible()) {
-        mUpdatesDetailsRemove->setText(tr("Hide details"));
+        mUpdatesDetailsRemove->setToolTip(tr("Hide details"));
+        mUpdatesDetailsRemove->setIcon(QIcon(":/img/arrow-down-double.png"));
         mUpdatesRemove->show();
     }
     else {
         mUpdatesRemove->hide();
-        mUpdatesDetailsRemove->setText(tr("Show details"));
+        mUpdatesDetailsRemove->setToolTip(tr("Show details"));
+        mUpdatesDetailsRemove->setIcon(QIcon(":/img/arrow-left-double.png"));
     }
 }
 
 void MainWindow::toggleUpdatesManual() {
     if (!mUpdatesManual->isVisible()) {
-        mUpdatesDetailsManual->setText(tr("Hide details"));
+        mUpdatesDetailsManual->setToolTip(tr("Hide details"));
+        mUpdatesDetailsManual->setIcon(QIcon(":/img/arrow-down-double.png"));
         mUpdatesManual->show();
     }
     else {
-        mUpdatesDetailsManual->setText(tr("Show details"));
+        mUpdatesDetailsManual->setToolTip(tr("Show details"));
+        mUpdatesDetailsManual->setIcon(QIcon(":/img/arrow-left-double.png"));
         mUpdatesManual->hide();
     }
 }


More information about the Trustbridge-commits mailing list