mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 06:37:17 +00:00
[#132 state:fixed] Added a debug mode preference as well as extra debug loggings.
This commit is contained in:
@@ -48,7 +48,8 @@ class DupeGuru(DupeGuruBase, QObject):
|
||||
if not op.exists(appdata):
|
||||
os.makedirs(appdata)
|
||||
# For basicConfig() to work, we have to be sure that no logging has taken place before this call.
|
||||
logging.basicConfig(filename=op.join(appdata, 'debug.log'), level=logging.WARNING)
|
||||
logging.basicConfig(filename=op.join(appdata, 'debug.log'), level=logging.WARNING,
|
||||
format='%(asctime)s - %(levelname)s - %(message)s')
|
||||
self.prefs = self._create_preferences()
|
||||
self.prefs.load()
|
||||
DupeGuruBase.__init__(self, data_module, appdata)
|
||||
|
||||
@@ -27,6 +27,7 @@ class Preferences(PreferencesBase):
|
||||
self.ignore_hardlink_matches = get('IgnoreHardlinkMatches', self.ignore_hardlink_matches)
|
||||
self.use_regexp = get('UseRegexp', self.use_regexp)
|
||||
self.remove_empty_folders = get('RemoveEmptyFolders', self.remove_empty_folders)
|
||||
self.debug_mode = get('DebugMode', self.debug_mode)
|
||||
self.destination_type = get('DestinationType', self.destination_type)
|
||||
self.custom_command = get('CustomCommand', self.custom_command)
|
||||
self.language = get('Language', self.language)
|
||||
@@ -59,6 +60,7 @@ class Preferences(PreferencesBase):
|
||||
self.use_regexp = False
|
||||
self.ignore_hardlink_matches = False
|
||||
self.remove_empty_folders = False
|
||||
self.debug_mode = False
|
||||
self.destination_type = 1
|
||||
self.custom_command = ''
|
||||
self.language = ''
|
||||
@@ -89,6 +91,7 @@ class Preferences(PreferencesBase):
|
||||
set_('IgnoreHardlinkMatches', self.ignore_hardlink_matches)
|
||||
set_('UseRegexp', self.use_regexp)
|
||||
set_('RemoveEmptyFolders', self.remove_empty_folders)
|
||||
set_('DebugMode', self.debug_mode)
|
||||
set_('DestinationType', self.destination_type)
|
||||
set_('CustomCommand', self.custom_command)
|
||||
set_('ColumnsWidth', self.columns_width)
|
||||
|
||||
@@ -131,6 +131,7 @@ class PreferencesDialogBase(QDialog):
|
||||
setchecked(self.useRegexpBox, prefs.use_regexp)
|
||||
setchecked(self.removeEmptyFoldersBox, prefs.remove_empty_folders)
|
||||
setchecked(self.ignoreHardlinkMatches, prefs.ignore_hardlink_matches)
|
||||
setchecked(self.debugModeBox, prefs.debug_mode)
|
||||
self.copyMoveDestinationComboBox.setCurrentIndex(prefs.destination_type)
|
||||
self.customCommandEdit.setText(prefs.custom_command)
|
||||
langindex = {'fr': 1}.get(self.app.prefs.language, 0)
|
||||
@@ -145,6 +146,7 @@ class PreferencesDialogBase(QDialog):
|
||||
prefs.use_regexp = ischecked(self.useRegexpBox)
|
||||
prefs.remove_empty_folders = ischecked(self.removeEmptyFoldersBox)
|
||||
prefs.ignore_hardlink_matches = ischecked(self.ignoreHardlinkMatches)
|
||||
prefs.debug_mode = ischecked(self.debugModeBox)
|
||||
prefs.destination_type = self.copyMoveDestinationComboBox.currentIndex()
|
||||
prefs.custom_command = str(self.customCommandEdit.text())
|
||||
langs = ['en', 'fr']
|
||||
|
||||
@@ -390,6 +390,8 @@
|
||||
<source>Delete and hardlink duplicates</source>
|
||||
<translation>Hardlinking de doublons</translation>
|
||||
</message>
|
||||
|
||||
<!--- Preferences dialog -->
|
||||
<message>
|
||||
<source>Scan Type:</source>
|
||||
<translation>Type de scan:</translation>
|
||||
@@ -534,6 +536,10 @@
|
||||
<source>French</source>
|
||||
<translation>Français</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Debug mode (restart required)</source>
|
||||
<translation>Mode de déboguage (redémarrage requis)</translation>
|
||||
</message>
|
||||
</context>
|
||||
|
||||
<!-- ******** Message ******** -->
|
||||
|
||||
@@ -88,6 +88,8 @@ class PreferencesDialog(PreferencesDialogBase):
|
||||
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(tr("Debug mode (restart required)")))
|
||||
self.widgetsVLayout.addWidget(self.debugModeBox)
|
||||
self._setupBottomPart()
|
||||
|
||||
def _load(self, prefs, setchecked):
|
||||
|
||||
@@ -28,6 +28,8 @@ class PreferencesDialog(PreferencesDialogBase):
|
||||
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(tr("Debug mode (restart required)")))
|
||||
self.widgetsVLayout.addWidget(self.debugModeBox)
|
||||
self._setupBottomPart()
|
||||
|
||||
def _load(self, prefs, setchecked):
|
||||
|
||||
@@ -76,6 +76,8 @@ class PreferencesDialog(PreferencesDialogBase):
|
||||
self.verticalLayout_4.addLayout(self.horizontalLayout_2)
|
||||
self._setupAddCheckbox('ignoreHardlinkMatches', tr("Ignore duplicates hardlinking to the same file"), self.widget)
|
||||
self.verticalLayout_4.addWidget(self.ignoreHardlinkMatches)
|
||||
self._setupAddCheckbox('debugModeBox', tr(tr("Debug mode (restart required)")), self.widget)
|
||||
self.verticalLayout_4.addWidget(self.debugModeBox)
|
||||
self.widgetsVLayout.addWidget(self.widget)
|
||||
self._setupBottomPart()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user