Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tools/Python/mccodelib/mccode_config.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"BROWSER": "@BROWSER@",
"GUICOLS": "3",
"GUIFONTSIZE": "12",
"GUILOGCOLOR": "blue",
"GUIINFOCOLOR": "green",
"GUIERRCOLOR": "red",
"NDBUFFERSIZE": "10000000",
"EDITOR": "@EDITOR@",
"FORMAT": "McCode",
Expand Down
19 changes: 13 additions & 6 deletions tools/Python/mcgui/viewclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,14 @@ def closeCodeEditorWindow(self):
'''
def updateInstrument(self, labels, instr):
''' labels: <instrument path>, <work dir> '''
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:
Expand All @@ -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):
Expand All @@ -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)
Expand Down