mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
[#54 state:fixed] Implemented enable/disable mechanism for pref pane widget based on selected scan type.
--HG-- extra : convert_revision : svn%3Ac306627e-7827-47d3-bdf0-9a457c9553a1/trunk%40119
This commit is contained in:
parent
65944ef813
commit
4e7e4c9850
@ -33,6 +33,7 @@ class PreferencesDialog(QDialog, Ui_PreferencesDialog):
|
||||
self._setupUi()
|
||||
|
||||
self.connect(self.buttonBox, SIGNAL('clicked(QAbstractButton*)'), self.buttonClicked)
|
||||
self.connect(self.scanTypeComboBox, SIGNAL('currentIndexChanged(int)'), self.scanTypeChanged)
|
||||
|
||||
def _setupUi(self):
|
||||
self.setupUi(self)
|
||||
@ -85,3 +86,18 @@ class PreferencesDialog(QDialog, Ui_PreferencesDialog):
|
||||
if role == QDialogButtonBox.ResetRole:
|
||||
self.resetToDefaults()
|
||||
|
||||
def scanTypeChanged(self, index):
|
||||
scan_type = SCAN_TYPE_ORDER[self.scanTypeComboBox.currentIndex()]
|
||||
word_based = scan_type in [SCAN_TYPE_FILENAME, SCAN_TYPE_FIELDS, SCAN_TYPE_FIELDS_NO_ORDER,
|
||||
SCAN_TYPE_TAG]
|
||||
tag_based = scan_type == SCAN_TYPE_TAG
|
||||
self.filterHardnessSlider.setEnabled(word_based)
|
||||
self.matchSimilarBox.setEnabled(word_based)
|
||||
self.wordWeightingBox.setEnabled(word_based)
|
||||
self.tagTrackBox.setEnabled(tag_based)
|
||||
self.tagArtistBox.setEnabled(tag_based)
|
||||
self.tagAlbumBox.setEnabled(tag_based)
|
||||
self.tagTitleBox.setEnabled(tag_based)
|
||||
self.tagGenreBox.setEnabled(tag_based)
|
||||
self.tagYearBox.setEnabled(tag_based)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user