mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 14:41:39 +00:00
[#138] Added a very preliminary version of the prioritization dialog. A big part of this commit is about refactoring the tests and introducing a TestApp for dupeGuru (in core.tests.base).
This commit is contained in:
30
core/gui/prioritize_dialog.py
Normal file
30
core/gui/prioritize_dialog.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# Created By: Virgil Dupras
|
||||
# Created On: 2011-09-06
|
||||
# Copyright 2011 Hardcoded Software (http://www.hardcoded.net)
|
||||
#
|
||||
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/bsd_license
|
||||
|
||||
from hscommon.gui.selectable_list import SelectableList
|
||||
|
||||
from ..prioritize import KindCategory
|
||||
|
||||
class CriterionCategoryList(SelectableList):
|
||||
def __init__(self, dialog):
|
||||
self.dialog = dialog
|
||||
SelectableList.__init__(self, [c.NAME for c in dialog.categories])
|
||||
|
||||
def _update_selection(self):
|
||||
self.dialog.select_category(self.dialog.categories[self.selected_index])
|
||||
|
||||
|
||||
class PrioritizeDialog:
|
||||
def __init__(self, view, app):
|
||||
self.categories = [KindCategory(app.results)]
|
||||
self.category_list = CriterionCategoryList(self)
|
||||
self.criteria_list = []
|
||||
|
||||
def select_category(self, category):
|
||||
criteria = category.criteria_list()
|
||||
self.criteria_list = [c.value for c in criteria]
|
||||
Reference in New Issue
Block a user