diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/browser.cpp | 9 | ||||
-rw-r--r-- | src/browser.h | 6 | ||||
-rw-r--r-- | src/main.cpp | 7 | ||||
-rw-r--r-- | src/mainwindow.cpp | 11 |
4 files changed, 28 insertions, 5 deletions
diff --git a/src/browser.cpp b/src/browser.cpp index 41c6355..2c7115d 100644 --- a/src/browser.cpp +++ b/src/browser.cpp @@ -42,6 +42,15 @@ Browser::~Browser() delete m_downloadManager; } +QString Browser::applicationLongVersion() const +{ +#ifdef GIT_DESCRIBE + return QString(GIT_DESCRIBE); +#else + return applicationVersion(); +#endif +} + /*! * Check if the settings are empty */ diff --git a/src/browser.h b/src/browser.h index aa7c605..a6820c8 100644 --- a/src/browser.h +++ b/src/browser.h @@ -29,6 +29,10 @@ #include "settings.h" #include <QNetworkAccessManager> +#ifdef qApp +#undef qApp +#define qApp Browser::instance() +#endif #define sSettings Browser::instance()->settings() #define sNetwork Browser::instance()->network() @@ -41,6 +45,8 @@ public: Browser(int &argc, char *argv[]); ~Browser(); + QString applicationLongVersion() const; + void firstRun(); bool preLaunch(QStringList urls); diff --git a/src/main.cpp b/src/main.cpp index b787caf..a99e5de 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -26,9 +26,12 @@ int main(int argc, char *argv[]) { Browser app(argc, argv); -#ifdef VERSION - app.setApplicationVersion(VERSION); +#ifdef GIT_VERSION + app.setApplicationVersion(GIT_VERSION); +#else + app.setApplicationVersion("1.0.0"); #endif + app.setWindowIcon(QIcon(QLatin1String(":/icon.svg"))); QCommandLineParser parser; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 087c5f8..bab0520 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -155,13 +155,18 @@ void MainWindow::closeEvent(QCloseEvent *event) void MainWindow::about() { - QMessageBox::about(this, tr("About"), tr("<h3>smolbote %1</h3>" + QMessageBox::about(this, tr("About"), tr("<h2>smolbote %1</h2>" "<p><i>yet another Qute browser</i></p>" "<p>Copyright (C) 2017 Xian Nox</p>" "<p>This program comes with ABSOLUTELY NO WARRANTY. " "This is free software, and you are welcome to redistribute it under the conditions set by the GNU GPLv3.</p>" - "<p>Configuration lives in: %2</p>") - .arg(DESCRIBE).arg(sSettings->filePath())); + "<p>" + "Version: %2<br>" + "Configuration: %3" + "</p>") + .arg(qApp->applicationVersion()) + .arg(qApp->applicationLongVersion()) + .arg(sSettings->filePath())); } void MainWindow::loadProfile(const QString &name) |