Skip to content

Commit

Permalink
Added OMEdit git hash to about dialog.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Feb 29, 2016
1 parent 22a1579 commit 56b075f
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 12 deletions.
22 changes: 16 additions & 6 deletions OMEdit/OMEditGUI/MainWindow.cpp
Expand Up @@ -43,6 +43,9 @@
#include "SimulationOutputWidget.h"
#include "FetchInterfaceDataDialog.h"
#include "TLMCoSimulationOutputWidget.h"
#ifdef WIN32
#include "version.h"
#endif

MainWindow::MainWindow(QSplashScreen *pSplashScreen, bool debug, QWidget *parent)
: QMainWindow(parent), mDebug(debug), mExitApplicationStatus(false)
Expand Down Expand Up @@ -3293,9 +3296,15 @@ AboutOMEditWidget::AboutOMEditWidget(MainWindow *pMainWindow)
// OMEdit intro text
Label *pIntroLabel = new Label(Helper::applicationIntroText);
pIntroLabel->setFont(QFont(Helper::systemFontInfo.family(), Helper::systemFontInfo.pointSize() + 3 + MAC_FONT_FACTOR));
#ifdef WIN32
Label *pOMEditVersionLabel = new Label(GIT_SHA);
#else
Label *pOMEditVersionLabel = new Label;
#endif
pOMEditVersionLabel->setFont(QFont(Helper::systemFontInfo.family(), Helper::systemFontInfo.pointSize() - 3 + MAC_FONT_FACTOR));
// OpenModelica compiler info
Label *pConnectedLabel = new Label(QString("Connected to ").append(Helper::OpenModelicaVersion));
pConnectedLabel->setFont(QFont(Helper::systemFontInfo.family(), Helper::systemFontInfo.pointSize() - 2 + MAC_FONT_FACTOR));
pConnectedLabel->setFont(QFont(Helper::systemFontInfo.family(), Helper::systemFontInfo.pointSize() - 3 + MAC_FONT_FACTOR));
// about text
QString aboutText = QString("Copyright <b>Open Source Modelica Consortium (OSMC)</b>.<br />")
.append("Distributed under OSMC-PL and GPL, see <u><a href=\"http://www.openmodelica.org\">www.openmodelica.org</a></u>.<br /><br />")
Expand Down Expand Up @@ -3346,11 +3355,12 @@ AboutOMEditWidget::AboutOMEditWidget(MainWindow *pMainWindow)
pMainLayout->setContentsMargins(45, 200, 45, 20);
pMainLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft);
pMainLayout->addWidget(pIntroLabel, 1, 0, 1, 1, Qt::AlignHCenter);
pMainLayout->addWidget(pConnectedLabel, 2, 0, 1, 1, Qt::AlignHCenter);
pMainLayout->addLayout(pAboutLayout, 3, 0, 1, 1);
pMainLayout->addWidget(pContributorsHeading, 4, 0, 1, 1);
pMainLayout->addWidget(pScrollArea, 5, 0, 1, 1);
pMainLayout->addWidget(pCloseButton, 6, 0, 1, 1, Qt::AlignRight);
pMainLayout->addWidget(pOMEditVersionLabel, 2, 0, 1, 1, Qt::AlignHCenter);
pMainLayout->addWidget(pConnectedLabel, 3, 0, 1, 1, Qt::AlignHCenter);
pMainLayout->addLayout(pAboutLayout, 4, 0, 1, 1);
pMainLayout->addWidget(pContributorsHeading, 5, 0, 1, 1);
pMainLayout->addWidget(pScrollArea, 6, 0, 1, 1);
pMainLayout->addWidget(pCloseButton, 7, 0, 1, 1, Qt::AlignRight);
setLayout(pMainLayout);
}

Expand Down
26 changes: 23 additions & 3 deletions OMEdit/OMEditGUI/Makefile.omdev.mingw
Expand Up @@ -2,12 +2,13 @@ ifeq ($(OMBUILDDIR),)
$(error OMBUILDDIR variable is not set.)
endif

.PHONY: install build $(NAME)
.PHONY: install build $(NAME) version

builddir_bin=$(OMBUILDDIR)/bin
builddir_share=$(OMBUILDDIR)/share/
resourcedir=./Resources/nls/
SHREXT=.dll
GIT_SHA = $(shell git describe --match "v*.*" --always)

NAME=OMEdit
EXE=.exe
Expand Down Expand Up @@ -46,9 +47,28 @@ clean: MakefileClean
parsergen:
$(MAKE) -C Debugger/Parser -f Makefile.lib.omdev.mingw

build: $(NAME)
build: version $(NAME)
$(MAKE) -f Makefile
Makefile: parsergen OMEditGUI.pro
$(QMAKE) "CONFIG+=release"
MakefileClean: OMEditGUI.pro
$(QMAKE) "CONFIG+=release"
$(QMAKE) "CONFIG+=release"

version:
@echo Current version: $(GIT_SHA)
ifeq ($(GIT_SHA),)
@if test -f version.h; \
then echo Could not retrieve version number. version.h not updated; \
else echo "" > version.h; echo Could not retrieve version number. empty version.h was created; \
fi;
else # version is not empty, update it if it changed
@if test -f version.h; \
then \
echo "#define GIT_SHA \"OMEdit $(GIT_SHA)\"" > version.h.tmp; diff version.h version.h.tmp > /dev/null; \
if [ $$? -eq 0 ]; then echo No change in version; rm version.h.tmp; \
else echo version has changed. updating version.h; \mv version.h.tmp version.h; \
fi; \
else \
echo "#define GIT_SHA \"$(GIT_SHA)\"" > version.h; echo Retrieved version number. version.h was created; \
fi;
endif
6 changes: 3 additions & 3 deletions OMEdit/OMEditGUI/OMEditGUI.pro
Expand Up @@ -30,7 +30,7 @@

QT += network core gui webkit xml xmlpatterns svg
greaterThan(QT_MAJOR_VERSION, 4) {
QT *= printsupport widgets webkitwidgets
QT *= printsupport widgets webkitwidgets
}

TRANSLATIONS = Resources/nls/OMEdit_de.ts \
Expand Down Expand Up @@ -65,7 +65,7 @@ win32 {
QMAKE_CXXFLAGS += -g
QMAKE_LFLAGS_RELEASE =
# required for backtrace
LIBS += -L$$(OMDEV)/tools/mingw/bin -limagehlp -lbfd -LF:/msys/mingw64/lib/binutils -lintl -liberty
LIBS += -L$$(OMDEV)/tools/mingw/bin -limagehlp -lbfd -lintl -liberty
}
LIBS += -L../OMEditGUI/Debugger/Parser -lGDBMIParser \
-L$$(OMBUILDDIR)/lib/omc -lomantlr3 -lOMPlot -lomqwt \
Expand All @@ -83,7 +83,7 @@ win32 {
# options. For systems using the GNU linker, it is necessary to use
# the -rdynamic linker option. Note that names of "static" functions
# are not exposed, and won't be available in the backtrace.
CONFIG(release, debug|release){
CONFIG(release, debug|release) {
QMAKE_LFLAGS_RELEASE += -rdynamic
}
}
Expand Down

0 comments on commit 56b075f

Please sign in to comment.