Skip to content

Commit

Permalink
Fix #84: refresh connections menu upon add/delete
Browse files Browse the repository at this point in the history
Refresh profiles in the right-click menu when a profile is added
or deleted via the preferences dialog

Fixes issue #84
  • Loading branch information
Corentin Néau committed Jun 21, 2016
1 parent 324f4b7 commit 16b96b7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sonata/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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:
Expand Down

0 comments on commit 16b96b7

Please sign in to comment.