comparison ui/mainwindow.cpp @ 787:07cc0aabf782

(issue60) Make update list button less prominent and icon only
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 14 Jul 2014 16:07:55 +0200
parents e65e2a0be7c8
children 399bc0df073d
comparison
equal deleted inserted replaced
786:4eff77851e76 787:07cc0aabf782
511 511
512 /* The header */ 512 /* The header */
513 QGridLayout *updatesHeaderLayout = new QGridLayout; 513 QGridLayout *updatesHeaderLayout = new QGridLayout;
514 514
515 /* Header 1: Update date and search button */ 515 /* Header 1: Update date and search button */
516 QHBoxLayout *updateDateAndSearchButton = new QHBoxLayout;
516 mUpdatesHeader = 517 mUpdatesHeader =
517 new QLabel("<h2>" + tr("Certificates unchanged")+ "</h2>"); 518 new QLabel("<h2>" + tr("Certificates unchanged")+ "</h2>");
518 mLastCertUpdate = 519 mLastCertUpdate =
519 new QLabel(tr("Installed certificates from:")); 520 new QLabel(tr("Installed certificates from:"));
520 mLastCertUpdateContents = new QLabel(QString()); 521 mLastCertUpdateContents = new QLabel(QString());
521 mLastCertUpdate->hide(); 522 mLastCertUpdate->hide();
522 mLastCertUpdateContents->hide(); 523 mLastCertUpdateContents->hide();
523 mSoftwareVersionLabel = 524 mSoftwareVersionLabel =
524 new QLabel(tr("TrustBridge Version:")); 525 new QLabel(tr("TrustBridge Version:"));
525 mSoftwareVersionContents = new QLabel(QApplication::applicationVersion()); 526 mSoftwareVersionContents = new QLabel(QApplication::applicationVersion());
527
526 const QDateTime lastCheck = mSettings.value("lastUpdateCheck").toDateTime().toLocalTime(); 528 const QDateTime lastCheck = mSettings.value("lastUpdateCheck").toDateTime().toLocalTime();
527 if (lastCheck.isValid()) { 529 if (lastCheck.isValid()) {
528 const QString lastUpdateCheck = QLocale::system().toString(lastCheck, DATETIME_FORMAT); 530 const QString lastUpdateCheck = QLocale::system().toString(lastCheck, DATETIME_FORMAT);
529 mLastUpdateCheck = 531 mLastUpdateCheck =
530 new QLabel(tr("Last successful update check:")); 532 new QLabel(tr("Last successful update check:"));
533 mLastUpdateCheck = new QLabel(tr("Last successful update check:")); 535 mLastUpdateCheck = new QLabel(tr("Last successful update check:"));
534 mLastUpdateCheckContents = new QLabel(QString()); 536 mLastUpdateCheckContents = new QLabel(QString());
535 mLastUpdateCheck->hide(); 537 mLastUpdateCheck->hide();
536 mLastUpdateCheckContents->hide(); 538 mLastUpdateCheckContents->hide();
537 } 539 }
538 QPushButton *searchUpdates = new QPushButton(" " + tr("Check for updates")); 540 QPushButton *searchUpdates = new QPushButton();
539 searchUpdates->setIcon(QIcon(":/img/edit-find.png")); 541 searchUpdates->setStyleSheet("QPushButton {border-style: outset; border-width: 0px;}");
542 searchUpdates->setToolTip(tr("Check for updates"));
543 searchUpdates->setIcon(QIcon(":/img/update-list.png"));
540 connect(searchUpdates, SIGNAL(clicked()), this, SLOT(checkUpdates())); 544 connect(searchUpdates, SIGNAL(clicked()), this, SLOT(checkUpdates()));
545 updateDateAndSearchButton->addWidget(mLastUpdateCheckContents);
546 updateDateAndSearchButton->addWidget(searchUpdates);
541 547
542 // addWidget(*Widget, row, column, rowspan, colspan, [Qt::Alignment]) 548 // addWidget(*Widget, row, column, rowspan, colspan, [Qt::Alignment])
543 updatesHeaderLayout->addWidget(mUpdatesHeader, 0, 0, 1, 2); 549 updatesHeaderLayout->addWidget(mUpdatesHeader, 0, 0, 1, 2);
544 updatesHeaderLayout->addWidget(mSoftwareVersionLabel, 1, 0, 1, 1); 550 updatesHeaderLayout->addWidget(mSoftwareVersionLabel, 1, 0, 1, 1);
545 updatesHeaderLayout->addWidget(mSoftwareVersionContents, 1, 1, 1, 1); 551 updatesHeaderLayout->addWidget(mSoftwareVersionContents, 1, 1, 1, 1);
546 updatesHeaderLayout->addWidget(mLastUpdateCheck, 2, 0, 1, 1); 552 updatesHeaderLayout->addWidget(mLastUpdateCheck, 2, 0, 1, 1);
547 updatesHeaderLayout->addWidget(mLastUpdateCheckContents, 2, 1, 1, 1); 553 updatesHeaderLayout->addLayout(updateDateAndSearchButton, 2, 1, 1, 1);
554 // updatesHeaderLayout->addWidget(mLastUpdateCheckContents, 2, 1, 1, 1);
548 updatesHeaderLayout->addWidget(mLastCertUpdate, 3, 0, 1, 1); 555 updatesHeaderLayout->addWidget(mLastCertUpdate, 3, 0, 1, 1);
549 updatesHeaderLayout->addWidget(mLastCertUpdateContents, 3, 1, 1, 1); 556 updatesHeaderLayout->addWidget(mLastCertUpdateContents, 3, 1, 1, 1);
550 updatesHeaderLayout->setColumnStretch(3, 1); 557 updatesHeaderLayout->setColumnStretch(3, 1);
551 558
552 updatesHeaderLayout->addWidget(searchUpdates, 1, 4, 1, 2, Qt::AlignRight); 559 // updatesHeaderLayout->addWidget(searchUpdates, 1, 4, 1, 2, Qt::AlignRight);
553 updatesHeaderLayout->setRowMinimumHeight(4, 15); 560 updatesHeaderLayout->setRowMinimumHeight(4, 15);
554 561
555 /* Header 2: Action text and buttons */ 562 /* Header 2: Action text and buttons */
556 mUpdatesTip = 563 mUpdatesTip =
557 new QLabel(tr("There are currently no changes for your certificate stores.")); 564 new QLabel(tr("There are currently no changes for your certificate stores."));

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