1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 06:37:17 +00:00

Decoupled app in core.app from apps in qt.app and core.app_cocoa. Instead of subclassing it, they now hold a reference to it while fulfilling the role of core.app's "view".

This commit is contained in:
Virgil Dupras
2011-09-20 15:06:29 -04:00
parent 841b249b67
commit f730f4f55a
15 changed files with 162 additions and 170 deletions

View File

@@ -74,16 +74,16 @@ class DupeGuru(DupeGuruBase):
DupeGuruBase.__init__(self, data_pe)
def _setup(self):
self.scanner = ScannerPE()
self.directories.fileclasses = [File]
self.scanner.cache_path = op.join(self.appdata, 'cached_pictures.db')
self.model.scanner = ScannerPE()
self.model.directories.fileclasses = [File]
self.model.scanner.cache_path = op.join(self.model.appdata, 'cached_pictures.db')
DupeGuruBase._setup(self)
def _update_options(self):
DupeGuruBase._update_options(self)
self.scanner.scan_type = self.prefs.scan_type
self.scanner.match_scaled = self.prefs.match_scaled
self.scanner.threshold = self.prefs.filter_hardness
self.model.scanner.scan_type = self.prefs.scan_type
self.model.scanner.match_scaled = self.prefs.match_scaled
self.model.scanner.threshold = self.prefs.filter_hardness
def _create_details_dialog(self, parent):
return DetailsDialog(parent, self)

View File

@@ -60,10 +60,10 @@ class DetailsDialog(DetailsDialogBase):
self.verticalLayout.addWidget(self.tableView)
def _update(self):
if not self.app.selected_dupes:
if not self.app.model.selected_dupes:
return
dupe = self.app.selected_dupes[0]
group = self.app.results.get_group_of_duplicate(dupe)
dupe = self.app.model.selected_dupes[0]
group = self.app.model.results.get_group_of_duplicate(dupe)
ref = group.ref
self.selectedPixmap = QPixmap(str(dupe.path))