diff src/core/sat_main.py @ 987:3a96920c07b7

core, frontends: unify the roster management UIs in sat/stdui/ui_contact_list.py
author souliane <souliane@mailoo.org>
date Thu, 03 Apr 2014 16:10:44 +0200
parents 07b817f5a197
children 05e02f8b7eb4
line wrap: on
line diff
--- a/src/core/sat_main.py	Mon Apr 07 16:24:29 2014 +0200
+++ b/src/core/sat_main.py	Thu Apr 03 16:10:44 2014 +0200
@@ -40,9 +40,15 @@
 from sat.core.constants import Const as C
 from sat.memory.memory import Memory
 from sat.tools.misc import TriggerManager
+from sat.stdui import ui_contact_list
 from glob import glob
 from uuid import uuid4
 
+try:
+    from collections import OrderedDict # only available from python 2.7
+except ImportError:
+    from ordereddict import OrderedDict
+
 ### logging configuration FIXME: put this elsewhere ###
 logging.basicConfig(level=logging.DEBUG,
                     format='%(message)s')
@@ -84,7 +90,7 @@
 
     def __init__(self):
         self._cb_map = {}  # map from callback_id to callbacks
-        self._menus = {}  # dynamic menus. key: callback_id, value: menu data (dictionnary)
+        self._menus = OrderedDict()  # dynamic menus. key: callback_id, value: menu data (dictionnary)
         self.__private_data = {}  # used for internal callbacks (key = id) FIXME: to be removed
         self.profiles = {}
         self.plugins = {}
@@ -144,6 +150,7 @@
         """Method called after memory initialization is done"""
         info(_("Memory initialised"))
         self._import_plugins()
+        ui_contact_list.ContactList(self)
 
     def _import_plugins(self):
         """Import all plugins found in plugins directory"""