From: APTX Date: Wed, 16 Sep 2009 17:37:57 +0000 (+0200) Subject: - Refactor versaion dialog. X-Git-Url: https://gitweb.tyo.aptx.org/?a=commitdiff_plain;h=c878fc4e019e6443ad5420a9053b3fa450d1d1b7;p=aniplayer-old.git - Refactor versaion dialog. --- diff --git a/src/versiondialog.cpp b/src/versiondialog.cpp index a9caa5e..9b2bea3 100644 --- a/src/versiondialog.cpp +++ b/src/versiondialog.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "constants.h" #include "aniplayer.h" @@ -17,36 +18,36 @@ VersionDialog::VersionDialog(QWidget *parent) : QDialog(parent) QGridLayout *layout = new QGridLayout(this); layout->setSizeConstraint(QLayout::SetFixedSize); + QString revision; +#ifdef REVISION + revision = tr("from revision %1").arg(revisionString); +#endif + const QString description = tr( - "

%1 %2

" - "Built with\tQt %3
" + "

%1 %2 (%7 bit)

" + "

Built with\tQt %3
" "Running with\tQt %4
" "
" "Built on " __DATE__ " at " __TIME__ " " -#ifdef REVISION - "from revision %6
" -#endif - "
" + "%6" "
" - "Copyright (C) 2009 %5. All rights reserved.
" "
" - "The program is provided AS IS with NO WARRANTY OF ANY KIND, " + "Copyright (C) 2009 %5. All rights reserved.

" + "

The program is provided AS IS with NO WARRANTY OF ANY KIND, " "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A " - "PARTICULAR PURPOSE.
") + "PARTICULAR PURPOSE.

") .arg(qApp->applicationName()) .arg(qApp->applicationVersion()) .arg(QLatin1String(QT_VERSION_STR)) .arg(QLatin1String(qVersion())) .arg(qApp->organizationName()) -#ifdef REVISION - .arg(QLatin1String(revisionString)) -#endif - ; // It's important! + .arg(revision) + .arg(QSysInfo::WordSize); - QLabel *copyRightLabel = new QLabel(description); - copyRightLabel->setWordWrap(true); - copyRightLabel->setOpenExternalLinks(true); - copyRightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); + QLabel *copyrightLabel = new QLabel(description); + copyrightLabel->setWordWrap(true); + copyrightLabel->setOpenExternalLinks(true); + copyrightLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); QPushButton *closeButton = buttonBox->button(QDialogButtonBox::Close); @@ -54,6 +55,6 @@ VersionDialog::VersionDialog(QWidget *parent) : QDialog(parent) buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole)); connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject())); - layout->addWidget(copyRightLabel, 0, 1, 4, 4); + layout->addWidget(copyrightLabel, 0, 1, 4, 4); layout->addWidget(buttonBox, 4, 0, 1, 5); }