Skip to content

Commit

Permalink
Fix copy functionality in log view plugi (#864)
Browse files Browse the repository at this point in the history
* Update dispatchQuery to use min_cores

Sorting jobs only by priority causes a situation where low priority jobs can get starved by a constant flow of high priority jobs.
The new formula adds a modifier to the sorting rank to take into account the number of cores the job is requesting and also the number of days the job is waiting on the queue.
Priorities numbers over 200 will mostly override the formula and work as a priority only based scheduling.
sort = priority + (100 * (1 - (job.cores/job.int_min_cores))) + (age in days)

Besides that, also take layer_int_cores_min into account when filtering folder_resourse limitations to avoid allocating more cores than the folder limits.

(cherry picked from commit 566411aeeddc60983a30eabe121fd03263d05525)

* Revert "Update dispatchQuery to use min_cores"

This reverts commit 2eb4936

* Fix copy functionality in log view plugin

Treatment of connecting a signal to a slot with default params in PySide
differs a bit from PyQt. Fixed it by explicitly indicating the datatype
for the trigger signal

(cherry picked from commit a387e041fd051c722537b886c011f25d839c5f14)

Co-authored-by: Fermi Perumal <[email protected]>
  • Loading branch information
DiegoTavares and FermiPerumal committed Dec 18, 2020
1 parent f160bfd commit e20693d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cuegui/cuegui/plugins/LogViewPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ def __init__(self, parent):
self.copy_action = QtWidgets.QAction('Copy', self)
self.copy_action.setStatusTip('Copy Selection')
self.copy_action.setShortcut('Ctrl+C')
self.copy_action.triggered.connect(lambda triggered, i=0:
self.copy_selection(0))
self.copy_action.triggered[bool].connect(lambda triggered:
self.copy_selection(QtGui.QClipboard.Clipboard))
self.addAction(self.copy_action)

def context_menu(self):
Expand Down Expand Up @@ -159,7 +159,6 @@ def copy_selection(self, mode):
QtGui.QClipboard.Selection = Selection (middle-mouse))
@type mode: int
"""

selection = self.textCursor().selection()
QtWidgets.QApplication.clipboard().setText('', mode)
QtWidgets.QApplication.clipboard().setText(selection.toPlainText(), mode)
Expand Down

0 comments on commit e20693d

Please sign in to comment.