mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 06:37:17 +00:00
Refactoring: de-notified problems_dialog. It simplifies things.
This commit is contained in:
@@ -24,9 +24,6 @@ class GUIObject(Listener):
|
||||
def marking_changed(self):
|
||||
pass
|
||||
|
||||
def problems_changed(self):
|
||||
pass
|
||||
|
||||
def results_changed(self):
|
||||
pass
|
||||
|
||||
|
||||
@@ -6,18 +6,17 @@
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/bsd_license
|
||||
|
||||
from hscommon.notify import Broadcaster
|
||||
|
||||
from .base import GUIObject
|
||||
from .problem_table import ProblemTable
|
||||
|
||||
class ProblemDialog(GUIObject, Broadcaster):
|
||||
class ProblemDialog:
|
||||
def __init__(self, app):
|
||||
GUIObject.__init__(self, app)
|
||||
Broadcaster.__init__(self)
|
||||
self.app = app
|
||||
self._selected_dupe = None
|
||||
self.problem_table = ProblemTable(self)
|
||||
self.problem_table.connect()
|
||||
|
||||
def refresh(self):
|
||||
self._selected_dupe = None
|
||||
self.problem_table.refresh()
|
||||
|
||||
def reveal_selected_dupe(self):
|
||||
if self._selected_dupe is not None:
|
||||
@@ -26,8 +25,3 @@ class ProblemDialog(GUIObject, Broadcaster):
|
||||
def select_dupe(self, dupe):
|
||||
self._selected_dupe = dupe
|
||||
|
||||
#--- Event Handlers
|
||||
def problems_changed(self):
|
||||
self._selected_dupe = None
|
||||
self.notify('problems_changed')
|
||||
|
||||
|
||||
@@ -6,14 +6,13 @@
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/bsd_license
|
||||
|
||||
from hscommon.notify import Listener
|
||||
from hscommon.gui.table import GUITable, Row
|
||||
from hscommon.gui.column import Column, Columns
|
||||
from hscommon.trans import trget
|
||||
|
||||
coltr = trget('columns')
|
||||
|
||||
class ProblemTable(GUITable, Listener):
|
||||
class ProblemTable(GUITable):
|
||||
COLUMNS = [
|
||||
Column('path', coltr("File Path")),
|
||||
Column('msg', coltr("Error Message")),
|
||||
@@ -21,7 +20,6 @@ class ProblemTable(GUITable, Listener):
|
||||
|
||||
def __init__(self, problem_dialog):
|
||||
GUITable.__init__(self)
|
||||
Listener.__init__(self, problem_dialog)
|
||||
self.columns = Columns(self)
|
||||
self.view = None
|
||||
self.dialog = problem_dialog
|
||||
@@ -37,10 +35,6 @@ class ProblemTable(GUITable, Listener):
|
||||
for dupe, msg in problems:
|
||||
self.append(ProblemRow(self, dupe, msg))
|
||||
|
||||
#--- Event handlers
|
||||
def problems_changed(self):
|
||||
self.refresh()
|
||||
|
||||
|
||||
class ProblemRow(Row):
|
||||
def __init__(self, table, dupe, msg):
|
||||
|
||||
Reference in New Issue
Block a user