Browse Source

Prioritize dialog: allow adding multiple criteria at once

Adding criteria to the prioritizations list one-by-one can be tedious.
This commit enables extended selection in the criteria list and
implements adding multiple items. Multiple criteria can be selected with
conventional methods, such as holding down Ctrl or Shift keys and
clicking the items or holding down the left mouse button and hovering
the cursor over the list. All items also can be selected with Ctrl+A.

Signed-off-by: Sergey Zhuravlevich <[email protected]>
tags/4.1.0^2
Sergey Zhuravlevich 3 months ago
parent
commit
c2fef8d624
2 changed files with 5 additions and 3 deletions
  1. +4
    -3
      core/gui/prioritize_dialog.py
  2. +1
    -0
      qt/prioritize_dialog.py

+ 4
- 3
core/gui/prioritize_dialog.py View File

@@ -72,9 +72,10 @@ class PrioritizeDialog(GUIObject):
# Add selected criteria in criteria_list to prioritization_list.
if self.criteria_list.selected_index is None:
return
crit = self.criteria[self.criteria_list.selected_index]
self.prioritizations.append(crit)
del crit
for i in self.criteria_list.selected_indexes:
crit = self.criteria[i]
self.prioritizations.append(crit)
del crit
self.prioritization_list[:] = [crit.display for crit in self.prioritizations]

def remove_selected(self):


+ 1
- 0
qt/prioritize_dialog.py View File

@@ -102,6 +102,7 @@ class PrioritizeDialog(QDialog):
self.promptLabel.setWordWrap(True)
self.categoryCombobox = QComboBox()
self.criteriaListView = QListView()
self.criteriaListView.setSelectionMode(QAbstractItemView.ExtendedSelection)
self.addCriteriaButton = QPushButton(
self.style().standardIcon(QStyle.SP_ArrowRight), ""
)


Loading…
Cancel
Save