mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 14:41:39 +00:00
Enum-ified Scan Type constants, looks nicer.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/hs_license
|
||||
|
||||
from core.scanner import SCAN_TYPE_FILENAME, SCAN_TYPE_CONTENT
|
||||
from core.scanner import ScanType
|
||||
|
||||
from base.preferences import Preferences as PreferencesBase
|
||||
|
||||
@@ -32,7 +32,7 @@ class Preferences(PreferencesBase):
|
||||
|
||||
def _reset_specific(self):
|
||||
self.filter_hardness = 80
|
||||
self.scan_type = SCAN_TYPE_CONTENT
|
||||
self.scan_type = ScanType.Contents
|
||||
self.word_weighting = True
|
||||
self.match_similar = False
|
||||
self.ignore_small_files = True
|
||||
|
||||
@@ -11,14 +11,14 @@ from PyQt4.QtGui import QDialog, QDialogButtonBox
|
||||
|
||||
from hsutil.misc import tryint
|
||||
|
||||
from core.scanner import SCAN_TYPE_FILENAME, SCAN_TYPE_CONTENT
|
||||
from core.scanner import ScanType
|
||||
|
||||
from preferences_dialog_ui import Ui_PreferencesDialog
|
||||
import preferences
|
||||
|
||||
SCAN_TYPE_ORDER = [
|
||||
SCAN_TYPE_FILENAME,
|
||||
SCAN_TYPE_CONTENT,
|
||||
ScanType.Filename,
|
||||
ScanType.Contents,
|
||||
]
|
||||
|
||||
class PreferencesDialog(QDialog, Ui_PreferencesDialog):
|
||||
@@ -78,7 +78,7 @@ class PreferencesDialog(QDialog, Ui_PreferencesDialog):
|
||||
|
||||
def scanTypeChanged(self, index):
|
||||
scan_type = SCAN_TYPE_ORDER[self.scanTypeComboBox.currentIndex()]
|
||||
word_based = scan_type == SCAN_TYPE_FILENAME
|
||||
word_based = scan_type == ScanType.Filename
|
||||
self.filterHardnessSlider.setEnabled(word_based)
|
||||
self.matchSimilarBox.setEnabled(word_based)
|
||||
self.wordWeightingBox.setEnabled(word_based)
|
||||
|
||||
Reference in New Issue
Block a user