comparison frontends/src/quick_frontend/quick_app.py @ 1365:ba87b940f07a frontends_multi_profiles

core, quick_frontends: added an "extra" item in getMenus + use of new quick_menus module in QuickApp
author Goffi <goffi@goffi.org>
date Tue, 17 Mar 2015 19:33:05 +0100
parents fa77e40eb17b
children 0befb14ecf62
comparison
equal deleted inserted replaced
1364:28f0b33ca17c 1365:ba87b940f07a
23 from sat.core.i18n import _ 23 from sat.core.i18n import _
24 from sat.core import exceptions 24 from sat.core import exceptions
25 from sat.tools.misc import TriggerManager 25 from sat.tools.misc import TriggerManager
26 26
27 from sat_frontends.tools import jid 27 from sat_frontends.tools import jid
28 from sat_frontends.quick_frontend.quick_widgets import QuickWidgetsManager 28 from sat_frontends.quick_frontend import quick_widgets
29 from sat_frontends.quick_frontend import quick_menus
29 from sat_frontends.quick_frontend import quick_chat, quick_games 30 from sat_frontends.quick_frontend import quick_chat, quick_games
30 from sat_frontends.quick_frontend.constants import Const as C 31 from sat_frontends.quick_frontend.constants import Const as C
31 32
32 import sys 33 import sys
33 from collections import OrderedDict 34 from collections import OrderedDict
201 """Create a frontend application 202 """Create a frontend application
202 203
203 @param create_bridge: method to use to create the Bridge 204 @param create_bridge: method to use to create the Bridge
204 @param check_options: method to call to check options (usually command line arguments) 205 @param check_options: method to call to check options (usually command line arguments)
205 """ 206 """
207 self.menus = quick_menus.QuickMenusManager(self)
206 ProfileManager.host = self 208 ProfileManager.host = self
207 self.profiles = ProfilesManager() 209 self.profiles = ProfilesManager()
208 self.ready_profiles = set() # profiles which are connected and ready 210 self.ready_profiles = set() # profiles which are connected and ready
209 self.signals_cache = {} # used to keep signal received between start of plug_profile and when the profile is actualy ready 211 self.signals_cache = {} # used to keep signal received between start of plug_profile and when the profile is actualy ready
210 self.contact_lists = {} 212 self.contact_lists = {}
211 self.widgets = QuickWidgetsManager(self) 213 self.widgets = quick_widgets.QuickWidgetsManager(self)
212 if check_options is not None: 214 if check_options is not None:
213 self.options = check_options() 215 self.options = check_options()
214 else: 216 else:
215 self.options = None 217 self.options = None
216 218
654 raise NotImplementedError 656 raise NotImplementedError
655 657
656 def actionResultHandler(self, type, id, data, profile): 658 def actionResultHandler(self, type, id, data, profile):
657 raise NotImplementedError 659 raise NotImplementedError
658 660
659 def launchAction(self, callback_id, data=None, callback=None, profile="@NONE@"): 661 def launchAction(self, callback_id, data=None, callback=None, profile=C.PROF_KEY_NONE):
660 """Launch a dynamic action 662 """Launch a dynamic action
661 @param callback_id: id of the action to launch 663 @param callback_id: id of the action to launch
662 @param data: data needed only for certain actions 664 @param data: data needed only for certain actions
663 @param callback: if not None and 'validated' key is present, it will be called with the following parameters: 665 @param callback: if not None and 'validated' key is present, it will be called with the following parameters:
664 - callback_id 666 - callback_id