Mercurial > libervia-web
annotate src/browser/sat_browser/menu.py @ 684:e876f493dccc
browser_side: follow changes made on quick_frontend for chat states and MUC symbols + minor fixes following the refactorisation:
- some MUC handlers are no more needed, the presence handler is enough
- move the chat states logic to quick_frontend
- display MUC games symbols
- remove classes contact_list.ContactsPanel, contact_panel.Occupant and contact_panel.OccupantsList
- move buildPresenceStyle and setPresenceStyle to html_tools
- fixes games menu callback
author | souliane <souliane@mailoo.org> |
---|---|
date | Wed, 18 Mar 2015 10:17:04 +0100 |
parents | 801eb94aa869 |
children | 9877607c719a |
rev | line source |
---|---|
78
12680e220b35
browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
1 #!/usr/bin/python |
12680e220b35
browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
2 # -*- coding: utf-8 -*- |
12680e220b35
browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
3 |
339
2067d6241927
fixed docstrings wrong usage for licence informations
Goffi <goffi@goffi.org>
parents:
336
diff
changeset
|
4 # Libervia: a Salut à Toi frontend |
340 | 5 # Copyright (C) 2011, 2012, 2013, 2014 Jérôme Poisson <goffi@goffi.org> |
78
12680e220b35
browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
6 |
339
2067d6241927
fixed docstrings wrong usage for licence informations
Goffi <goffi@goffi.org>
parents:
336
diff
changeset
|
7 # This program is free software: you can redistribute it and/or modify |
2067d6241927
fixed docstrings wrong usage for licence informations
Goffi <goffi@goffi.org>
parents:
336
diff
changeset
|
8 # it under the terms of the GNU Affero General Public License as published by |
2067d6241927
fixed docstrings wrong usage for licence informations
Goffi <goffi@goffi.org>
parents:
336
diff
changeset
|
9 # the Free Software Foundation, either version 3 of the License, or |
2067d6241927
fixed docstrings wrong usage for licence informations
Goffi <goffi@goffi.org>
parents:
336
diff
changeset
|
10 # (at your option) any later version. |
78
12680e220b35
browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
11 |
339
2067d6241927
fixed docstrings wrong usage for licence informations
Goffi <goffi@goffi.org>
parents:
336
diff
changeset
|
12 # This program is distributed in the hope that it will be useful, |
2067d6241927
fixed docstrings wrong usage for licence informations
Goffi <goffi@goffi.org>
parents:
336
diff
changeset
|
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
2067d6241927
fixed docstrings wrong usage for licence informations
Goffi <goffi@goffi.org>
parents:
336
diff
changeset
|
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2067d6241927
fixed docstrings wrong usage for licence informations
Goffi <goffi@goffi.org>
parents:
336
diff
changeset
|
15 # GNU Affero General Public License for more details. |
78
12680e220b35
browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
16 |
339
2067d6241927
fixed docstrings wrong usage for licence informations
Goffi <goffi@goffi.org>
parents:
336
diff
changeset
|
17 # You should have received a copy of the GNU Affero General Public License |
2067d6241927
fixed docstrings wrong usage for licence informations
Goffi <goffi@goffi.org>
parents:
336
diff
changeset
|
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
78
12680e220b35
browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
19 |
387
933bce4cb816
browser_side: factorize the code from AvatarUpload to a new class FileUploadPanel
souliane <souliane@mailoo.org>
parents:
377
diff
changeset
|
20 import pyjd # this is dummy in pyjs |
439
d52f529a6d42
browser side: use of new log system (first draft):
Goffi <goffi@goffi.org>
parents:
432
diff
changeset
|
21 from sat.core.log import getLogger |
d52f529a6d42
browser side: use of new log system (first draft):
Goffi <goffi@goffi.org>
parents:
432
diff
changeset
|
22 log = getLogger(__name__) |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
439
diff
changeset
|
23 |
78
12680e220b35
browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
24 from pyjamas.ui.HTML import HTML |
12680e220b35
browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
25 from pyjamas.ui.Frame import Frame |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
439
diff
changeset
|
26 |
494
5d8632a7bfde
browser_side: refactorisation of menus and LiberviaWidget's header
souliane <souliane@mailoo.org>
parents:
492
diff
changeset
|
27 from constants import Const as C |
467 | 28 import file_tools |
29 import xmlui | |
616
1c0d5a87c554
browser_side: add and use method displayWidget to harmonize widget's management in Libervia (not completely done, there are some issues)
souliane <souliane@mailoo.org>
parents:
611
diff
changeset
|
30 import chat |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
439
diff
changeset
|
31 import dialog |
467 | 32 import contact_group |
494
5d8632a7bfde
browser_side: refactorisation of menus and LiberviaWidget's header
souliane <souliane@mailoo.org>
parents:
492
diff
changeset
|
33 import base_menu |
676
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
34 from sat_browser import html_tools |
336
629c99bbd031
browser + server side: refactored menus:
Goffi <goffi@goffi.org>
parents:
300
diff
changeset
|
35 |
629c99bbd031
browser + server side: refactored menus:
Goffi <goffi@goffi.org>
parents:
300
diff
changeset
|
36 |
627
30180021f203
browser_side: fixes MUC menus
souliane <souliane@mailoo.org>
parents:
616
diff
changeset
|
37 unicode = str # FIXME: pyjamas workaround |
30180021f203
browser_side: fixes MUC menus
souliane <souliane@mailoo.org>
parents:
616
diff
changeset
|
38 |
30180021f203
browser_side: fixes MUC menus
souliane <souliane@mailoo.org>
parents:
616
diff
changeset
|
39 |
494
5d8632a7bfde
browser_side: refactorisation of menus and LiberviaWidget's header
souliane <souliane@mailoo.org>
parents:
492
diff
changeset
|
40 class MainMenuBar(base_menu.GenericMenuBar): |
5d8632a7bfde
browser_side: refactorisation of menus and LiberviaWidget's header
souliane <souliane@mailoo.org>
parents:
492
diff
changeset
|
41 """The main menu bar which is displayed on top of the document""" |
78
12680e220b35
browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
42 |
494
5d8632a7bfde
browser_side: refactorisation of menus and LiberviaWidget's header
souliane <souliane@mailoo.org>
parents:
492
diff
changeset
|
43 ITEM_TPL = "<img src='media/icons/menu/%s_menu_red.png' />%s" |
218
4e6467efd6bf
browser_side: small improvements for parameters panel
souliane <souliane@mailoo.org>
parents:
215
diff
changeset
|
44 |
494
5d8632a7bfde
browser_side: refactorisation of menus and LiberviaWidget's header
souliane <souliane@mailoo.org>
parents:
492
diff
changeset
|
45 def __init__(self, host): |
498
60be99de3808
browser_side: menus refactorization + handle levels > 2
souliane <souliane@mailoo.org>
parents:
494
diff
changeset
|
46 styles = {'moved_popup': 'menuLastPopup', 'menu_bar': 'mainMenuBar'} |
60be99de3808
browser_side: menus refactorization + handle levels > 2
souliane <souliane@mailoo.org>
parents:
494
diff
changeset
|
47 base_menu.GenericMenuBar.__init__(self, host, vertical=False, styles=styles) |
494
5d8632a7bfde
browser_side: refactorisation of menus and LiberviaWidget's header
souliane <souliane@mailoo.org>
parents:
492
diff
changeset
|
48 |
5d8632a7bfde
browser_side: refactorisation of menus and LiberviaWidget's header
souliane <souliane@mailoo.org>
parents:
492
diff
changeset
|
49 @classmethod |
676
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
50 def getCategoryHTML(cls, category): |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
51 name = html_tools.html_sanitize(category.name) |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
52 return cls.ITEM_TPL % (category.icon, name) if category.icon is not None else name |
78
12680e220b35
browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
53 |
676
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
54 ## callbacks |
218
4e6467efd6bf
browser_side: small improvements for parameters panel
souliane <souliane@mailoo.org>
parents:
215
diff
changeset
|
55 |
494
5d8632a7bfde
browser_side: refactorisation of menus and LiberviaWidget's header
souliane <souliane@mailoo.org>
parents:
492
diff
changeset
|
56 # General menu |
181
c0b78a3af06d
browser side: web widget first draft
Goffi <goffi@goffi.org>
parents:
165
diff
changeset
|
57 |
158
58442ed28f2b
browser side: basic disconnection management: hard reload is done on empty signal response
Goffi <goffi@goffi.org>
parents:
152
diff
changeset
|
58 def onDisconnect(self): |
58442ed28f2b
browser side: basic disconnection management: hard reload is done on empty signal response
Goffi <goffi@goffi.org>
parents:
152
diff
changeset
|
59 def confirm_cb(answer): |
58442ed28f2b
browser side: basic disconnection management: hard reload is done on empty signal response
Goffi <goffi@goffi.org>
parents:
152
diff
changeset
|
60 if answer: |
665
6a8a1103ad10
browser_side: OTR uses 'profilePlugged', 'disconnect' and 'gotMenus' listeners
souliane <souliane@mailoo.org>
parents:
654
diff
changeset
|
61 self.host.disconnect(C.PROF_KEY_NONE) |
158
58442ed28f2b
browser side: basic disconnection management: hard reload is done on empty signal response
Goffi <goffi@goffi.org>
parents:
152
diff
changeset
|
62 _dialog = dialog.ConfirmDialog(confirm_cb, text="Do you really want to disconnect ?") |
58442ed28f2b
browser side: basic disconnection management: hard reload is done on empty signal response
Goffi <goffi@goffi.org>
parents:
152
diff
changeset
|
63 _dialog.show() |
58442ed28f2b
browser side: basic disconnection management: hard reload is done on empty signal response
Goffi <goffi@goffi.org>
parents:
152
diff
changeset
|
64 |
676
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
65 #Contact menu |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
66 |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
67 def onManageContactGroups(self): |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
68 """Open the contact groups manager.""" |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
69 |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
70 def onCloseCallback(): |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
71 pass |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
72 |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
73 contact_group.ContactGroupEditor(self.host, None, onCloseCallback) |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
74 |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
75 #Group menu |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
76 def onJoinRoom(self): |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
77 |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
78 def invite(room_jid, contacts): |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
79 for contact in contacts: |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
80 self.host.bridge.call('inviteMUC', None, unicode(contact), unicode(room_jid)) |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
81 def join(room_jid, contacts): |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
82 if self.host.whoami: |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
83 nick = self.host.whoami.node |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
84 contact_list = self.host.contact_list |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
85 if room_jid is None or room_jid not in contact_list.getSpecials(C.CONTACT_SPECIAL_GROUP): |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
86 room_jid_s = unicode(room_jid) if room_jid else '' |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
87 self.host.bridge.call('joinMUC', lambda room_jid: invite(room_jid, contacts), room_jid_s, nick) |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
88 else: |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
89 self.host.displayWidget(chat.Chat, room_jid, type_="group", new_tab=room_jid) |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
90 invite(room_jid, contacts) |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
91 |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
92 dialog.RoomAndContactsChooser(self.host, join, ok_button="Join", visible=(True, False)) |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
93 |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
94 # Help menu |
849ffb24d5bf
browser side: menus refactorisation:
Goffi <goffi@goffi.org>
parents:
669
diff
changeset
|
95 |
78
12680e220b35
browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
96 def onSocialContract(self): |
12680e220b35
browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
97 _frame = Frame('contrat_social.html') |
12680e220b35
browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
98 _frame.setStyleName('infoFrame') |
12680e220b35
browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
99 _dialog = dialog.GenericDialog("Contrat Social", _frame) |
12680e220b35
browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
100 _dialog.setSize('80%', '80%') |
12680e220b35
browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
101 _dialog.show() |
12680e220b35
browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
102 |
12680e220b35
browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
103 def onAbout(self): |
683
801eb94aa869
browser side: versions management + version is shown in about dialog
Goffi <goffi@goffi.org>
parents:
676
diff
changeset
|
104 def gotVersions(): |
801eb94aa869
browser side: versions management + version is shown in about dialog
Goffi <goffi@goffi.org>
parents:
676
diff
changeset
|
105 _about = HTML("""<b>Libervia</b>, a Salut à Toi project<br /> |
801eb94aa869
browser side: versions management + version is shown in about dialog
Goffi <goffi@goffi.org>
parents:
676
diff
changeset
|
106 <br /> |
801eb94aa869
browser side: versions management + version is shown in about dialog
Goffi <goffi@goffi.org>
parents:
676
diff
changeset
|
107 Libervia is a web frontend for Salut à Toi<br /> |
801eb94aa869
browser side: versions management + version is shown in about dialog
Goffi <goffi@goffi.org>
parents:
676
diff
changeset
|
108 <span style='font-style: italic;'>SàT version:</span> {sat_version}<br/> |
801eb94aa869
browser side: versions management + version is shown in about dialog
Goffi <goffi@goffi.org>
parents:
676
diff
changeset
|
109 <span style='font-style: italic;'>Libervia version:</span> {libervia_version}<br/> |
801eb94aa869
browser side: versions management + version is shown in about dialog
Goffi <goffi@goffi.org>
parents:
676
diff
changeset
|
110 <br /> |
801eb94aa869
browser side: versions management + version is shown in about dialog
Goffi <goffi@goffi.org>
parents:
676
diff
changeset
|
111 You can contact the authors at <a href="mailto:contact@salut-a-toi.org">contact@salut-a-toi.org</a><br /> |
801eb94aa869
browser side: versions management + version is shown in about dialog
Goffi <goffi@goffi.org>
parents:
676
diff
changeset
|
112 Blog available (mainly in french) at <a href="http://www.goffi.org" target="_blank">http://www.goffi.org</a><br /> |
801eb94aa869
browser side: versions management + version is shown in about dialog
Goffi <goffi@goffi.org>
parents:
676
diff
changeset
|
113 Project page: <a href="http://salut-a-toi.org"target="_blank">http://salut-a-toi.org</a><br /> |
801eb94aa869
browser side: versions management + version is shown in about dialog
Goffi <goffi@goffi.org>
parents:
676
diff
changeset
|
114 <br /> |
801eb94aa869
browser side: versions management + version is shown in about dialog
Goffi <goffi@goffi.org>
parents:
676
diff
changeset
|
115 Any help welcome :) |
801eb94aa869
browser side: versions management + version is shown in about dialog
Goffi <goffi@goffi.org>
parents:
676
diff
changeset
|
116 <p style='font-size:small;text-align:center'>This project is dedicated to Roger Poisson</p> |
801eb94aa869
browser side: versions management + version is shown in about dialog
Goffi <goffi@goffi.org>
parents:
676
diff
changeset
|
117 """.format(sat_version=self.host.sat_version, libervia_version=self.host.libervia_version)) |
801eb94aa869
browser side: versions management + version is shown in about dialog
Goffi <goffi@goffi.org>
parents:
676
diff
changeset
|
118 _dialog = dialog.GenericDialog("About", _about) |
801eb94aa869
browser side: versions management + version is shown in about dialog
Goffi <goffi@goffi.org>
parents:
676
diff
changeset
|
119 _dialog.show() |
801eb94aa869
browser side: versions management + version is shown in about dialog
Goffi <goffi@goffi.org>
parents:
676
diff
changeset
|
120 self.host.getVersions(gotVersions) |
78
12680e220b35
browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff
changeset
|
121 |
148
8635bc9db9bf
added parameter management to test XMLUI, but it's currently deactivated for security reasons (need some configuration options) + separated mainTabPanel CSS from LiberviaTabPanel
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
122 #Settings menu |
8635bc9db9bf
added parameter management to test XMLUI, but it's currently deactivated for security reasons (need some configuration options) + separated mainTabPanel CSS from LiberviaTabPanel
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
123 |
391
c86d7a8d2c1e
browser_side: added a dialog in Settings/Account to update/delete the XMPP account
souliane <souliane@mailoo.org>
parents:
387
diff
changeset
|
124 def onAccount(self): |
467 | 125 def gotUI(xml_ui): |
126 if not xml_ui: | |
391
c86d7a8d2c1e
browser_side: added a dialog in Settings/Account to update/delete the XMPP account
souliane <souliane@mailoo.org>
parents:
387
diff
changeset
|
127 return |
500
67a4e8383b70
browser side (XMLUI): XMLUI update to follow core changes:
Goffi <goffi@goffi.org>
parents:
498
diff
changeset
|
128 body = xmlui.create(self.host, xml_ui) |
464
bea9788f3170
browser and server sides: don't handle the "connectionError" signal anymore, we now use asyncConnect errback:
souliane <souliane@mailoo.org>
parents:
449
diff
changeset
|
129 _dialog = dialog.GenericDialog("Manage your account", body, options=['NO_CLOSE']) |
391
c86d7a8d2c1e
browser_side: added a dialog in Settings/Account to update/delete the XMPP account
souliane <souliane@mailoo.org>
parents:
387
diff
changeset
|
130 body.setCloseCb(_dialog.close) |
c86d7a8d2c1e
browser_side: added a dialog in Settings/Account to update/delete the XMPP account
souliane <souliane@mailoo.org>
parents:
387
diff
changeset
|
131 _dialog.show() |
c86d7a8d2c1e
browser_side: added a dialog in Settings/Account to update/delete the XMPP account
souliane <souliane@mailoo.org>
parents:
387
diff
changeset
|
132 self.host.bridge.call('getAccountDialogUI', gotUI) |
c86d7a8d2c1e
browser_side: added a dialog in Settings/Account to update/delete the XMPP account
souliane <souliane@mailoo.org>
parents:
387
diff
changeset
|
133 |
148
8635bc9db9bf
added parameter management to test XMLUI, but it's currently deactivated for security reasons (need some configuration options) + separated mainTabPanel CSS from LiberviaTabPanel
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
134 def onParameters(self): |
467 | 135 def gotParams(xml_ui): |
136 if not xml_ui: | |
218
4e6467efd6bf
browser_side: small improvements for parameters panel
souliane <souliane@mailoo.org>
parents:
215
diff
changeset
|
137 return |
500
67a4e8383b70
browser side (XMLUI): XMLUI update to follow core changes:
Goffi <goffi@goffi.org>
parents:
498
diff
changeset
|
138 body = xmlui.create(self.host, xml_ui) |
148
8635bc9db9bf
added parameter management to test XMLUI, but it's currently deactivated for security reasons (need some configuration options) + separated mainTabPanel CSS from LiberviaTabPanel
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
139 _dialog = dialog.GenericDialog("Parameters", body, options=['NO_CLOSE']) |
336
629c99bbd031
browser + server side: refactored menus:
Goffi <goffi@goffi.org>
parents:
300
diff
changeset
|
140 body.setCloseCb(_dialog.close) |
148
8635bc9db9bf
added parameter management to test XMLUI, but it's currently deactivated for security reasons (need some configuration options) + separated mainTabPanel CSS from LiberviaTabPanel
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
141 _dialog.setSize('80%', '80%') |
8635bc9db9bf
added parameter management to test XMLUI, but it's currently deactivated for security reasons (need some configuration options) + separated mainTabPanel CSS from LiberviaTabPanel
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
142 _dialog.show() |
8635bc9db9bf
added parameter management to test XMLUI, but it's currently deactivated for security reasons (need some configuration options) + separated mainTabPanel CSS from LiberviaTabPanel
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
143 self.host.bridge.call('getParamsUI', gotParams) |
8635bc9db9bf
added parameter management to test XMLUI, but it's currently deactivated for security reasons (need some configuration options) + separated mainTabPanel CSS from LiberviaTabPanel
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
144 |
218
4e6467efd6bf
browser_side: small improvements for parameters panel
souliane <souliane@mailoo.org>
parents:
215
diff
changeset
|
145 def removeItemParams(self): |
4e6467efd6bf
browser_side: small improvements for parameters panel
souliane <souliane@mailoo.org>
parents:
215
diff
changeset
|
146 """Remove the Parameters item from the Settings menu bar.""" |
4e6467efd6bf
browser_side: small improvements for parameters panel
souliane <souliane@mailoo.org>
parents:
215
diff
changeset
|
147 self.menu_settings.removeItem(self.item_params) |
4e6467efd6bf
browser_side: small improvements for parameters panel
souliane <souliane@mailoo.org>
parents:
215
diff
changeset
|
148 |
152
7e87c87b7952
browser side: temporary avatar upload dialog is added to setting menu
Goffi <goffi@goffi.org>
parents:
148
diff
changeset
|
149 def onAvatarUpload(self): |
494
5d8632a7bfde
browser_side: refactorisation of menus and LiberviaWidget's header
souliane <souliane@mailoo.org>
parents:
492
diff
changeset
|
150 body = file_tools.AvatarUpload() |
152
7e87c87b7952
browser side: temporary avatar upload dialog is added to setting menu
Goffi <goffi@goffi.org>
parents:
148
diff
changeset
|
151 _dialog = dialog.GenericDialog("Avatar upload", body, options=['NO_CLOSE']) |
7e87c87b7952
browser side: temporary avatar upload dialog is added to setting menu
Goffi <goffi@goffi.org>
parents:
148
diff
changeset
|
152 body.setCloseCb(_dialog.close) |
392
f539f6f8ee9c
browser_side: standardize the dialogs size and buttons display:
souliane <souliane@mailoo.org>
parents:
391
diff
changeset
|
153 _dialog.setWidth('40%') |
152
7e87c87b7952
browser side: temporary avatar upload dialog is added to setting menu
Goffi <goffi@goffi.org>
parents:
148
diff
changeset
|
154 _dialog.show() |