diff --git a/cocoa/base/DetailsPanel.m b/cocoa/base/DetailsPanel.m index d3dd50e8..bb02ff57 100644 --- a/cocoa/base/DetailsPanel.m +++ b/cocoa/base/DetailsPanel.m @@ -16,13 +16,11 @@ http://www.hardcoded.net/licenses/bsd_license [self window]; //So the detailsTable is initialized. model = [[PyDetailsPanel alloc] initWithModel:aPyRef]; [model bindCallback:createCallback(@"DetailsPanelView", self)]; - [model connect]; return self; } - (void)dealloc { - [model disconnect]; [model release]; [super dealloc]; } diff --git a/cocoa/base/DirectoryOutline.m b/cocoa/base/DirectoryOutline.m index b38646d8..caef39c2 100644 --- a/cocoa/base/DirectoryOutline.m +++ b/cocoa/base/DirectoryOutline.m @@ -17,16 +17,9 @@ http://www.hardcoded.net/licenses/bsd_license [model bindCallback:createCallback(@"DirectoryOutlineView", self)]; [model release]; [outlineView registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]]; - [[self py] connect]; return self; } -- (void)dealloc -{ - [[self py] disconnect]; - [super dealloc]; -} - - (PyDirectoryOutline *)py { return (PyDirectoryOutline *)py; diff --git a/cocoa/base/PrioritizeDialog.m b/cocoa/base/PrioritizeDialog.m index 51a4428b..9ef6127b 100644 --- a/cocoa/base/PrioritizeDialog.m +++ b/cocoa/base/PrioritizeDialog.m @@ -19,13 +19,11 @@ http://www.hardcoded.net/licenses/bsd_license categoryPopUp = [[HSPopUpList alloc] initWithPyRef:[[self model] categoryList] popupView:categoryPopUpView]; criteriaList = [[HSSelectableList alloc] initWithPyRef:[[self model] criteriaList] tableView:criteriaTableView]; prioritizationList = [[PrioritizeList alloc] initWithPyRef:[[self model] prioritizationList] tableView:prioritizationTableView]; - [model connect]; return self; } - (void)dealloc { - [model disconnect]; [categoryPopUp release]; [criteriaList release]; [prioritizationList release]; diff --git a/cocoa/base/ProblemDialog.m b/cocoa/base/ProblemDialog.m index 37af4e80..22d7e364 100644 --- a/cocoa/base/ProblemDialog.m +++ b/cocoa/base/ProblemDialog.m @@ -17,15 +17,11 @@ http://www.hardcoded.net/licenses/bsd_license model = [[PyProblemDialog alloc] initWithModel:aPyRef]; problemTable = [[HSTable alloc] initWithPyRef:[model problemTable] tableView:problemTableView]; [self initializeColumns]; - [model connect]; - [[problemTable model] connect]; return self; } - (void)dealloc { - [[problemTable model] disconnect]; - [model disconnect]; [problemTable release]; [model release]; [super dealloc]; diff --git a/cocoa/base/ResultTable.m b/cocoa/base/ResultTable.m index 19b57b50..2c5c1847 100644 --- a/cocoa/base/ResultTable.m +++ b/cocoa/base/ResultTable.m @@ -25,13 +25,11 @@ http://www.hardcoded.net/licenses/bsd_license [m bindCallback:createCallback(@"ResultTableView", self)]; [m release]; _deltaColumns = [[NSSet setWithArray:[[self model] deltaColumns]] retain]; - [model connect]; return self; } - (void)dealloc { - [model disconnect]; [_deltaColumns release]; [super dealloc]; } diff --git a/cocoa/base/StatsLabel.m b/cocoa/base/StatsLabel.m index 15881688..08f94814 100644 --- a/cocoa/base/StatsLabel.m +++ b/cocoa/base/StatsLabel.m @@ -15,19 +15,10 @@ http://www.hardcoded.net/licenses/bsd_license PyStatsLabel *m = [[PyStatsLabel alloc] initWithModel:aPyRef]; self = [self initWithModel:m view:aLabelView]; [m bindCallback:createCallback(@"StatsLabelView", self)]; - [m connect]; [m release]; return self; } -- (void)dealloc -{ - [[self model] disconnect]; - [model release]; - [view release]; - [super dealloc]; -} - - (PyStatsLabel *)model { return (PyStatsLabel *)model; diff --git a/core/app.py b/core/app.py index 92cf8042..36c0d950 100644 --- a/core/app.py +++ b/core/app.py @@ -112,7 +112,12 @@ class DupeGuru(RegistrableApplication, Broadcaster): self.prioritize_dialog = PrioritizeDialog(self) self.problem_dialog = ProblemDialog(self) self.stats_label = StatsLabel(self) - # subclasses must create self.result_table + self.result_table = self._create_result_table() + children = [self.result_table, self.directory_tree, self.problem_dialog, self.stats_label, + self.details_panel] + for child in children: + child.connect() + # subclasses must create and connect self.result_table #--- Virtual def _get_display_info(self, dupe, group, delta): @@ -127,6 +132,9 @@ class DupeGuru(RegistrableApplication, Broadcaster): def _prioritization_categories(self): raise NotImplementedError() + def _create_result_table(self): + raise NotImplementedError() + #--- Private def _do_delete(self, j, replace_with_hardlinks): def op(dupe): diff --git a/core/gui/problem_dialog.py b/core/gui/problem_dialog.py index b636c4f3..a28e75c5 100644 --- a/core/gui/problem_dialog.py +++ b/core/gui/problem_dialog.py @@ -17,6 +17,7 @@ class ProblemDialog(GUIObject, Broadcaster): Broadcaster.__init__(self) self._selected_dupe = None self.problem_table = ProblemTable(self) + self.problem_table.connect() def reveal_selected_dupe(self): if self._selected_dupe is not None: diff --git a/core_se/app.py b/core_se/app.py index 36c9c19e..040bf3f3 100644 --- a/core_se/app.py +++ b/core_se/app.py @@ -17,10 +17,6 @@ class DupeGuru(DupeGuruBase): NAME = __appname__ METADATA_TO_READ = ['size', 'mtime'] - def __init__(self, view, appdata): - DupeGuruBase.__init__(self, view, appdata) - self.result_table = ResultTable(self) - def _get_display_info(self, dupe, group, delta): size = dupe.size mtime = dupe.mtime @@ -67,3 +63,6 @@ class DupeGuru(DupeGuruBase): def _prioritization_categories(self): return prioritize.all_categories() + def _create_result_table(self): + return ResultTable(self) +