diff --git a/Gui/CMakeLists.txt b/Gui/CMakeLists.txt index ebbc574fb3c4a2637e5fc022bf34ad48a49d5c41..7c5479c8ad52fcbb33e4db658a0fe06bd5d262ab 100644 --- a/Gui/CMakeLists.txt +++ b/Gui/CMakeLists.txt @@ -108,6 +108,10 @@ IF(MSVC) SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:MSVCRT") ENDIF(MSVC) +IF(OGS_BUILD_INFO) + ADD_DEFINITIONS(-DOGS_BUILD_INFO) +ENDIF() # OGS_BUILD_INFO + ### OpenSG support ### IF (OGS_USE_OPENSG) USE_OPENSG(ogs-gui) diff --git a/Gui/mainwindow.cpp b/Gui/mainwindow.cpp index a6ca0550df14ed4131de560a6d9314f2ac6e369c..9f9c4283117e08b5966b3373538726e2355b8043 100644 --- a/Gui/mainwindow.cpp +++ b/Gui/mainwindow.cpp @@ -99,6 +99,9 @@ #include "VtkTrackedCamera.h" #endif // OGS_USE_VRPN +#ifdef OGS_BUILD_INFO +#include "BuildInfo.h" +#endif // OGS_BUILD_INFO //// test only //#include "rf_mmp_new.h" @@ -717,9 +720,17 @@ void MainWindow::writeSettings() void MainWindow::about() { QString ogsVersion = QString(OGS_VERSION); - QMessageBox::about(this, tr("About OpenGeoSys-5"), tr( - "Built on %1\nOGS Version: %2").arg( - QDate::currentDate().toString()).arg(ogsVersion)); + + QString about = tr("Built on %1\nOGS Version: %2\n\n").arg( + QDate::currentDate().toString()).arg(ogsVersion); +#ifdef OGS_BUILD_INFO + QString gitCommit = QString(GIT_COMMIT_INFO); + QString gitBranch = QString(GIT_BRANCH_INFO); + about.append(QString("Svn commit: %1\n").arg(SVN_REVISION)); + about.append(QString("Git commit: %1\n").arg(gitCommit.mid(7))); + about.append(QString("Git branch: %1\n").arg(gitBranch.mid(2))); +#endif // OGS_BUILD_INFO + QMessageBox::about(this, "About OpenGeoSys-5", about); } QMenu* MainWindow::createImportFilesMenu() diff --git a/Gui/mainwindow.ui b/Gui/mainwindow.ui index cea19538a24e0a4206ffaf15e5faa8f1fae4026c..08bb9ad0e07920b2548cdb850828c037bf0696be 100644 --- a/Gui/mainwindow.ui +++ b/Gui/mainwindow.ui @@ -81,7 +81,7 @@ <x>0</x> <y>0</y> <width>801</width> - <height>21</height> + <height>22</height> </rect> </property> <widget class="QMenu" name="menu_File"> @@ -105,6 +105,9 @@ <addaction name="actionSave_As"/> <addaction name="separator"/> <addaction name="menuExport"/> + <addaction name="separator"/> + <addaction name="actionAbout"/> + <addaction name="separator"/> <addaction name="action_Exit"/> </widget> <widget class="QMenu" name="menuWindows"> @@ -379,6 +382,11 @@ <string>Diagram Viewer...</string> </property> </action> + <action name="actionAbout"> + <property name="text"> + <string>About</string> + </property> + </action> </widget> <layoutdefault spacing="6" margin="11"/> <customwidgets> @@ -581,6 +589,22 @@ </hint> </hints> </connection> + <connection> + <sender>actionAbout</sender> + <signal>triggered()</signal> + <receiver>MainWindowClass</receiver> + <slot>about()</slot> + <hints> + <hint type="sourcelabel"> + <x>-1</x> + <y>-1</y> + </hint> + <hint type="destinationlabel"> + <x>400</x> + <y>372</y> + </hint> + </hints> + </connection> </connections> <slots> <slot>open()</slot> @@ -593,5 +617,6 @@ <slot>showGMSHPrefsDialog()</slot> <slot>FEMTestStart()</slot> <slot>showDiagramPrefsDialog()</slot> + <slot>about()</slot> </slots> </ui>