diff --git a/doc/changelog.md b/doc/changelog.md index ebb67885..9de89351 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -2,6 +2,7 @@ ## changes in this version +* Custom buffer ordering will not be reseted every time the application restarts after an account setting has been modified. * When adding or removing an user from a list, it is possible to press enter in the focused list instead of having to search for the "add" or "delete" button. * Quoted and long tweets are displayed properly in the sent tweets buffer after being send. ([#253](https://github.com/manuelcortez/TWBlue/issues/253)) * Fixed an issue that was making the list manager keystroke unable to be shown in the keystroke editor. Now the keystroke is listed properly. ([#260](https://github.com/manuelcortez/TWBlue/issues/260)) diff --git a/src/controller/settings.py b/src/controller/settings.py index 96dd4cab..513b3da9 100644 --- a/src/controller/settings.py +++ b/src/controller/settings.py @@ -211,7 +211,7 @@ class accountSettingsController(globalSettingsController): else: self.config["general"]["retweet_mode"] = "comment" buffers_list = self.dialog.buffers.get_list() - if set(self.config["general"]["buffer_order"]) != set(buffers_list) or buffers_list != self.config["general"]["buffer_order"]: + if buffers_list != self.config["general"]["buffer_order"]: self.needs_restart = True self.config["general"]["buffer_order"] = buffers_list self.config["reporting"]["speech_reporting"] = self.dialog.get_value("reporting", "speech_reporting") @@ -291,10 +291,14 @@ class accountSettingsController(globalSettingsController): all_buffers['muted']=_(u"Muted users") list_buffers = [] hidden_buffers=[] - for i in all_buffers.keys(): - if i in self.config["general"]["buffer_order"]: + all_buffers_keys = all_buffers.keys() + # Check buffers shown first. + for i in self.config["general"]["buffer_order"]: + if i in all_buffers_keys: list_buffers.append((i, all_buffers[i], True)) - else: + # This second pass will retrieve all hidden buffers. + for i in all_buffers_keys: + if i not in self.config["general"]["buffer_order"]: hidden_buffers.append((i, all_buffers[i], False)) list_buffers.extend(hidden_buffers) return list_buffers