comparison ui/mainwindow.cpp @ 1094:03a1f3761f45

(issue111) Move Version label into header. This makes the subtitle slightly larger so that the version label looks smaller.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 15 Sep 2014 10:35:05 +0200
parents 153af47456d0
children a0fb21625cf3
comparison
equal deleted inserted replaced
1093:153af47456d0 1094:03a1f3761f45
609 mLastCertUpdate = 609 mLastCertUpdate =
610 new QLabel(tr("Installed certificates from:")); 610 new QLabel(tr("Installed certificates from:"));
611 mLastCertUpdateContents = new QLabel(QString()); 611 mLastCertUpdateContents = new QLabel(QString());
612 mLastCertUpdate->hide(); 612 mLastCertUpdate->hide();
613 mLastCertUpdateContents->hide(); 613 mLastCertUpdateContents->hide();
614 mSoftwareVersionLabel =
615 new QLabel(tr("TrustBridge Version:"));
616 mSoftwareVersionContents = new QLabel(QApplication::applicationVersion());
617
618 const QDateTime lastCheck = mSettings.value("lastUpdateCheck").toDateTime().toLocalTime(); 614 const QDateTime lastCheck = mSettings.value("lastUpdateCheck").toDateTime().toLocalTime();
619 if (lastCheck.isValid()) { 615 if (lastCheck.isValid()) {
620 const QString lastUpdateCheck = QLocale::system().toString(lastCheck, DATETIME_FORMAT); 616 const QString lastUpdateCheck = QLocale::system().toString(lastCheck, DATETIME_FORMAT);
621 mLastUpdateCheck = 617 mLastUpdateCheck =
622 new QLabel(tr("Last successful update check:")); 618 new QLabel(tr("Last successful update check:"));
634 updateDateAndSearchButton->addWidget(mLastUpdateCheckContents); 630 updateDateAndSearchButton->addWidget(mLastUpdateCheckContents);
635 updateDateAndSearchButton->addWidget(searchUpdates); 631 updateDateAndSearchButton->addWidget(searchUpdates);
636 632
637 // addWidget(*Widget, row, column, rowspan, colspan, [Qt::Alignment]) 633 // addWidget(*Widget, row, column, rowspan, colspan, [Qt::Alignment])
638 updatesHeaderLayout->addWidget(mUpdatesHeader, 0, 0, 1, 2); 634 updatesHeaderLayout->addWidget(mUpdatesHeader, 0, 0, 1, 2);
639 updatesHeaderLayout->addWidget(mSoftwareVersionLabel, 1, 0, 1, 1);
640 updatesHeaderLayout->addWidget(mSoftwareVersionContents, 1, 1, 1, 1);
641 updatesHeaderLayout->addWidget(mLastUpdateCheck, 2, 0, 1, 1); 635 updatesHeaderLayout->addWidget(mLastUpdateCheck, 2, 0, 1, 1);
642 updatesHeaderLayout->addLayout(updateDateAndSearchButton, 2, 1, 1, 1); 636 updatesHeaderLayout->addLayout(updateDateAndSearchButton, 2, 1, 1, 1);
643 // updatesHeaderLayout->addWidget(mLastUpdateCheckContents, 2, 1, 1, 1); 637 // updatesHeaderLayout->addWidget(mLastUpdateCheckContents, 2, 1, 1, 1);
644 updatesHeaderLayout->addWidget(mLastCertUpdate, 3, 0, 1, 1); 638 updatesHeaderLayout->addWidget(mLastCertUpdate, 3, 0, 1, 1);
645 updatesHeaderLayout->addWidget(mLastCertUpdateContents, 3, 1, 1, 1); 639 updatesHeaderLayout->addWidget(mLastCertUpdateContents, 3, 1, 1, 1);
866 860
867 // Layouts and Container 861 // Layouts and Container
868 QVBoxLayout *mainLayout = new QVBoxLayout; 862 QVBoxLayout *mainLayout = new QVBoxLayout;
869 QHBoxLayout *headerLayout = new QHBoxLayout; 863 QHBoxLayout *headerLayout = new QHBoxLayout;
870 QVBoxLayout *headerTextLayout = new QVBoxLayout; 864 QVBoxLayout *headerTextLayout = new QVBoxLayout;
865 QHBoxLayout *headerSubtitleLayout = new QHBoxLayout;
871 QHBoxLayout *centerLayout = new QHBoxLayout; 866 QHBoxLayout *centerLayout = new QHBoxLayout;
872 QVBoxLayout *buttonBarLayout = new QVBoxLayout; 867 QVBoxLayout *buttonBarLayout = new QVBoxLayout;
873 QHBoxLayout *bottomLayout = new QHBoxLayout; 868 QHBoxLayout *bottomLayout = new QHBoxLayout;
874 QHBoxLayout *containerLayout = new QHBoxLayout; 869 QHBoxLayout *containerLayout = new QHBoxLayout;
875 870
877 QImage *logoImage = new QImage(":/img/logo.png"); 872 QImage *logoImage = new QImage(":/img/logo.png");
878 QLabel *logo = new QLabel; 873 QLabel *logo = new QLabel;
879 logo->setBackgroundRole(QPalette::Base); 874 logo->setBackgroundRole(QPalette::Base);
880 logo->setPixmap(QPixmap::fromImage(*logoImage)); 875 logo->setPixmap(QPixmap::fromImage(*logoImage));
881 QLabel *title = new QLabel("<h1>" + QString::fromLatin1(APPNAME) + "</h1>"); 876 QLabel *title = new QLabel("<h1>" + QString::fromLatin1(APPNAME) + "</h1>");
882 QLabel *subTitle = new QLabel(tr("Trust in your digital communication")); 877 QLabel *subTitle = new QLabel(QString::fromLatin1("<h3>") +
878 tr("Trust in your digital communication") + QString::fromLatin1("</h3>"));
879 QLabel *swVersion = new QLabel(QString::fromLatin1("<i>") +
880 tr("Version") + " " + QApplication::applicationVersion() +
881 QString::fromLatin1("</i>"));
882
883 swVersion->setTextInteractionFlags(Qt::TextSelectableByKeyboard | Qt::TextSelectableByMouse);
884 swVersion->setTextFormat(Qt::RichText);
885
886 headerSubtitleLayout->addWidget(subTitle);
887 headerSubtitleLayout->addStretch(-1);
888 headerSubtitleLayout->addWidget(swVersion);
889
883 headerTextLayout->addWidget(title); 890 headerTextLayout->addWidget(title);
884 headerTextLayout->addWidget(subTitle); 891 headerTextLayout->addLayout(headerSubtitleLayout);
885 headerLayout->addWidget(logo); 892 headerLayout->addWidget(logo);
886 headerLayout->addLayout(headerTextLayout); 893 headerLayout->addLayout(headerTextLayout);
887 headerLayout->setStretch(0, 0); 894 headerLayout->setStretch(0, 0);
888 headerLayout->setStretch(1, 10); 895 headerLayout->setStretch(1, 10);
889 896

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