Skip to content

Commit 388255c

Browse files
Add a flag to search job with appended results (#1514)
- Add a new configuration option `search_jobs.append_results` in cuegui.yaml to control job search behaviour. - If `search_jobs.append_results` is set to true, search results will be appended to the current list of monitored jobs. - If `search_jobs.append_results` is set to false, the existing jobs will be cleared before displaying the search results. - Updated Constants.py to include the new configuration parameter. - Modified MonitorJobsPlugin.py to conditionally clear the job monitor based on the config setting.
1 parent 0b60722 commit 388255c

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

cuegui/cuegui/Constants.py

+2
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ def __packaged_version():
195195
for action_type
196196
in __config.get('filter_dialog.disabled_action_types', "").split(",")]
197197

198+
SEARCH_JOBS_APPEND_RESULTS = __config.get('search_jobs.append_results', True)
199+
198200
TYPE_JOB = QtWidgets.QTreeWidgetItem.UserType + 1
199201
TYPE_LAYER = QtWidgets.QTreeWidgetItem.UserType + 2
200202
TYPE_FRAME = QtWidgets.QTreeWidgetItem.UserType + 3

cuegui/cuegui/config/cuegui.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,8 @@ finished_jobs_readonly.layer: True
152152
# MOVE_JOB_TO_GROUP, SET_ALL_RENDER_LAYER_MAX_CORES)
153153
# An empty string means all actions are active.
154154
filter_dialog.disabled_action_types: ''
155+
156+
# Define whether or not new jobs should be appended to the current list of jobs on the JobMonitor widget
157+
# - True: search result will append jobs to the current list of monitored jobs
158+
# - False: repopulate the jobs table with the search result
159+
search_jobs.append_results: True

cuegui/cuegui/plugins/MonitorJobsPlugin.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,14 @@ def _loadFinishedJobsSetup(self, layout):
193193
self.__loadFinishedJobsCheckBox.stateChanged.connect(self._regexLoadJobsHandle) # pylint: disable=no-member
194194

195195
def _regexLoadJobsHandle(self):
196-
"""This will select all jobs that have a name that contain the substring
197-
in self.__regexLoadJobsEditBox.text() and scroll to the first match"""
196+
"""This will select all jobs that have a name that contains the substring
197+
in self.__regexLoadJobsEditBox.text() and scroll to the first match."""
198198
substring = str(self.__regexLoadJobsEditBox.text()).strip()
199199
load_finished_jobs = self.__loadFinishedJobsCheckBox.isChecked()
200200

201-
self.jobMonitor.removeAllItems()
201+
# Only clear the existing jobs if SEARCH_JOBS_APPEND_RESULTS is False
202+
if not cuegui.Constants.SEARCH_JOBS_APPEND_RESULTS:
203+
self.jobMonitor.removeAllItems()
202204

203205
if substring:
204206
# Load job if a uuid is provided

0 commit comments

Comments
 (0)