From 365c7f68adaa675b9aa2f9af9ec596f6fc1e7fa8 Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Mon, 6 Jun 2005 11:53:07 +0000 Subject: [PATCH] sorting by keys in change_status_dialogs --- src/common/helpers.py | 6 ++++++ src/dialogs.py | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/common/helpers.py b/src/common/helpers.py index 945efc9d1..eb34e305f 100644 --- a/src/common/helpers.py +++ b/src/common/helpers.py @@ -44,3 +44,9 @@ def get_uf_show(show): else: uf_show = _('Has errors') return unicode(uf_show) + +def get_sorted_keys(adict): + keys = adict.keys() + keys.sort() + return keys + \ No newline at end of file diff --git a/src/dialogs.py b/src/dialogs.py index e15150a9f..c225db779 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -28,6 +28,7 @@ from gajim import User from common import gajim from common import helpers from common import i18n +from common import helpers _ = i18n._ APP = i18n.APP @@ -196,14 +197,15 @@ class Change_status_message_dialog: message_textview = self.xml.get_widget('message_textview') self.message_buffer = message_textview.get_buffer() self.message_buffer.set_text(gajim.config.get('last_status_msg')) - self.values = {'':''} + self.values = {'':''} # have an empty string selectable, so user can clear msg for msg in gajim.config.get_per('statusmsg'): self.values[msg] = gajim.config.get_per('statusmsg', msg, 'message') + sorted_keys_list = helpers.get_sorted_keys(self.values) liststore = gtk.ListStore(str, str) message_comboboxentry = self.xml.get_widget('message_comboboxentry') message_comboboxentry.set_model(liststore) message_comboboxentry.set_text_column(0) - for val in self.values.keys(): + for val in sorted_keys_list: message_comboboxentry.append_text(val) self.xml.signal_autoconnect(self) self.window.show_all()