Mercurial > libervia-web
comparison src/browser/sat_browser/menu.py @ 589:a5019e62c3e9 frontends_multi_profiles
browser side: big refactoring to base Libervia on QuickFrontend, first draft:
/!\ not finished, partially working and highly instable
- add collections module with an OrderedDict like class
- SatWebFrontend inherit from QuickApp
- general sat_frontends tools.jid module is used
- bridge/json methods have moved to json module
- UniBox is partially removed (should be totally removed before merge to trunk)
- Signals are now register with the generic registerSignal method (which is called mainly in QuickFrontend)
- the generic getOrCreateWidget method from QuickWidgetsManager is used instead of Libervia's specific methods
- all Widget are now based more or less directly on QuickWidget
- with the new QuickWidgetsManager.getWidgets method, it's no more necessary to check all widgets which are instance of a particular class
- ChatPanel and related moved to chat module
- MicroblogPanel and related moved to blog module
- global and overcomplicated send method has been disabled: each class should manage its own sending
- for consistency with other frontends, former ContactPanel has been renamed to ContactList and vice versa
- for the same reason, ChatPanel has been renamed to Chat
- for compatibility with QuickFrontend, a fake profile is used in several places, it is set to C.PROF_KEY_NONE (real profile is managed server side for obvious security reasons)
- changed default url for web panel to SàT website, and contact address to generic SàT contact address
- ContactList is based on QuickContactList, UI changes are done in update method
- bride call (now json module) have been greatly improved, in particular call can be done in the same way as for other frontends (bridge.method_name(arg1, arg2, ..., callback=cb, errback=eb). Blocking method must be called like async methods due to javascript architecture
- in bridge calls, a callback can now exists without errback
- hard reload on BridgeSignals remote error has been disabled, a better option should be implemented
- use of constants where that make sens, some style improvments
- avatars are temporarily disabled
- lot of code disabled, will be fixed or removed before merge
- various other changes, check diff for more details
server side: manage remote exception on getEntityData, removed getProfileJid call, added getWaitingConf, added getRoomsSubjects
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 24 Jan 2015 01:45:39 +0100 |
parents | b07f0fe2763a |
children | 6016c74ee323 |
comparison
equal
deleted
inserted
replaced
585:bade589dbd5a | 589:a5019e62c3e9 |
---|---|
21 from sat.core.log import getLogger | 21 from sat.core.log import getLogger |
22 log = getLogger(__name__) | 22 log = getLogger(__name__) |
23 | 23 |
24 from sat.core.i18n import _ | 24 from sat.core.i18n import _ |
25 | 25 |
26 from sat_frontends.tools import jid | |
27 | |
26 from pyjamas.ui.SimplePanel import SimplePanel | 28 from pyjamas.ui.SimplePanel import SimplePanel |
27 from pyjamas.ui.HTML import HTML | 29 from pyjamas.ui.HTML import HTML |
28 from pyjamas.ui.Frame import Frame | 30 from pyjamas.ui.Frame import Frame |
29 from pyjamas import Window | 31 from pyjamas import Window |
30 | 32 |
31 from constants import Const as C | 33 from constants import Const as C |
32 import jid | |
33 import file_tools | 34 import file_tools |
34 import xmlui | 35 import xmlui |
35 import panels | 36 import panels |
36 import dialog | 37 import dialog |
37 import contact_group | 38 import contact_group |
95 | 96 |
96 self.add(self.menu_bar) | 97 self.add(self.menu_bar) |
97 | 98 |
98 # General menu | 99 # General menu |
99 def onWebWidget(self): | 100 def onWebWidget(self): |
100 web_panel = panels.WebPanel(self.host, "http://www.goffi.org") | 101 web_widget = self.host.widgets.getOrCreateWidget(panels.WebPanel, C.WEB_PANEL_DEFAULT_URL, profile=C.PROF_KEY_NONE) |
101 self.host.addWidget(web_panel) | 102 self.host.setSelected(web_widget) |
102 self.host.setSelected(web_panel) | |
103 | 103 |
104 def onDisconnect(self): | 104 def onDisconnect(self): |
105 def confirm_cb(answer): | 105 def confirm_cb(answer): |
106 if answer: | 106 if answer: |
107 # FIXME: are we sure the triggers finished their jobs when the backend disconnect? | 107 # FIXME: are we sure the triggers finished their jobs when the backend disconnect? |
122 _dialog.show() | 122 _dialog.show() |
123 | 123 |
124 def onAbout(self): | 124 def onAbout(self): |
125 _about = HTML("""<b>Libervia</b>, a Salut à Toi project<br /> | 125 _about = HTML("""<b>Libervia</b>, a Salut à Toi project<br /> |
126 <br /> | 126 <br /> |
127 You can contact the author at <a href="mailto:goffi@goffi.org">goffi@goffi.org</a><br /> | 127 You can contact the authors at <a href="mailto:contact@salut-a-toi.org">contact@salut-a-toi.org</a><br /> |
128 Blog available (mainly in french) at <a href="http://www.goffi.org" target="_blank">http://www.goffi.org</a><br /> | 128 Blog available (mainly in french) at <a href="http://www.goffi.org" target="_blank">http://www.goffi.org</a><br /> |
129 Project page: <a href="http://sat.goffi.org"target="_blank">http://sat.goffi.org</a><br /> | 129 Project page: <a href="http://salut-a-toi.org"target="_blank">http://salut-a-toi.org</a><br /> |
130 <br /> | 130 <br /> |
131 Any help welcome :) | 131 Any help welcome :) |
132 <p style='font-size:small;text-align:center'>This project is dedicated to Roger Poisson</p> | 132 <p style='font-size:small;text-align:center'>This project is dedicated to Roger Poisson</p> |
133 """) | 133 """) |
134 _dialog = dialog.GenericDialog("About", _about) | 134 _dialog = dialog.GenericDialog("About", _about) |