mirror of
https://github.com/arsenetar/dupeguru.git
synced 2024-11-18 04:59:03 +00:00
197acbf5b3
It leads to better discoverability of dupeguru's options and will make more sense after the big merge of all editions.
47 lines
2.0 KiB
Python
47 lines
2.0 KiB
Python
# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)
|
|
#
|
|
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
|
|
# which should be included with this package. The terms are also available at
|
|
# http://www.gnu.org/licenses/gpl-3.0.html
|
|
|
|
from hscommon.trans import trget
|
|
from core.scanner import ScanType
|
|
|
|
from ..base.preferences_dialog import PreferencesDialogBase
|
|
from . import preferences
|
|
|
|
tr = trget('ui')
|
|
|
|
class PreferencesDialog(PreferencesDialogBase):
|
|
def _setupPreferenceWidgets(self):
|
|
self._setupFilterHardnessBox()
|
|
self.widgetsVLayout.addLayout(self.filterHardnessHLayout)
|
|
self._setupAddCheckbox('matchScaledBox', tr("Match pictures of different dimensions"))
|
|
self.widgetsVLayout.addWidget(self.matchScaledBox)
|
|
self._setupAddCheckbox('mixFileKindBox', tr("Can mix file kind"))
|
|
self.widgetsVLayout.addWidget(self.mixFileKindBox)
|
|
self._setupAddCheckbox('useRegexpBox', tr("Use regular expressions when filtering"))
|
|
self.widgetsVLayout.addWidget(self.useRegexpBox)
|
|
self._setupAddCheckbox('removeEmptyFoldersBox', tr("Remove empty folders on delete or move"))
|
|
self.widgetsVLayout.addWidget(self.removeEmptyFoldersBox)
|
|
self._setupAddCheckbox('ignoreHardlinkMatches', tr("Ignore duplicates hardlinking to the same file"))
|
|
self.widgetsVLayout.addWidget(self.ignoreHardlinkMatches)
|
|
self._setupAddCheckbox('debugModeBox', tr("Debug mode (restart required)"))
|
|
self.widgetsVLayout.addWidget(self.debugModeBox)
|
|
self._setupBottomPart()
|
|
|
|
def _load(self, prefs, setchecked):
|
|
setchecked(self.matchScaledBox, prefs.match_scaled)
|
|
|
|
# Update UI state based on selected scan type
|
|
scan_type = prefs.scan_type
|
|
fuzzy_scan = scan_type == ScanType.FuzzyBlock
|
|
self.filterHardnessSlider.setEnabled(fuzzy_scan)
|
|
|
|
def _save(self, prefs, ischecked):
|
|
prefs.match_scaled = ischecked(self.matchScaledBox)
|
|
|
|
def resetToDefaults(self):
|
|
self.load(preferences.Preferences())
|
|
|