core, quick_frontends: added an "extra" item in getMenus + use of new quick_menus module in QuickApp

This commit is contained in:
Goffi 2015-03-17 19:33:05 +01:00
commit 80e65d5b84
2 changed files with 15 additions and 9 deletions

View file

@ -25,7 +25,8 @@ from sat.core import exceptions
from sat.tools.misc import TriggerManager
from sat_frontends.tools import jid
from sat_frontends.quick_frontend.quick_widgets import QuickWidgetsManager
from sat_frontends.quick_frontend import quick_widgets
from sat_frontends.quick_frontend import quick_menus
from sat_frontends.quick_frontend import quick_chat, quick_games
from sat_frontends.quick_frontend.constants import Const as C
@ -203,12 +204,13 @@ class QuickApp(object):
@param create_bridge: method to use to create the Bridge
@param check_options: method to call to check options (usually command line arguments)
"""
self.menus = quick_menus.QuickMenusManager(self)
ProfileManager.host = self
self.profiles = ProfilesManager()
self.ready_profiles = set() # profiles which are connected and ready
self.signals_cache = {} # used to keep signal received between start of plug_profile and when the profile is actualy ready
self.contact_lists = {}
self.widgets = QuickWidgetsManager(self)
self.widgets = quick_widgets.QuickWidgetsManager(self)
if check_options is not None:
self.options = check_options()
else:
@ -656,7 +658,7 @@ class QuickApp(object):
def actionResultHandler(self, type, id, data, profile):
raise NotImplementedError
def launchAction(self, callback_id, data=None, callback=None, profile="@NONE@"):
def launchAction(self, callback_id, data=None, callback=None, profile=C.PROF_KEY_NONE):
"""Launch a dynamic action
@param callback_id: id of the action to launch
@param data: data needed only for certain actions

View file

@ -38,7 +38,6 @@ class QuickChat(quick_widgets.QuickWidget):
"""
@param type_: can be C.CHAT_ONE2ONE for single conversation or C.CHAT_GROUP for chat à la IRC
"""
quick_widgets.QuickWidget.__init__(self, host, target, profiles=profiles)
assert type_ in (C.CHAT_ONE2ONE, C.CHAT_GROUP)
if type_ == C.CHAT_GROUP and target.resource: