Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a flag to search job with appended results #1514

Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions cuegui/cuegui/Constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ def __packaged_version():
for action_type
in __config.get('filter_dialog.disabled_action_types', "").split(",")]

SEARCH_JOBS_APPEND_RESULTS = __config.get('search_jobs.append_results', True)

TYPE_JOB = QtWidgets.QTreeWidgetItem.UserType + 1
TYPE_LAYER = QtWidgets.QTreeWidgetItem.UserType + 2
TYPE_FRAME = QtWidgets.QTreeWidgetItem.UserType + 3
Expand Down
5 changes: 5 additions & 0 deletions cuegui/cuegui/config/cuegui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,8 @@ finished_jobs_readonly.layer: True
# MOVE_JOB_TO_GROUP, SET_ALL_RENDER_LAYER_MAX_CORES)
# An empty string means all actions are active.
filter_dialog.disabled_action_types: ''

# A flag for search job with appended results
# true to appended to the current list of monitored jobs,
# false to clear the current job list and show only the new search results
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# A flag for search job with appended results
# true to appended to the current list of monitored jobs,
# false to clear the current job list and show only the new search results
# Define whether or not new jobs should be appended to the current list of jobs on the JobMonitor widget
# - True: search result will append jobs to the current list of monitored jobs
# - False: repopulate the jobs table with the search result

search_jobs.append_results: True
8 changes: 5 additions & 3 deletions cuegui/cuegui/plugins/MonitorJobsPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,14 @@ def _loadFinishedJobsSetup(self, layout):
self.__loadFinishedJobsCheckBox.stateChanged.connect(self._regexLoadJobsHandle) # pylint: disable=no-member

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

self.jobMonitor.removeAllItems()
# Only clear the existing jobs if SEARCH_JOBS_APPEND_RESULTS is False
if not cuegui.Constants.SEARCH_JOBS_APPEND_RESULTS:
self.jobMonitor.removeAllItems()

if substring:
# Load job if a uuid is provided
Expand Down
Loading