1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 14:41:39 +00:00

[#138] Added a prompt label and a remove button to the reprioritization dialog (Qt).

This commit is contained in:
Virgil Dupras
2011-09-12 11:05:53 -04:00
parent 90f9493ccc
commit cf606a494c
3 changed files with 41 additions and 4 deletions

View File

@@ -23,6 +23,9 @@ class PrioritizationList(GUISelectableList):
self.dialog = dialog
GUISelectableList.__init__(self)
def _refresh_contents(self):
self[:] = [crit.display for crit in self.dialog.prioritizations]
def move_indexes(self, indexes, dest_index):
indexes.sort()
prilist = self.dialog.prioritizations
@@ -30,7 +33,13 @@ class PrioritizationList(GUISelectableList):
for i in reversed(indexes):
del prilist[i]
prilist[dest_index:dest_index] = selected
self[:] = [crit.display for crit in prilist]
self._refresh_contents()
def remove_selected(self):
prilist = self.dialog.prioritizations
for i in sorted(self.selected_indexes, reverse=True):
del prilist[i]
self._refresh_contents()
class PrioritizeDialog:
def __init__(self, view, app):
@@ -57,5 +66,8 @@ class PrioritizeDialog:
self.prioritizations.append(crit)
self.prioritization_list[:] = [crit.display for crit in self.prioritizations]
def remove_selected(self):
self.prioritization_list.remove_selected()
def perform_reprioritization(self):
self.app.reprioritize_groups(self._sort_key)