diff options
| author | tassaron | 2017-08-19 20:45:44 -0400 |
|---|---|---|
| committer | tassaron | 2017-08-19 20:45:44 -0400 |
| commit | d4b63e4d4612db262424fe10c83f8eaa4f741f24 (patch) | |
| tree | 52bf54fdaaec35ebbd00a83ba98812ea1f30cc81 /src/gui/mainwindow.py | |
| parent | c07f2426ceeada205fdacbfba66329179a74a1dc (diff) | |
remove % from log calls
Diffstat (limited to 'src/gui/mainwindow.py')
| -rw-r--r-- | src/gui/mainwindow.py | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/gui/mainwindow.py b/src/gui/mainwindow.py index 76c53af..833d2d1 100644 --- a/src/gui/mainwindow.py +++ b/src/gui/mainwindow.py @@ -387,30 +387,46 @@ class MainWindow(QtWidgets.QMainWindow): @QtCore.pyqtSlot(int, dict) def updateComponentTitle(self, pos, presetStore=False): + ''' + Sets component title to modified or unmodified when given boolean. + If given a preset dict, compares it against the component to + determine if it is modified. + A component with no preset is always unmodified. + ''' if type(presetStore) is dict: name = presetStore['preset'] if name is None or name not in self.core.savedPresets: modified = False else: modified = (presetStore != self.core.savedPresets[name]) + if modified: + log.verbose( + 'Differing values between presets: %s', + ", ".join([ + '%s: %s' % item for item in presetStore.items() + if val != self.core.savedPresets[name][key] + ]) + ) else: modified = bool(presetStore) if pos < 0: pos = len(self.core.selectedComponents)-1 - name = str(self.core.selectedComponents[pos]) + name = self.core.selectedComponents[pos].name title = str(name) if self.core.selectedComponents[pos].currentPreset: title += ' - %s' % self.core.selectedComponents[pos].currentPreset if modified: title += '*' if type(presetStore) is bool: - log.debug('Forcing %s #%s\'s modified status to %s: %s' % ( + log.debug( + 'Forcing %s #%s\'s modified status to %s: %s', name, pos, modified, title - )) + ) else: - log.debug('Setting %s #%s\'s title: %s' % ( + log.debug( + 'Setting %s #%s\'s title: %s', name, pos, title - )) + ) self.window.listWidget_componentList.item(pos).setText(title) def updateCodecs(self): |
