From 16b96b78d79f19b20778985b5aa8c1c9c5e38255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20N=C3=A9au?= Date: Tue, 21 Jun 2016 17:38:11 +0100 Subject: [PATCH] Fix #84: refresh connections menu upon add/delete Refresh profiles in the right-click menu when a profile is added or deleted via the preferences dialog Fixes issue #84 --- sonata/preferences.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sonata/preferences.py b/sonata/preferences.py index 9f0a3e54..4af477fd 100644 --- a/sonata/preferences.py +++ b/sonata/preferences.py @@ -516,6 +516,7 @@ def _add_profile(self, _button, nameentry, profile_combo, remove_profiles): self.config.password.append(self.config.password[profile_num]) self.config.musicdir.append(self.config.musicdir[profile_num]) self._populate_profile_combo(profile_combo, len(self.config.profile_names)-1, remove_profiles) + self.populate_profiles_for_menu() def _remove_profile(self, _button, profile_combo, remove_profiles): profile_num = profile_combo.get_active() @@ -528,6 +529,7 @@ def _remove_profile(self, _button, profile_combo, remove_profiles): self.config.port.pop(profile_num) self.config.password.pop(profile_num) self.config.musicdir.pop(profile_num) + self.populate_profiles_for_menu() if profile_num > 0: self._populate_profile_combo(profile_combo, profile_num-1, remove_profiles) else: