Skip to content

Commit

Permalink
Unify the getVersion output for all platforms
Browse files Browse the repository at this point in the history
Updated the OMEdit's about page.
  • Loading branch information
adeas31 authored and sjoelund committed May 16, 2019
1 parent f6f5727 commit 2f2c995
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 27 deletions.
4 changes: 2 additions & 2 deletions OMCompiler/Makefile.omdev.mingw
Expand Up @@ -166,12 +166,12 @@ ifeq ($(CONFIG_REVISION),)
else # revision is not empty, update it if it changed
@if test -f revision.h; \
then \
echo "#define CONFIG_REVISION \"$(CONFIG_REVISION) $(PLATFORM_ARCH)\"" > revision.h.tmp; diff revision.h revision.h.tmp > /dev/null; \
echo "#define CONFIG_REVISION \"OpenModelica $(CONFIG_REVISION) $(PLATFORM_ARCH)\"" > revision.h.tmp; diff revision.h revision.h.tmp > /dev/null; \
if [ $$? -eq 0 ]; then echo No change in revision; rm revision.h.tmp; \
else echo Revision has changed. updating revision.h; \mv revision.h.tmp revision.h; touch Compiler/runtime/omc_config.h; \
fi; \
else \
echo "#define CONFIG_REVISION \"$(CONFIG_REVISION) $(PLATFORM_ARCH)\"" > revision.h; echo Retrieved revision number. revision.h was created; \
echo "#define CONFIG_REVISION \"OpenModelica $(CONFIG_REVISION) $(PLATFORM_ARCH)\"" > revision.h; echo Retrieved revision number. revision.h was created; \
fi;
endif

Expand Down
Expand Up @@ -1247,7 +1247,7 @@ int RunReconciliation(DATA* data, threadData_t *threadData, inputData x, matrixD
myfile << "<tr> \n" << "<th align=right> ModelName: </th> \n" << "<td>" << data->modelData->modelName << "</td> </tr>\n";
myfile << "<tr> \n" << "<th align=right> ModelDirectory: </th> \n" << "<td>" << data->modelData->modelDir << "</td> </tr>\n";
myfile << "<tr> \n" << "<th align=right> Measurement Files: </th> \n" << "<td>" << omc_flagValue[FLAG_DATA_RECONCILE_Sx] << "</td> </tr>\n";
myfile << "<tr> \n" << "<th align=right> Generated: </th> \n" << "<td>" << ctime(&now) << " by <b>OpenModelica-</b>"<< "<b>" << CONFIG_VERSION << "</b>" << "</td> </tr>\n";
myfile << "<tr> \n" << "<th align=right> Generated: </th> \n" << "<td>" << ctime(&now) << " by "<< "<b>" << CONFIG_VERSION << "</b>" << "</td> </tr>\n";
myfile << "</table>\n";

/* Add Analysis data */
Expand Down
2 changes: 1 addition & 1 deletion OMEdit/OMEdit/OMEditGUI/CrashReport/CrashReportDialog.cpp
Expand Up @@ -67,7 +67,7 @@ CrashReportDialog::CrashReportDialog(QString stacktrace)
// bug description label and textbox
mpBugDescriptionLabel = new Label(tr("Describe in a few words what you were doing when the error occurred:"));
mpBugDescriptionTextBox = new QPlainTextEdit(
QString("%1 connected to %2%5.\nThe running OS is %3 on %4.\n").arg(GIT_SHA,Helper::OpenModelicaVersion,
QString("Connected to %1%4.\nThe running OS is %2 on %3.\n").arg(Helper::OpenModelicaVersion,
#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
QSysInfo::prettyProductName(), QSysInfo::currentCpuArchitecture(),
#elif defined(__APPLE__)
Expand Down
6 changes: 2 additions & 4 deletions OMEdit/OMEdit/OMEditGUI/MainWindow.cpp
Expand Up @@ -4392,9 +4392,8 @@ AboutOMEditDialog::AboutOMEditDialog(MainWindow *pMainWindow)

const QString aboutText = tr(
"<h2>%1 - %2</h2>"
"<b>%3</b><br />"
"<b>Connected to %4</b><br />"
"<b>Connected to %5</b><br /><br />"
"<b>Connected to %3</b><br />"
"<b>Connected to %4</b><br /><br />"
"Copyright <b>Open Source Modelica Consortium (OSMC)</b>.<br />"
"Distributed under OSMC-PL and GPL, see <u><a href=\"http://www.openmodelica.org\">www.openmodelica.org</a></u>.<br /><br />"
"Initially developed by <b>Adeel Asghar</b> and <b>Sonia Tariq</b> as part of their final master thesis."
Expand Down Expand Up @@ -4423,7 +4422,6 @@ AboutOMEditDialog::AboutOMEditDialog(MainWindow *pMainWindow)
"</ul>")
.arg(Helper::applicationName,
Helper::applicationIntroText,
GIT_SHA,
Helper::OpenModelicaVersion,
oms_getVersion());
// about text label
Expand Down
15 changes: 0 additions & 15 deletions OMEdit/OMEdit/OMEditGUI/Makefile.omdev.mingw
Expand Up @@ -9,7 +9,6 @@ builddir_share=$(OMBUILDDIR)/share/
resourcedir=./Resources/nls/
SHREXT=.dll
CONFIG_DEFAULT_OPENMODELICAHOME = "$(OMBUILDDIR)/"
GIT_SHA = $(shell git describe --match "v*.*" --always)
LSB_RELEASE = $(shell cmd /c "ver")

ifeq (MINGW32,$(findstring MINGW32,$(shell uname)))
Expand Down Expand Up @@ -50,31 +49,17 @@ MakefileClean: OMEditGUI.pro
$(QMAKE) "CONFIG+=release"

omc_config.h:
@echo Current version: "$(GIT_SHA) $(PLATFORM_ARCH)"
@echo Current omhome: "$(CONFIG_DEFAULT_OPENMODELICAHOME)"
@echo Current lsb_release: "$(LSB_RELEASE)"
ifeq ($(GIT_SHA),)
@if test -f omc_config.h; \
then echo Could not retrieve version number. omc_config.h not updated; \
else \
echo "#define CONFIG_DEFAULT_OPENMODELICAHOME \"$(CONFIG_DEFAULT_OPENMODELICAHOME)\"" > omc_config.h; \
echo "#define GIT_SHA \"OMEdit unknown $(PLATFORM_ARCH)\""; >> omc_config.h; \
echo "#define LSB_RELEASE \"$(LSB_RELEASE)\"" >> omc_config.h; \
fi;
else # version is not empty, update it if it changed
@if test -f omc_config.h; \
then \
echo "#define CONFIG_DEFAULT_OPENMODELICAHOME \"$(CONFIG_DEFAULT_OPENMODELICAHOME)\"" > omc_config.h.tmp; \
echo "#define GIT_SHA \"OMEdit $(GIT_SHA) $(PLATFORM_ARCH)\"" >> omc_config.h.tmp; \
echo "#define LSB_RELEASE \"$(LSB_RELEASE)\"" >> omc_config.h.tmp; \
diff omc_config.h omc_config.h.tmp > /dev/null; \
if [ $$? -eq 0 ]; then echo No change in version; rm omc_config.h.tmp; \
else echo version has changed. updating omc_config.h; \mv omc_config.h.tmp omc_config.h; \
fi; \
else \
echo "#define CONFIG_DEFAULT_OPENMODELICAHOME \"$(CONFIG_DEFAULT_OPENMODELICAHOME)\"" > omc_config.h; \
echo "#define GIT_SHA \"OMEdit $(GIT_SHA) $(PLATFORM_ARCH)\"" >> omc_config.h; \
echo "#define LSB_RELEASE \"$(LSB_RELEASE)\"" >> omc_config.h; \
fi;
endif

3 changes: 0 additions & 3 deletions OMEdit/OMEdit/OMEditGUI/OMC/OMCProxy.cpp
Expand Up @@ -213,9 +213,6 @@ bool OMCProxy::initializeOMC(threadData_t *threadData)
mHasInitialized = true;
// get OpenModelica version
Helper::OpenModelicaVersion = getVersion();
#ifdef WIN32
sendCommand("\"" + QString(GIT_SHA) + "\"");
#endif
// set OpenModelicaHome variable
Helper::OpenModelicaHome = mpOMCInterface->getInstallationDirectoryPath();
#ifdef WIN32
Expand Down
1 change: 0 additions & 1 deletion OMEdit/OMEdit/OMEditGUI/omc_config.h.in
@@ -1,3 +1,2 @@
#define CONFIG_DEFAULT_OPENMODELICAHOME "@OPENMODELICAHOME@"
#define GIT_SHA "@SOURCE_REVISION@"
@LSB_RELEASE@

0 comments on commit 2f2c995

Please sign in to comment.