1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2024-11-16 12:19:03 +00:00
dupeguru/qt/pe/preferences_dialog.py
Virgil Dupras 2c127adf59 [#32] Internationalized the qt layer and localized it to French.
In the process of doing so, I also added a new preferences_dialog base class to reduce code duplication in the three pref dialogs (I didn't want to copy/paste the language combobox addition three times).
2011-01-21 13:57:54 +01:00

49 lines
2.0 KiB
Python

# Created By: Virgil Dupras
# Created On: 2009-04-29
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
import sys
from PyQt4.QtGui import QLabel, QApplication
from hscommon.trans import tr
from ..base.preferences_dialog import PreferencesDialogBase
from . import preferences
class PreferencesDialog(PreferencesDialogBase):
def _setupPreferenceWidgets(self):
self._setupFilterHardnessBox()
self.widgetsVLayout.addLayout(self.filterHardnessHLayout)
self._setupAddCheckbox('matchScaledBox', tr("Match scaled pictures together"))
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._setupBottomPart()
def _load(self, prefs, setchecked):
setchecked(self.matchScaledBox, prefs.match_scaled)
def _save(self, prefs, ischecked):
prefs.match_scaled = ischecked(self.matchScaledBox)
def resetToDefaults(self):
self.load(preferences.Preferences())
if __name__ == '__main__':
from ..testapp import TestApp
app = QApplication([])
dgapp = TestApp()
dialog = PreferencesDialog(None, dgapp)
dialog.show()
sys.exit(app.exec_())