Show git commit in "About" window

Can be useful when reporting issues
pull/110/head
Hleb Valoshka 2018-07-24 00:05:39 +03:00
parent 9f6ad88ed8
commit 4358a25fcc
2 changed files with 6 additions and 2 deletions

View File

@ -6,6 +6,10 @@ OBJECTS_DIR = obj
MOC_DIR = moc
RCC_DIR = rcc
GIT_COMMIT = $$system(git --git-dir=$PWD/.git log --pretty=format:"%h" -1)
DEFINES += GIT_COMMIT=\\\"$$GIT_COMMIT\\\"
QT += opengl
QT += xml

View File

@ -1027,7 +1027,7 @@ void CelestiaAppWindow::slotShowAbout()
{
static const char* aboutText =
gettext_noop("<html>"
"<p><b>Celestia 1.7.0 (Qt5 beta version)</b></p>"
"<p><b>Celestia 1.7.0 (Qt5 beta version, git commit %1)</b></p>"
"<p>Copyright (C) 2001-2017 by the Celestia Development Team. Celestia "
"is free software. You can redistribute it and/or modify it under the "
"terms of the GNU General Public License version 2.</p>"
@ -1041,7 +1041,7 @@ void CelestiaAppWindow::slotShowAbout()
"https://github.com/CelestiaProject/Celestia</a><br>"
"</html>");
QMessageBox::about(this, "Celestia", _(aboutText));
QMessageBox::about(this, "Celestia", QString(_(aboutText)).arg(GIT_COMMIT));
}