Commit efa14b95 authored by Lars Bittrich's avatar Lars Bittrich

Implemented version string and displaying this version in window title.

parent 1fff5fef
......@@ -25,12 +25,13 @@ from .scalebar import ScaleBar
from .ramancom.ramancontrol import defaultPath
from .ramancom.ramanSwitch import RamanSwitch
from .analysis.colorlegend import ColorLegend
from gepard import __version__
class GEPARDMainWindow(QtWidgets.QMainWindow):
def __init__(self, logpath):
super(GEPARDMainWindow, self).__init__()
self.setWindowTitle("GEPARD")
self.setWindowTitle("GEPARD " + __version__)
self.resize(900, 700)
self.view = SampleView(logpath)
......@@ -120,8 +121,16 @@ class GEPARDMainWindow(QtWidgets.QMainWindow):
@QtCore.pyqtSlot()
def about(self):
devbranch = None
fname = os.path.join(os.path.split(__file__)[0],
os.path.join('.git', 'HEAD'))
if os.path.exists(fname):
with open(fname, 'r') as fp:
cont = fp.read()
devbranch = cont.rsplit('/',maxsplit=1)[1]
QtWidgets.QMessageBox.about(self, 'GEPARD',
"Developed by Complex Fiber Structures GmbH on behalf of Leibniz-IPF Dresden")
'Gepard-Enabled PARticle Detection for Raman microscopes. \nVersion:' + \
__version__ + '' if devbranch is None else ('\nDevelopment branch: ' + devbranch))
def createActions(self):
......@@ -344,7 +353,7 @@ class GEPARDMainWindow(QtWidgets.QMainWindow):
if __name__ == '__main__':
import sys
from time import localtime, strftime
from time import localtime, strftime
app = QtWidgets.QApplication(sys.argv)
app.setApplicationName("GEPARD") # appname needed for logpath
......
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