]> Some of my projects - localmylist.git/commitdiff
Fix version dialog.
authorAPTX <marek321@gmail.com>
Mon, 31 Aug 2015 17:50:11 +0000 (19:50 +0200)
committerAPTX <marek321@gmail.com>
Mon, 31 Aug 2015 17:50:11 +0000 (19:50 +0200)
localmylist-management/localmylist-management.pro
localmylist-management/main.cpp
localmylist-management/resources.qrc [new file with mode: 0644]
localmylist-management/versiondialog.cpp

index 70d3b6575e8d0b1bb8b4143c9246d67d8023efe3..112f119e50420c1be0888c4add9ff0f9c97bae9e 100644 (file)
@@ -81,6 +81,8 @@ FORMS += mainwindow.ui \
        tabs/pathmappingtab.ui \
        tabs/hosttab.ui
 
+RESOURCES += resources.qrc
+
 include(../localmylist.pri)
 include(qtsingleapplication/qtsingleapplication.pri)
 
index 05ad5c9185d5839e139f9945b7600181680ca41e..15b7eeed82a16f806c207a6223055cf570baf440 100644 (file)
@@ -5,6 +5,7 @@
 int main(int argc, char *argv[])
 {
        QtSingleApplication a(argc, argv);
+       a.setOrganizationName(LocalMyList::MyList::organizationName);
 
        if (a.isRunning())
        {
diff --git a/localmylist-management/resources.qrc b/localmylist-management/resources.qrc
new file mode 100644 (file)
index 0000000..9b67871
--- /dev/null
@@ -0,0 +1,5 @@
+<RCC>
+    <qresource prefix="/">
+        <file alias="icon.png">share/icons/localmylist-management_128.png</file>
+    </qresource>
+</RCC>
index 3151a8145c39de7276f47fff6bd8d08ad5b8f327..e7ed57adb095967bb2cfe7bc01b9e53d17a227de 100644 (file)
@@ -21,26 +21,30 @@ VersionDialog::VersionDialog(QWidget *parent) : QDialog(parent)
        if (LocalMyList::MyList::revision())
                revision = tr("from revision %1").arg(LocalMyList::MyList::revision());
 
-       const QString description = tr(
-               "<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__ " "
-               "%6"
-               "<br/>"
-               "<br/>"
-               "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.</p>")
+       const QString description = tr(R"(
+               <h3>%1 %2 <font size=\"3\">(%7 bit)</font></h3>
+               <p>Built with Qt %3<br/>
+               Running with Qt %4<br/>
+               <br/>
+               Built on %8 at %9
+               %6
+               <br/>
+               <br/>
+               Copyright (C) %10 %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.</p>)")
                .arg(qApp->applicationName())
                .arg(qApp->applicationVersion())
                .arg(QLatin1String(QT_VERSION_STR))
                .arg(QLatin1String(qVersion()))
                .arg(qApp->organizationName())
                .arg(revision)
-               .arg(QSysInfo::WordSize);
+               .arg(QSysInfo::WordSize)
+               .arg(__DATE__)
+               .arg(__TIME__)
+               // Format of __DATE__ is "Mmm dd yyyy" 16.8p1 [cpp.predefined]
+               .arg(__DATE__ + 7);
 
        QLabel *copyrightLabel = new QLabel(description);
        copyrightLabel->setWordWrap(true);
@@ -53,6 +57,10 @@ VersionDialog::VersionDialog(QWidget *parent) : QDialog(parent)
        buttonBox->addButton(closeButton, QDialogButtonBox::ButtonRole(QDialogButtonBox::RejectRole | QDialogButtonBox::AcceptRole));
        connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject()));
 
+       QLabel *icon = new QLabel(this);
+       icon->setPixmap(QPixmap::fromImage(QImage(":/icon.png")));
+
+       layout->addWidget(icon, 0, 0);
        layout->addWidget(copyrightLabel, 0, 1, 4, 4);
        layout->addWidget(buttonBox, 4, 0, 1, 5);
 }