Commit cd1cf903 authored by Tao Zhong's avatar Tao Zhong

#132 Update about with useful information

parent 012a5d1c
Pipeline #20860 passed with stages
in 25 seconds
......@@ -40,6 +40,43 @@ set(JPSEDITOR_PATCH_VERSION 7)
set(JPSEDITOR_VERSION
${JPSEDITOR_MAJOR_VERSION}.${JPSEDITOR_MINOR_VERSION}.${JPSEDITOR_PATCH_VERSION})
find_package(Git REQUIRED) # no need for this msg. It comes from cmake.findgit()
find_program(GIT_SCM git DOC "Git version control")
mark_as_advanced(GIT_SCM)
find_file(GITDIR NAMES .git PATHS ${CMAKE_SOURCE_DIR} NO_DEFAULT_PATH)
if (GIT_SCM AND GITDIR)
# the commit's SHA1, and whether the building workspace was dirty or not
# describe --match=NeVeRmAtCh --always --tags --abbrev=40 --dirty
execute_process(COMMAND
"${GIT_EXECUTABLE}" --no-pager describe --tags --always --dirty
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_SHA1
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
# branch
execute_process(
COMMAND "${GIT_EXECUTABLE}" rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# the date of the commit
execute_process(COMMAND
"${GIT_EXECUTABLE}" log -1 --format=%ad --date=local
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_DATE
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
add_definitions("-DGIT_COMMIT_HASH=\"${GIT_SHA1}\"")
add_definitions("-DGIT_COMMIT_DATE=\"${GIT_DATE}\"")
add_definitions("-DGIT_BRANCH=\"${GIT_BRANCH}\"")
add_definitions("-DJPSEDITOR_VERSION=\"${JPSEDITOR_VERSION}\"")
else()
message(STATUS "Not in a git repo")
endif()
if("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE Release)
endif()
......@@ -139,7 +176,8 @@ set( SRCS
src/tinyxml/tinyxml.cpp
src/tinyxml/tinyxmlerror.cpp
src/tinyxml/tinyxmlparser.cpp
)
)
# all header files that should be treated with moc
set( HDR
src/dtrace.h
......@@ -194,7 +232,8 @@ set( HDR
src/AutomaticRoomIdentification/roomidentification.h
src/tinyxml/tinystr.h
src/tinyxml/tinyxml.h
)
)
# *.ui files
set( UIS
......
......@@ -13,6 +13,7 @@
<file>Icons/filesave.png</file>
<file>Icons/filesaveas.png</file>
<file>Icons/jupedsim.png</file>
<file>jpseditor.icns</file>
<file>Icons/man-gimp1.png</file>
<file>Icons/new.png</file>
<file>Icons/open.png</file>
......
......@@ -42,11 +42,10 @@
#include "GraphicView.h"
#include <QApplication>
int main(int argc, char* argv[]){
int main(int argc, char* argv[])
{
QApplication app(argc,argv);
MWindow mywindow;
mywindow.setGeometry(100, 100, 800, 500);
mywindow.show();
return app.exec();
}
......
......@@ -31,6 +31,7 @@
#include "mainWindow.h"
#include "GraphicView.h"
#include <iostream>
#include <QFileDialog>
#include <QMessageBox>
......@@ -222,6 +223,7 @@ MWindow :: MWindow()
objectsnapping.append(Intersections_point);
objectsnapping.append(Center_point);
objectsnapping.append(SelectedLine_point);
}
MWindow::~MWindow()
......@@ -664,18 +666,33 @@ void MWindow::SaveCogMapXML()
}
void MWindow::info(){
/*
* JPSeditor version information
* */
QString info = "\
JPSeditor (version 0.8.4) is a tool\n\
to create and process geometries for\n\
JuPedSim.\n\
2018. All rights reserved.";
QMessageBox messageBox;
messageBox.information(nullptr,tr("About..."),info);
void MWindow::info()
{
QString gittext = QMessageBox::tr(
"<h1><p style=\"line-height:0.7\">JPSeditor</p></h1><p style=\"line-height:1.4\" style=\"color:Gray;"
"\"><small><i>Version %1</i></small></p>"
"<p style=\"line-height:0.4\" style=\"color:Gray;\"><i>Commit Hash</i> %2</p>"
"<p style=\"line-height:0.4\" style=\"color:Gray;\"><i>Commmit Date</i> %3</p>"
"<p style=\"line-height:0.4\" style=\"color:Gray;\"><i>Branch</i> %4</p><hr>"
).arg(JPSEDITOR_VERSION).arg(GIT_COMMIT_HASH).arg(GIT_COMMIT_DATE);
QString text = QMessageBox::tr(
"<p style=\"color:Gray;\"><small><i> &copy; 2009-2019 FZ Jülich <br><a href=\"http://jupedsim"
".org\">jupedsim"
".org</a></i></small></p>"
);
QMessageBox msg(QMessageBox::Information,"About JPSeditor", gittext+text, QMessageBox::Ok);
msg.setIconPixmap(QPixmap(":/inAppIcons/jpseditor.icns"));
//Change font
QFont font( "Tokyo" );
font.setPointSize( 10 );
// font.setWeight( QFont::Bold );
//font.setItalic( TRUE );
msg.setFont(font);
//msg.setStandardButtons(0);
msg.exec();
}
void MWindow::anglesnap()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment