diff --git a/tools/Python/mccodelib/mccode_config.json.in b/tools/Python/mccodelib/mccode_config.json.in index 810a4d86d..38db0e6d3 100644 --- a/tools/Python/mccodelib/mccode_config.json.in +++ b/tools/Python/mccodelib/mccode_config.json.in @@ -15,6 +15,9 @@ "BROWSER": "@BROWSER@", "GUICOLS": "3", "GUIFONTSIZE": "12", + "GUILOGCOLOR": "blue", + "GUIINFOCOLOR": "green", + "GUIERRCOLOR": "red", "NDBUFFERSIZE": "10000000", "EDITOR": "@EDITOR@", "FORMAT": "McCode", diff --git a/tools/Python/mcgui/viewclasses.py b/tools/Python/mcgui/viewclasses.py index 07499c007..845d1178b 100644 --- a/tools/Python/mcgui/viewclasses.py +++ b/tools/Python/mcgui/viewclasses.py @@ -71,7 +71,14 @@ def closeCodeEditorWindow(self): ''' def updateInstrument(self, labels, instr): ''' labels: , ''' - self.mw.ui.lblInstrument.setText(labels[0]) + if len(labels[0])>70: + label=str(pathlib.Path("(..long dirname..)",pathlib.Path(labels[0]).name)) + tooltip="Located in: "+str(pathlib.Path(labels[0]).parent) + else: + label=labels[0] + tooltip=labels[0] + self.mw.ui.lblInstrument.setText(label) + self.mw.ui.lblInstrument.setToolTip(tooltip) if str(labels[0]) == '': self.__ssd = None if Qsci: @@ -85,11 +92,11 @@ def updateLog(self, text='', error=False, gui=False, clear=False): if clear: self.mw.ui.txtbrwMcgui.setText('Cleared messages.') if error: - self.mw.ui.txtbrwMcgui.setTextColor(QtGui.QColor('red')) + self.mw.ui.txtbrwMcgui.setTextColor(QtGui.QColor(mccode_config.configuration["GUIERRCOLOR"])) elif gui: - self.mw.ui.txtbrwMcgui.setTextColor(QtGui.QColor('blue')) + self.mw.ui.txtbrwMcgui.setTextColor(QtGui.QColor(mccode_config.configuration["GUILOGCOLOR"])) else: - self.mw.ui.txtbrwMcgui.setTextColor(QtGui.QColor('green')) + self.mw.ui.txtbrwMcgui.setTextColor(QtGui.QColor(mccode_config.configuration["GUIINFOCOLOR"])) self.mw.ui.txtbrwMcgui.append(text) def disableRunBtn(self): @@ -116,9 +123,9 @@ def updateSimState(self, state=[]): ui.btnEdit.setEnabled(enableRun) ui.btnPlot.setEnabled(enablePlot) if enableRun: - ui.lblInstrument.setStyleSheet('color: green') + ui.lblInstrument.setStyleSheet('color: ' + mccode_config.configuration["GUILOGCOLOR"]) else: - ui.lblInstrument.setStyleSheet('color: red') + ui.lblInstrument.setStyleSheet('color: ' + mccode_config.configuration["GUIERRCOLOR"]) ui.actionClose_Instrument.setEnabled(enableRun) ui.actionPlot.setEnabled(enablePlot) ui.actionDisplay.setEnabled(enableRun)