mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 06:37:17 +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:
@@ -71,6 +71,7 @@ class DupeGuru(DupeGuruBase):
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/bsd_license
|
||||
|
||||
from PyQt4.QtCore import QSettings, QVariant
|
||||
from core.scanner import ScanType
|
||||
|
||||
from ..base.preferences import Preferences as PreferencesBase
|
||||
|
||||
@@ -24,12 +24,17 @@ class Preferences(PreferencesBase):
|
||||
]
|
||||
|
||||
def _load_specific(self, settings):
|
||||
self.match_scaled = self.get_value('MatchScaled', self.match_scaled)
|
||||
get = self.get_value
|
||||
self.scan_type = get('ScanType', self.scan_type)
|
||||
self.match_scaled = get('MatchScaled', self.match_scaled)
|
||||
|
||||
def _reset_specific(self):
|
||||
self.scan_type = ScanType.FuzzyBlock
|
||||
self.filter_hardness = 95
|
||||
self.match_scaled = False
|
||||
|
||||
def _save_specific(self, settings):
|
||||
self.set_value('MatchScaled', self.match_scaled)
|
||||
set_ = self.set_value
|
||||
set_('ScanType', self.scan_type)
|
||||
set_('MatchScaled', self.match_scaled)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user