diff --git a/cuegui/cuegui/CueJobMonitorTree.py b/cuegui/cuegui/CueJobMonitorTree.py index 4c5c03504..68c34486b 100644 --- a/cuegui/cuegui/CueJobMonitorTree.py +++ b/cuegui/cuegui/CueJobMonitorTree.py @@ -103,8 +103,8 @@ def __init__(self, parent): data=lambda job: job.data.job_stats.total_frames, sort=lambda job: job.data.job_stats.total_frames, tip="The total number of frames.") -# self.addColumn("_Booking Bar", 150, id=8, default=False, -# delegate=JobBookingBarDelegate) + self.addColumn("_Booking Bar", 150, id=8, + delegate=cuegui.ItemDelegate.JobBookingBarDelegate) self.addColumn("Min", 38, id=9, data=lambda job: "%.0f" % job.data.min_cores, sort=lambda job: job.data.min_cores, diff --git a/cuegui/cuegui/DarkPalette.py b/cuegui/cuegui/DarkPalette.py index 554426d64..224424598 100644 --- a/cuegui/cuegui/DarkPalette.py +++ b/cuegui/cuegui/DarkPalette.py @@ -126,3 +126,6 @@ def ColorF(r, g, b): COLOR_SHOW_BACKGROUND = GreyF(0.13) COLOR_SHOW_FOREGROUND = GreyF(0.79) COLOR_JOB_FOREGROUND = GreyF(0.79) + +KILL_ICON_COLOUR = QtGui.QColor(224, 52, 52) +PAUSE_ICON_COLOUR = QtGui.QColor(88, 163, 209) \ No newline at end of file diff --git a/cuegui/cuegui/ItemDelegate.py b/cuegui/cuegui/ItemDelegate.py index 0ec671aa6..5ea6c7888 100644 --- a/cuegui/cuegui/ItemDelegate.py +++ b/cuegui/cuegui/ItemDelegate.py @@ -165,34 +165,37 @@ def paint(self, painter, option, index): rect = option.rect.adjusted(12, 6, -12, -6) - jobMin = int(job.data.minCores * 100) - jobMax = int(job.data.maxCores * 100) - jobRunning = job.data.runningFrames - jobWaiting = job.data.waitingFrames - painter.save() try: self._drawBackground(painter, option, index) try: + jobRunning = job.data.job_stats.running_frames + jobWaiting = job.data.job_stats.waiting_frames + try: + cores_per_frame = float(job.data.job_stats.reserved_cores / jobRunning) + except: + cores_per_frame = float(6 / 1) + jobMin = int(job.data.min_cores / cores_per_frame) + jobMax = int(job.data.max_cores / cores_per_frame) ratio = rect.width() / float(jobRunning + jobWaiting) if jobWaiting: painter.fillRect( rect.adjusted(0, 2, 0, -2), - RGB_FRAME_STATE[opencue.api.job_pb2.FrameState.Waiting]) + RGB_FRAME_STATE[opencue.api.job_pb2.WAITING]) if jobRunning: painter.fillRect( rect.adjusted(0, 0, -int(ceil(ratio * jobWaiting)), 0), - RGB_FRAME_STATE[opencue.api.job_pb2.FrameState.Running]) + RGB_FRAME_STATE[opencue.api.job_pb2.RUNNING]) - painter.setPen(QtCore.Qt.blue) + painter.setPen(cuegui.Style.ColorTheme.PAUSE_ICON_COLOUR) x = min(rect.x() + ratio * jobMin, option.rect.right() - 9) painter.drawLine(x, option.rect.y(), x, option.rect.y() + option.rect.height()) - painter.setPen(QtCore.Qt.red) + painter.setPen(cuegui.Style.ColorTheme.KILL_ICON_COLOUR) x = min(rect.x() + ratio * jobMax, option.rect.right() - 6) painter.drawLine(x, option.rect.y(), x, option.rect.y() + option.rect.height()) @@ -200,8 +203,6 @@ def paint(self, painter, option, index): except ZeroDivisionError: pass - if option.state & QtWidgets.QStyle.State_Selected: - self._drawSelectionOverlay(painter, option) finally: painter.restore() del painter