Skip to content
This repository was archived by the owner on Aug 28, 2020. It is now read-only.

Commit 8b86374

Browse files
committed
when settings change, also emit the new setting values, not just the change setting keys
1 parent d5a1816 commit 8b86374

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

pugdebug/gui/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
class PugdebugSettingsWindow(QDialog):
2222

23-
settings_changed_signal = pyqtSignal(set)
23+
settings_changed_signal = pyqtSignal(dict)
2424

2525
def __init__(self, parent):
2626
super(PugdebugSettingsWindow, self).__init__(parent)

pugdebug/models/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,13 @@ def set_setting(key, value):
162162

163163

164164
def save_settings(new_settings):
165-
changed_settings = set()
165+
changed_settings = {}
166166

167167
for key in new_settings:
168168
value = new_settings[key]
169169
if not has_setting(key) or get_setting(key) != value:
170170
set_setting(key, value)
171-
changed_settings.add(key)
171+
changed_settings[key] = value
172172

173173
return changed_settings
174174

pugdebug/pugdebug.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,14 +417,17 @@ def handle_settings_changed(self, changed_settings):
417417
418418
Given argument is a set of settings's names which have been changed.
419419
"""
420-
if 'path/project_root' in changed_settings:
420+
changed_setting_keys = changed_settings.keys()
421+
422+
if 'path/project_root' in changed_setting_keys:
421423
self.handle_project_root_changed()
422424

423425
features = ['debugger/max_depth',
424426
'debugger/max_children',
425427
'debugger/max_data']
426428

427-
if any(True for feature in features if feature in changed_settings):
429+
if any(True for feature in features
430+
if feature in changed_setting_keys):
428431
self.handle_debugger_features_changed()
429432

430433
def handle_project_root_changed(self):

0 commit comments

Comments
 (0)