]> Some of my projects - aniplayer-old.git/commitdiff
- Refactor versaion dialog.
authorAPTX <APTX@.(none)>
Wed, 16 Sep 2009 17:37:57 +0000 (19:37 +0200)
committerAPTX <APTX@.(none)>
Wed, 16 Sep 2009 17:37:57 +0000 (19:37 +0200)
src/versiondialog.cpp

index a9caa5e24dfc7c2cabd463b53e93cc7d4fd6bdca..9b2bea38aa7fba8c1e1611f10b17ab4addd48bc0 100644 (file)
@@ -4,6 +4,7 @@
 #include <QLabel>
 #include <QDialogButtonBox>
 #include <QPushButton>
+#include <QSysInfo>
 
 #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(
-               "<h3>%1 %2</h3>"
-               "Built with\tQt %3<br/>"
+               "<h3>%1 %2 <font size=\"3\">(%7 bit)</font></h3>"
+               "<p>Built with\tQt %3<br/>"
                "Running with\tQt %4<br/>"
                "<br/>"
                "Built on " __DATE__ " at " __TIME__ " "
-#ifdef REVISION
-               "from revision %6<br/>"
-#endif
-               "<br/>"
+               "%6"
                "<br/>"
-               "Copyright (C) 2009 %5. All rights reserved.<br/>"
                "<br/>"
-               "The program is provided AS IS with NO WARRANTY OF ANY KIND, "
+               "Copyright (C) 2009 %5. All rights reserved.</p>"
+               "<p>The program is provided AS IS with NO WARRANTY OF ANY KIND, "
                "INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A "
-               "PARTICULAR PURPOSE.<br/>")
+               "PARTICULAR PURPOSE.</p>")
                .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);
 }