comparison browser_side/panels.py @ 52:4419ef07bb2b

browser side: adding contact, first draft
author Goffi <goffi@goffi.org>
date Fri, 27 May 2011 01:52:29 +0200
parents 9f19e16187ff
children f25c4077f6b9
comparison
equal deleted inserted replaced
51:9f19e16187ff 52:4419ef07bb2b
31 from pyjamas.ui.Grid import Grid 31 from pyjamas.ui.Grid import Grid
32 from pyjamas.ui.DialogBox import DialogBox 32 from pyjamas.ui.DialogBox import DialogBox
33 from pyjamas.ui.AutoComplete import AutoCompleteTextBox 33 from pyjamas.ui.AutoComplete import AutoCompleteTextBox
34 from pyjamas.ui.MenuBar import MenuBar 34 from pyjamas.ui.MenuBar import MenuBar
35 from pyjamas.ui.MenuItem import MenuItem 35 from pyjamas.ui.MenuItem import MenuItem
36 from pyjamas.ui.ListBox import ListBox
36 from pyjamas.ui.Label import Label 37 from pyjamas.ui.Label import Label
37 from pyjamas.ui.TextBox import TextBox 38 from pyjamas.ui.TextBox import TextBox
38 from pyjamas.ui.Button import Button 39 from pyjamas.ui.Button import Button
39 from pyjamas.ui.HTML import HTML 40 from pyjamas.ui.HTML import HTML
40 from pyjamas.ui.Frame import Frame 41 from pyjamas.ui.Frame import Frame
113 _dialog.show() 114 _dialog.show()
114 115
115 #Contact menu 116 #Contact menu
116 def onAddContact(self): 117 def onAddContact(self):
117 """Q&D contact addition""" 118 """Q&D contact addition"""
118 Window.alert("Add contact !") 119 _dialog = None
119 120 edit = TextBox()
120 121
122 def addContactCb(sender):
123 if not edit.getText():
124 Window.alert('You must enter a contact JID')
125 _dialog.show()
126
127 label = Label("new contact identifier (JID):")
128 edit.setText('@libervia.org')
129 edit.setWidth('100%')
130 _dialog = dialog.GroupSelector([label, edit], self.host.contact_panel.getGroups(), [], addContactCb)
131 _dialog.setHTML('<b>Adding contact</b>')
132 _dialog.show()
133
121 #Group menu 134 #Group menu
122 def onJoinRoom(self): 135 def onJoinRoom(self):
123 _dialog = None 136 _dialog = None
124 _edit = None 137 _edit = None
125 138