annotate src/browser/sat_browser/menu.py @ 676:849ffb24d5bf frontends_multi_profiles

browser side: menus refactorisation: - use of the new quick_frontends.quick_menus module, resulting in a big code simplification in Libervia - menu are added in there respective modules: main menus are done directely in libervia_main, while tarot and radiocol menus are done in game_tarot and game_radiocol - launchAction has the same signature as in QuickApp - base_menu: there are now 2 classes to launch an action: MenuCmd which manage quick_menus classes, and SimpleCmd to launch a generic callback - base_menu: MenuNode has been removed as logic is now in quick_menus - base_menu: GenericMenuBar.update method can be called to fully (re)build the menus - base_widget: removed WidgetSubMenuBar which is no more useful (GenericMenuBar do the same thing) - plugin_menu_context is used in LiberviaWidget and other classes with menus to indicate which menu types must be used - otr menus hooks are temporarily removed, will be fixed soon
author Goffi <goffi@goffi.org>
date Tue, 17 Mar 2015 20:42:02 +0100
parents a8fddccf5b84
children 801eb94aa869
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
ce5b33f499c5 dates update
Goffi <goffi@goffi.org>
parents: 339
diff changeset
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
97c72fe4a5f2 browser_side: import fixes:
Goffi <goffi@goffi.org>
parents: 464
diff changeset
28 import file_tools
97c72fe4a5f2 browser_side: import fixes:
Goffi <goffi@goffi.org>
parents: 464
diff changeset
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
97c72fe4a5f2 browser_side: import fixes:
Goffi <goffi@goffi.org>
parents: 464
diff changeset
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):
147
60ea800b7237 browser side: fixed about menu + updated website URL
Goffi <goffi@goffi.org>
parents: 131
diff changeset
104 _about = HTML("""<b>Libervia</b>, a Salut &agrave; Toi project<br />
78
12680e220b35 browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff changeset
105 <br />
589
a5019e62c3e9 browser side: big refactoring to base Libervia on QuickFrontend, first draft:
Goffi <goffi@goffi.org>
parents: 574
diff changeset
106 You can contact the authors at <a href="mailto:contact@salut-a-toi.org">contact@salut-a-toi.org</a><br />
78
12680e220b35 browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff changeset
107 Blog available (mainly in french) at <a href="http://www.goffi.org" target="_blank">http://www.goffi.org</a><br />
589
a5019e62c3e9 browser side: big refactoring to base Libervia on QuickFrontend, first draft:
Goffi <goffi@goffi.org>
parents: 574
diff changeset
108 Project page: <a href="http://salut-a-toi.org"target="_blank">http://salut-a-toi.org</a><br />
78
12680e220b35 browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff changeset
109 <br />
12680e220b35 browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff changeset
110 Any help welcome :)
12680e220b35 browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff changeset
111 <p style='font-size:small;text-align:center'>This project is dedicated to Roger Poisson</p>
12680e220b35 browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff changeset
112 """)
12680e220b35 browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff changeset
113 _dialog = dialog.GenericDialog("About", _about)
12680e220b35 browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff changeset
114 _dialog.show()
12680e220b35 browser side: refactoring: menu is now in its own module
Goffi <goffi@goffi.org>
parents:
diff changeset
115
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
116 #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
117
391
c86d7a8d2c1e browser_side: added a dialog in Settings/Account to update/delete the XMPP account
souliane <souliane@mailoo.org>
parents: 387
diff changeset
118 def onAccount(self):
467
97c72fe4a5f2 browser_side: import fixes:
Goffi <goffi@goffi.org>
parents: 464
diff changeset
119 def gotUI(xml_ui):
97c72fe4a5f2 browser_side: import fixes:
Goffi <goffi@goffi.org>
parents: 464
diff changeset
120 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
121 return
500
67a4e8383b70 browser side (XMLUI): XMLUI update to follow core changes:
Goffi <goffi@goffi.org>
parents: 498
diff changeset
122 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
123 _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
124 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
125 _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
126 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
127
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
128 def onParameters(self):
467
97c72fe4a5f2 browser_side: import fixes:
Goffi <goffi@goffi.org>
parents: 464
diff changeset
129 def gotParams(xml_ui):
97c72fe4a5f2 browser_side: import fixes:
Goffi <goffi@goffi.org>
parents: 464
diff changeset
130 if not xml_ui:
218
4e6467efd6bf browser_side: small improvements for parameters panel
souliane <souliane@mailoo.org>
parents: 215
diff changeset
131 return
500
67a4e8383b70 browser side (XMLUI): XMLUI update to follow core changes:
Goffi <goffi@goffi.org>
parents: 498
diff changeset
132 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
133 _dialog = dialog.GenericDialog("Parameters", body, options=['NO_CLOSE'])
336
629c99bbd031 browser + server side: refactored menus:
Goffi <goffi@goffi.org>
parents: 300
diff changeset
134 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
135 _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
136 _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
137 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
138
218
4e6467efd6bf browser_side: small improvements for parameters panel
souliane <souliane@mailoo.org>
parents: 215
diff changeset
139 def removeItemParams(self):
4e6467efd6bf browser_side: small improvements for parameters panel
souliane <souliane@mailoo.org>
parents: 215
diff changeset
140 """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
141 self.menu_settings.removeItem(self.item_params)
4e6467efd6bf browser_side: small improvements for parameters panel
souliane <souliane@mailoo.org>
parents: 215
diff changeset
142
152
7e87c87b7952 browser side: temporary avatar upload dialog is added to setting menu
Goffi <goffi@goffi.org>
parents: 148
diff changeset
143 def onAvatarUpload(self):
494
5d8632a7bfde browser_side: refactorisation of menus and LiberviaWidget's header
souliane <souliane@mailoo.org>
parents: 492
diff changeset
144 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
145 _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
146 body.setCloseCb(_dialog.close)
392
f539f6f8ee9c browser_side: standardize the dialogs size and buttons display:
souliane <souliane@mailoo.org>
parents: 391
diff changeset
147 _dialog.setWidth('40%')
152
7e87c87b7952 browser side: temporary avatar upload dialog is added to setting menu
Goffi <goffi@goffi.org>
parents: 148
diff changeset
148 _dialog.show()