From abe6ca42c7b50374413fce20eecec37ebd46b6ec Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Thu, 13 Apr 2023 20:03:39 +0200 Subject: [PATCH] added build date of appimage as version; closes #48 --- AppImageBuilder.yml | 2 ++ src/gui_qt/_py/basewindow.py | 9 ++++++--- src/gui_qt/main/mainwindow.py | 5 +++++ src/nmreval/version.py | 3 +-- src/resources/_ui/basewindow.ui | 7 ++++++- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/AppImageBuilder.yml b/AppImageBuilder.yml index dae00b6..3d9cf78 100644 --- a/AppImageBuilder.yml +++ b/AppImageBuilder.yml @@ -13,6 +13,8 @@ script: - cp bin/evaluate.py $TARGET_APPDIR/usr/bin/ - cp -r src/* $TARGET_APPDIR/usr/src/ - cp src/pkm.vogel.nmreval.desktop $TARGET_APPDIR/usr/share/applications + # set current date as version info + - sed -i "s/CURRENT_DATE/$(date +'%Y-%m-%d')/" $TARGET_APPDIR/usr/src/nmreval/version.py AppDir: diff --git a/src/gui_qt/_py/basewindow.py b/src/gui_qt/_py/basewindow.py index 07a2cc1..67fcb95 100644 --- a/src/gui_qt/_py/basewindow.py +++ b/src/gui_qt/_py/basewindow.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'src/resources/_ui/basewindow.ui' # -# Created by: PyQt5 UI code generator 5.15.9 +# Created by: PyQt5 UI code generator 5.15.2 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. @@ -360,6 +360,8 @@ class Ui_BaseWindow(object): self.actionShow_error_log.setObjectName("actionShow_error_log") self.actionCreate_starter = QtWidgets.QAction(BaseWindow) self.actionCreate_starter.setObjectName("actionCreate_starter") + self.actionAbout = QtWidgets.QAction(BaseWindow) + self.actionAbout.setObjectName("actionAbout") self.menuSave.addAction(self.actionSave) self.menuSave.addAction(self.actionExportGraphic) self.menuSave.addAction(self.action_save_fit_parameter) @@ -385,9 +387,9 @@ class Ui_BaseWindow(object): self.menuData.addSeparator() self.menuData.addAction(self.actionChange_datatypes) self.menuHelp.addAction(self.actionShow_error_log) - self.menuHelp.addAction(self.actionDocumentation) self.menuHelp.addAction(self.actionUpdate) self.menuHelp.addAction(self.actionBugs) + self.menuHelp.addAction(self.actionAbout) self.menuNormalize.addAction(self.action_norm_max) self.menuNormalize.addAction(self.action_norm_max_abs) self.menuNormalize.addSeparator() @@ -485,7 +487,7 @@ class Ui_BaseWindow(object): self.retranslateUi(BaseWindow) self.tabWidget.setCurrentIndex(0) - self.action_close.triggered.connect(BaseWindow.close) # type: ignore + self.action_close.triggered.connect(BaseWindow.close) QtCore.QMetaObject.connectSlotsByName(BaseWindow) def retranslateUi(self, BaseWindow): @@ -616,6 +618,7 @@ class Ui_BaseWindow(object): self.actionBugs.setText(_translate("BaseWindow", "Bugs! Problems! Wishes!")) self.actionShow_error_log.setText(_translate("BaseWindow", "Show error log")) self.actionCreate_starter.setText(_translate("BaseWindow", "Create starter..")) + self.actionAbout.setText(_translate("BaseWindow", "About...")) from ..data.datawidget.datawidget import DataWidget from ..data.integral_widget import IntegralWidget from ..data.point_select import PointSelectWidget diff --git a/src/gui_qt/main/mainwindow.py b/src/gui_qt/main/mainwindow.py index 77bc0c2..88ab8a2 100644 --- a/src/gui_qt/main/mainwindow.py +++ b/src/gui_qt/main/mainwindow.py @@ -1071,3 +1071,8 @@ class NMRMainWindow(QtWidgets.QMainWindow, Ui_BaseWindow): @QtCore.pyqtSlot(name='on_actionCreate_starter_triggered') def create_starter(self): make_starter(os.getenv('APPIMAGE')) + + @QtCore.pyqtSlot(name='on_actionAbout_triggered') + def show_version(self): + from nmreval.version import __version__ + QtWidgets.QMessageBox.about(self, 'Version', f'Build date of AppImage: {__version__}') diff --git a/src/nmreval/version.py b/src/nmreval/version.py index 05c7787..db34e87 100644 --- a/src/nmreval/version.py +++ b/src/nmreval/version.py @@ -1,3 +1,2 @@ # coding=utf-8 -__version__ = '0.1.1' -__releasename__ = 'Snobilikat' +__version__ = 'CURRENT_DATE' diff --git a/src/resources/_ui/basewindow.ui b/src/resources/_ui/basewindow.ui index 0935eb0..5cb3174 100644 --- a/src/resources/_ui/basewindow.ui +++ b/src/resources/_ui/basewindow.ui @@ -190,9 +190,9 @@ &Help - + @@ -1005,6 +1005,11 @@ Create starter.. + + + About... + +