diff --git a/SleepyHeadQT.pro b/SleepyHeadQT.pro index 75fdff06..5cea3768 100644 --- a/SleepyHeadQT.pro +++ b/SleepyHeadQT.pro @@ -22,6 +22,15 @@ CONFIG += rtti TARGET = SleepyHead TEMPLATE = app +# GIT_VERSION = $$system(git describe --tags --long --abbrev=6 --dirty="*") + + +#exists(.git):DEFINES += GIT_BRANCH=\\\"$$system(git rev-parse --symbolic-full-name --abbrev-ref HEAD)\\\" +exists(.git):DEFINES += GIT_BRANCH=\\\"$$system(git rev-parse --abbrev-ref HEAD)\\\" +else:DEFINES += GIT_BRANCH=\\\"NOT BUILT FROM GIT SOURCE\\\" + +exists(.git):DEFINES += GIT_REVISION=\\\"$$system(git rev-parse HEAD)\\\" +else:DEFINES += GIT_BRANCH=\\\"UNKNOWN\\\" SOURCES += main.cpp\ SleepLib/machine.cpp \ diff --git a/mainwindow.cpp b/mainwindow.cpp index 3f2bd9d5..075150a4 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -62,7 +62,9 @@ MainWindow::MainWindow(QWidget *parent) : logtime.start(); ui->setupUi(this); - this->setWindowTitle(tr("SleepyHead")+QString(" v%1.%2.%3 BREAKY (%4)").arg(major_version).arg(minor_version).arg(revision_number).arg(PREF["Profile"].toString())); + QString version=PREF["VersionString"].toString(); + if (QString(GIT_BRANCH)!="master") version+=QString(" ")+QString(GIT_BRANCH); + this->setWindowTitle(tr("SleepyHead")+QString(" v%1 (Profile: %2)").arg(version).arg(PREF["Profile"].toString())); ui->tabWidget->setCurrentIndex(0); //move(0,0); overview=NULL; @@ -368,12 +370,13 @@ void MainWindow::on_webView_loadProgress(int progress) void MainWindow::on_action_About_triggered() { - QString msg=tr("

SleepyHead v%1.%2.%3

Build Date: %4 %5
" + + QString msg=tr("

SleepyHead v%1.%2.%3

Build Date: %4 %5
Revision: %6
" "Copyright ©2011 Mark Watkins (jedimark)
\n" "http://sleepyhead.sourceforge.net
" "This software is released under the GNU Public License
" "This software comes with absolutely no warranty, either express of implied. It comes with no guarantee of fitness for any particular purpose. No guarantees are made regarding the accuracy of any data this program displays." -"
").arg(major_version).arg(minor_version).arg(revision_number).arg(__DATE__).arg(__TIME__); + "
").arg(major_version).arg(minor_version).arg(revision_number).arg(__DATE__).arg(__TIME__).arg(GIT_REVISION); QMessageBox msgbox(QMessageBox::Information,tr("About SleepyHead"),"",QMessageBox::Ok,this); msgbox.setTextFormat(Qt::RichText); msgbox.setText(msg);