From aac3dca7644a2cccdf3f2f098f74d5d6a7364ed2 Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 23 Oct 2013 13:40:51 +0300 Subject: [PATCH] New message box about program. --HG-- branch : develop --- Valentina.pro | 3 ++- mainwindow.cpp | 7 ++++++- version.h | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 version.h diff --git a/Valentina.pro b/Valentina.pro index f9b662a95..b523128a3 100644 --- a/Valentina.pro +++ b/Valentina.pro @@ -206,7 +206,8 @@ HEADERS += mainwindow.h \ dialogs/dialogtriangle.h \ dialogs/dialogpointofintersection.h \ tools/drawTools/vtoolpointofintersection.h \ - tools/modelingTools/vmodelingpointofintersection.h + tools/modelingTools/vmodelingpointofintersection.h \ + version.h FORMS += mainwindow.ui \ dialogs/dialogsinglepoint.ui \ diff --git a/mainwindow.cpp b/mainwindow.cpp index e1d04f1f0..72b05ef32 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -36,6 +36,7 @@ #include "exception/vexceptionemptyparameter.h" #include "exception/vexceptionwrongparameterid.h" #include "exception/vexceptionuniqueid.h" +#include "version.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), tool(Tool::ArrowTool), currentScene(0), sceneDraw(0), @@ -523,7 +524,11 @@ void MainWindow::ClosedDialogPointOfIntersection(int result){ } void MainWindow::About(){ - QMessageBox::about(this, tr("About Valentina"), tr("Valentina v.0.1.0")); + QString fullName = QString("Valentina %1").arg(APP_VERSION); + QString qtBase(tr("Based on Qt %2 (32 bit)").arg(QT_VERSION_STR)); + QString buildOn(tr("Built on %3 at %4").arg(__DATE__).arg(__TIME__)); + QString about = QString(tr("

%1

%2

%3

%4")).arg(fullName).arg(qtBase).arg(buildOn).arg(WARRANTY); + QMessageBox::about(this, tr("About Valentina"), about); } void MainWindow::AboutQt(){ diff --git a/version.h b/version.h new file mode 100644 index 000000000..4c5d92805 --- /dev/null +++ b/version.h @@ -0,0 +1,14 @@ +#ifndef VERSION_H +#define VERSION_H + +#include + +extern const int MAJOR_VERSION = 0; +extern const int MINOR_VERSION = 1; +extern const int DEBUG_VERSION = 0; + +extern const QString APP_VERSION(QStringLiteral("%1.%2.%3").arg(MAJOR_VERSION) + .arg(MINOR_VERSION) + .arg(DEBUG_VERSION)); +extern const QString WARRANTY(QT_TR_NOOP("The program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.")); +#endif // VERSION_H