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

Added the EXIF Timestamp scan type in dgpe.

--HG--
rename : core_pe/matchbase.py => core_pe/matchblock.py
This commit is contained in:
Virgil Dupras
2011-04-21 17:17:19 +02:00
parent a0e2b11663
commit 275c6be108
18 changed files with 690 additions and 121 deletions

View File

@@ -10,12 +10,26 @@ import sys
from PyQt4.QtGui import QLabel, QApplication
from hscommon.trans import tr
from core.scanner import ScanType
from ..base.preferences_dialog import PreferencesDialogBase
from . import preferences
SCAN_TYPE_ORDER = [
ScanType.FuzzyBlock,
ScanType.ExifTimestamp,
]
class PreferencesDialog(PreferencesDialogBase):
def __init__(self, parent, app):
PreferencesDialogBase.__init__(self, parent, app)
self.scanTypeComboBox.currentIndexChanged[int].connect(self.scanTypeChanged)
def _setupPreferenceWidgets(self):
scanTypeLabels = [tr(s) for s in ["Contents", "EXIF Timestamp"]]
self._setupScanTypeBox(scanTypeLabels)
self._setupFilterHardnessBox()
self.widgetsVLayout.addLayout(self.filterHardnessHLayout)
self._setupAddCheckbox('matchScaledBox', tr("Match scaled pictures together"))
@@ -33,14 +47,24 @@ class PreferencesDialog(PreferencesDialogBase):
self._setupBottomPart()
def _load(self, prefs, setchecked):
scan_type_index = SCAN_TYPE_ORDER.index(prefs.scan_type)
self.scanTypeComboBox.setCurrentIndex(scan_type_index)
setchecked(self.matchScaledBox, prefs.match_scaled)
def _save(self, prefs, ischecked):
prefs.scan_type = SCAN_TYPE_ORDER[self.scanTypeComboBox.currentIndex()]
prefs.match_scaled = ischecked(self.matchScaledBox)
def resetToDefaults(self):
self.load(preferences.Preferences())
#--- Events
def scanTypeChanged(self, index):
scan_type = SCAN_TYPE_ORDER[self.scanTypeComboBox.currentIndex()]
fuzzy_scan = scan_type == ScanType.FuzzyBlock
self.filterHardnessSlider.setEnabled(fuzzy_scan)
self.matchScaledBox.setEnabled(fuzzy_scan)
if __name__ == '__main__':
from ..testapp import TestApp