diff --git a/cuegui/cuegui/JobMonitorTree.py b/cuegui/cuegui/JobMonitorTree.py index 148e9516c..5b8897bba 100644 --- a/cuegui/cuegui/JobMonitorTree.py +++ b/cuegui/cuegui/JobMonitorTree.py @@ -23,6 +23,7 @@ from future.utils import iteritems from builtins import map import time +import pickle from qtpy import QtCore from qtpy import QtGui @@ -395,6 +396,14 @@ def removeFinishedItems(self): for item in self.findItems("Finished", QtCore.Qt.MatchFixedString, COLUMN_STATE): self.removeItem(item) + def getUserColors(self): + """Returns the colored jobs to be saved""" + return list(pickle.dumps(self.__userColors)) + + def setUserColors(self, state): + """Sets the colored jobs that were saved""" + self.__userColors = pickle.loads(bytes(state)) + def contextMenuEvent(self, e): """Creates a context menu when an item is right clicked. @param e: Right click QEvent diff --git a/cuegui/cuegui/plugins/MonitorJobsPlugin.py b/cuegui/cuegui/plugins/MonitorJobsPlugin.py index 9758af1ac..00e217fbc 100644 --- a/cuegui/cuegui/plugins/MonitorJobsPlugin.py +++ b/cuegui/cuegui/plugins/MonitorJobsPlugin.py @@ -81,6 +81,9 @@ def __init__(self, parent): ("jobs", self.getJobIds, self.restoreJobIds), + ("userColors", + self.jobMonitor.getUserColors, + self.jobMonitor.setUserColors), ("columnVisibility", self.jobMonitor.getColumnVisibility, self.jobMonitor.setColumnVisibility),