Mercurial > libervia-backend
annotate frontends/wix/main_window.py @ 22:bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 01 Dec 2009 04:56:08 +0100 |
parents | 6928e3cb73a8 |
children | 925ab466c5ec |
rev | line source |
---|---|
0 | 1 #!/usr/bin/python |
2 # -*- coding: utf-8 -*- | |
3 | |
4 """ | |
5 wix: a SAT frontend | |
6 Copyright (C) 2009 Jérôme Poisson (goffi@goffi.org) | |
7 | |
8 This program is free software: you can redistribute it and/or modify | |
9 it under the terms of the GNU General Public License as published by | |
10 the Free Software Foundation, either version 3 of the License, or | |
11 (at your option) any later version. | |
12 | |
13 This program is distributed in the hope that it will be useful, | |
14 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 GNU General Public License for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
19 along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 """ | |
21 | |
22 | |
23 import wx | |
24 from chat import Chat | |
25 from param import Param | |
26 import gobject | |
27 import os.path | |
28 import pdb | |
29 from tools.jid import JID | |
30 from logging import debug, info, error | |
31 from quick_frontend.quick_chat_list import QuickChatList | |
32 from quick_frontend.quick_contact_list import QuickContactList | |
33 from quick_frontend.quick_app import QuickApp | |
34 | |
35 | |
36 msgOFFLINE = "offline" | |
37 msgONLINE = "online" | |
38 idCONNECT = 1 | |
1 | 39 idDISCONNECT = 2 |
40 idEXIT = 3 | |
41 idPARAM = 4 | |
42 idADD_CONTACT = 5 | |
43 idREMOVE_CONTACT = 6 | |
0 | 44 const_DEFAULT_GROUP = "Unclassed" |
45 const_STATUS = {"Online":"", | |
46 "Want to discuss":"chat", | |
47 "AFK":"away", | |
48 "Do Not Disturb":"dnd", | |
49 "Away":"xa"} | |
50 | |
51 class ChatList(QuickChatList): | |
52 """This class manage the list of chat windows""" | |
53 | |
54 def __init__(self, host): | |
55 QuickChatList.__init__(self, host) | |
56 | |
57 def createChat(self, name): | |
58 return Chat(name, self.host) | |
59 | |
60 | |
61 | |
62 class ContactList(wx.TreeCtrl, QuickContactList): | |
63 """Customized control to manage contacts.""" | |
64 | |
65 def __init__(self, parent): | |
66 wx.TreeCtrl.__init__(self, parent, style = wx.TR_HIDE_ROOT | wx.TR_HAS_BUTTONS) | |
67 QuickContactList.__init__(self) | |
68 self.jid_ids={} | |
69 self.groups={} | |
70 self.root=self.AddRoot("") | |
71 self.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.onActivated, self) | |
72 | |
73 #icons | |
74 isz = (16,16) | |
75 il = wx.ImageList(isz[0], isz[1]) | |
76 self.icon_online = il.Add(wx.ArtProvider_GetBitmap(wx.ART_TICK_MARK, wx.ART_OTHER, isz)) | |
77 self.icon_unavailable = il.Add(wx.ArtProvider_GetBitmap(wx.ART_CROSS_MARK, wx.ART_OTHER, isz)) | |
78 self.AssignImageList(il) | |
79 | |
80 self.__addNode(const_DEFAULT_GROUP) | |
81 | |
82 def __addNode(self, label): | |
83 """Add an item container""" | |
84 ret=self.AppendItem(self.root, label) | |
85 self.SetPyData(ret, "[node]") | |
86 self.SetItemBold(ret) | |
87 self.groups[label]=ret | |
88 | |
89 def replace(self, jid, name="", show="", status="", group=""): | |
90 debug("status = %s show = %s",status, show) | |
91 if not self.jid_ids.has_key(jid): | |
92 self.add(jid, name, show, status, group) | |
93 else: | |
94 debug ("updating %s",jid) | |
95 self.__presentItem(jid, name, show, status, group) | |
96 | |
97 def __presentItem(self, jid, name, show, status, group): | |
98 """Make a nice presentation of the contact in the list.""" | |
99 id=self.jid_ids[jid] | |
100 label= "%s [%s] \n %s" % ((name or jid), (show or "online"), status) | |
101 self.SetItemText(id, label) | |
102 | |
103 # icon | |
104 if not show or show=="chat": | |
105 self.SetItemImage(id, self.icon_online) | |
106 else: | |
107 self.SetItemImage(id, self.icon_unavailable) | |
108 | |
109 #colour | |
110 if not show: | |
111 self.SetItemTextColour(id, wx.BLACK) | |
112 elif show=="chat": | |
113 self.SetItemTextColour(id, wx.GREEN) | |
114 elif show=="away": | |
115 self.SetItemTextColour(id, wx.BLUE) | |
116 else: | |
117 self.SetItemTextColour(id, wx.RED) | |
118 | |
119 def add(self, jid, name="", show="", status="", group=""): | |
120 """add a contact to the list""" | |
121 debug ("adding %s",jid) | |
122 dest_group=group or const_DEFAULT_GROUP | |
123 if not self.groups.has_key(dest_group): | |
124 self.__addNode(dest_group) | |
125 self.jid_ids[jid]=self.AppendItem(self.groups[dest_group], "") | |
126 self.__presentItem(jid, name, show, status, group) | |
127 self.SetPyData(self.jid_ids[jid], "[contact]"+jid) | |
128 self.EnsureVisible(self.jid_ids[jid]) | |
129 self.Refresh() #FIXME: Best way ? | |
130 | |
131 def remove(self, jid): | |
132 """remove a contact from the list""" | |
133 debug ("removing %s",jid) | |
134 self.Delete(self.jid_ids[jid]) | |
135 del self.jid_ids[jid] | |
136 self.Refresh() #FIXME: Best way ? | |
137 | |
138 def onActivated(self, event): | |
139 """Called when a contact is clicked or activated with keyboard.""" | |
140 if self.GetPyData(event.GetItem()).startswith("[contact]"): | |
141 self.onActivatedCB(self.GetPyData(event.GetItem())[9:]) | |
142 else: | |
143 event.Skip() | |
144 | |
145 def getSelection(self): | |
146 """Return the selected contact, or an empty string if there is not""" | |
147 data = self.GetPyData(self.GetSelection()) | |
148 if not data or not data.startswith("[contact]"): | |
149 return "" | |
150 return JID(data[9:]) | |
151 | |
152 def registerActivatedCB(self, cb): | |
153 """Register a callback with manage contact activation.""" | |
154 self.onActivatedCB=cb | |
155 | |
156 class MainWindow(wx.Frame, QuickApp): | |
157 """main app window""" | |
158 | |
159 def __init__(self): | |
160 wx.Frame.__init__(self,None, title="SAT Wix", size=(400,200)) | |
161 | |
162 | |
163 #Frame elements | |
164 self.contactList = ContactList(self) | |
165 self.contactList.registerActivatedCB(self.onContactActivated) | |
166 self.chat_wins=ChatList(self) | |
167 self.CreateStatusBar() | |
168 self.SetStatusText(msgOFFLINE) | |
169 self.createMenus() | |
170 | |
171 #ToolBar | |
172 self.tools=self.CreateToolBar() | |
173 self.statusBox = wx.ComboBox(self.tools, -1, "Online", choices=const_STATUS.keys(), | |
174 style=wx.CB_DROPDOWN | wx.CB_READONLY) | |
175 self.tools.AddControl(self.statusBox) | |
176 self.tools.AddSeparator() | |
177 self.statusTxt=wx.TextCtrl(self.tools, -1, style = wx.TE_PROCESS_ENTER) | |
178 self.tools.AddControl(self.statusTxt) | |
179 self.Bind(wx.EVT_COMBOBOX, self.onStatusChange, self.statusBox) | |
180 self.Bind(wx.EVT_TEXT_ENTER, self.onStatusChange, self.statusTxt) | |
181 self.tools.Disable() | |
11 | 182 |
183 #tray icon | |
184 ticon = wx.Icon("images/tray_icon.xpm", wx.BITMAP_TYPE_XPM) | |
185 self.tray_icon = wx.TaskBarIcon() | |
186 self.tray_icon.SetIcon(ticon, "Wix jabber client") | |
187 wx.EVT_TASKBAR_LEFT_UP(self.tray_icon, self.onTrayClick) | |
188 | |
0 | 189 |
190 #events | |
191 self.Bind(wx.EVT_CLOSE, self.onClose, self) | |
192 | |
193 QuickApp.__init__(self) | |
194 | |
195 self.Show() | |
196 | |
197 def createMenus(self): | |
198 info("Creating menus") | |
199 connectMenu = wx.Menu() | |
200 connectMenu.Append(idCONNECT, "&Connect CTRL-c"," Connect to the server") | |
1 | 201 connectMenu.Append(idDISCONNECT, "&Disconnect CTRL-d"," Disconnect from the server") |
0 | 202 connectMenu.Append(idPARAM,"&Parameters"," Configure the program") |
203 connectMenu.AppendSeparator() | |
204 connectMenu.Append(idEXIT,"E&xit"," Terminate the program") | |
205 contactMenu = wx.Menu() | |
206 contactMenu.Append(idADD_CONTACT, "&Add contact"," Add a contact to your list") | |
207 contactMenu.Append(idREMOVE_CONTACT, "&Remove contact"," Remove the selected contact from your list") | |
208 menuBar = wx.MenuBar() | |
209 menuBar.Append(connectMenu,"&General") | |
210 menuBar.Append(contactMenu,"&Contacts") | |
211 self.SetMenuBar(menuBar) | |
212 | |
213 #events | |
214 wx.EVT_MENU(self, idCONNECT, self.onConnectRequest) | |
1 | 215 wx.EVT_MENU(self, idDISCONNECT, self.onDisconnectRequest) |
0 | 216 wx.EVT_MENU(self, idPARAM, self.onParam) |
217 wx.EVT_MENU(self, idEXIT, self.onExit) | |
218 wx.EVT_MENU(self, idADD_CONTACT, self.onAddContact) | |
219 wx.EVT_MENU(self, idREMOVE_CONTACT, self.onRemoveContact) | |
220 | |
221 | |
222 def newMessage(self, from_jid, msg, type, to_jid): | |
223 QuickApp.newMessage(self, from_jid, msg, type, to_jid) | |
224 | |
225 def showAlert(self, message): | |
226 # TODO: place this in a separate class | |
227 popup=wx.PopupWindow(self) | |
228 ### following code come from wxpython demo | |
229 popup.SetBackgroundColour("CADET BLUE") | |
230 st = wx.StaticText(popup, -1, message, pos=(10,10)) | |
231 sz = st.GetBestSize() | |
232 popup.SetSize( (sz.width+20, sz.height+20) ) | |
233 x=(wx.DisplaySize()[0]-popup.GetSize()[0])/2 | |
234 popup.SetPosition((x,0)) | |
235 popup.Show() | |
236 wx.CallLater(5000,popup.Destroy) | |
237 | |
238 def showDialog(self, message, title="", type="info"): | |
239 if type == 'info': | |
240 flags = wx.OK | wx.ICON_INFORMATION | |
241 elif type == 'error': | |
242 flags = wx.OK | wx.ICON_ERROR | |
243 elif type == 'question': | |
244 flags = wx.OK | wx.ICON_QUESTION | |
245 else: | |
246 flags = wx.OK | wx.ICON_INFORMATION | |
247 dlg = wx.MessageDialog(self, message, title, flags) | |
248 answer = dlg.ShowModal() | |
249 dlg.Destroy() | |
250 return True if (answer == wx.ID_YES or answer == wx.ID_OK) else False | |
251 | |
252 def setStatusOnline(self, online=True): | |
253 """enable/disable controls, must be called when local user online status change""" | |
254 if online: | |
255 self.SetStatusText(msgONLINE) | |
256 self.tools.Enable() | |
257 else: | |
258 self.SetStatusText(msgOFFLINE) | |
259 self.tools.Disable() | |
260 return | |
261 | |
262 | |
263 def presenceUpdate(self, jabber_id, type, show, status, priority): | |
264 QuickApp.presenceUpdate(self, jabber_id, type, show, status, priority) | |
265 | |
266 def askConfirmation(self, type, id, data): | |
267 #TODO: refactor this in QuickApp | |
268 debug ("Confirmation asked") | |
269 answer_data={} | |
270 if type == "FILE_TRANSFERT": | |
271 debug ("File transfert confirmation asked") | |
272 dlg = wx.MessageDialog(self, "The contact %s wants to send you the file %s\nDo you accept ?" % (data["from"], data["filename"]), | |
273 'File Request', | |
274 wx.YES_NO | wx.ICON_QUESTION | |
275 ) | |
276 answer=dlg.ShowModal() | |
277 if answer==wx.ID_YES: | |
278 filename = wx.FileSelector("Where do you want to save the file ?", flags = wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT) | |
279 if filename: | |
280 answer_data["dest_path"] = filename | |
281 self.bridge.confirmationAnswer(id, True, answer_data) | |
282 self.waitProgress(id, "File Transfer", "Copying %s" % os.path.basename(filename)) | |
283 else: | |
284 answer = wx.ID_NO | |
285 if answer==wx.ID_NO: | |
286 self.bridge.confirmationAnswer(id, False, answer_data) | |
22
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
287 |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
288 dlg.Destroy() |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
289 |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
290 elif type == "YES/NO": |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
291 debug ("Yes/No confirmation asked") |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
292 dlg = wx.MessageDialog(self, data["message"], |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
293 'Confirmation', |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
294 wx.YES_NO | wx.ICON_QUESTION |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
295 ) |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
296 answer=dlg.ShowModal() |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
297 if answer==wx.ID_YES: |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
298 self.bridge.confirmationAnswer(id, True, {}) |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
299 if answer==wx.ID_NO: |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
300 self.bridge.confirmationAnswer(id, False, {}) |
0 | 301 |
302 dlg.Destroy() | |
303 | |
22
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
304 def actionResult(self, type, id, data): |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
305 debug ("actionResult: type = [%s] id = [%s] data =[%s]" % (type, id, data)) |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
306 if type == "SUPPRESS": |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
307 self.current_action_ids.remove(id) |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
308 elif type == "SUCCESS": |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
309 dlg = wx.MessageDialog(self, data["message"], |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
310 'Success', |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
311 wx.OK | wx.ICON_INFORMATION |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
312 ) |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
313 dlg.ShowModal() |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
314 dlg.Destroy() |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
315 elif type == "ERROR": |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
316 dlg = wx.MessageDialog(self, data["message"], |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
317 'Error', |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
318 wx.OK | wx.ICON_ERROR |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
319 ) |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
320 dlg.ShowModal() |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
321 dlg.Destroy() |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
322 else: |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
323 error ("FIXME FIXME FIXME: type [%s] not implemented" % type) |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
324 raise NotImplementedError |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
325 |
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
326 |
0 | 327 |
328 def progressCB(self, id, title, message): | |
329 data = self.bridge.getProgress(id) | |
330 if data: | |
331 if not data['position']: | |
332 data['position'] = '0' | |
333 if not self.pbar: | |
334 #first answer, we must construct the bar | |
335 self.pbar = wx.ProgressDialog(title, message, int(data['size']), None, | |
336 wx.PD_SMOOTH | wx.PD_ELAPSED_TIME | wx.PD_ESTIMATED_TIME | wx.PD_REMAINING_TIME) | |
337 self.pbar.finish_value = int(data['size']) | |
338 | |
339 self.pbar.Update(int(data['position'])) | |
340 elif self.pbar: | |
341 self.pbar.Update(self.pbar.finish_value) | |
342 return | |
343 | |
344 wx.CallLater(10, self.progressCB, id, title, message) | |
345 | |
346 def waitProgress (self, id, title, message): | |
347 self.pbar = None | |
348 wx.CallLater(10, self.progressCB, id, title, message) | |
349 | |
350 | |
351 | |
352 ### events ### | |
353 | |
354 def onContactActivated(self, jid): | |
355 debug ("onContactActivated: %s", jid) | |
356 if self.chat_wins[jid].IsShown(): | |
357 self.chat_wins[jid].Hide() | |
358 else: | |
359 self.chat_wins[jid].Show() | |
360 | |
361 def onConnectRequest(self, e): | |
362 self.bridge.connect() | |
363 | |
1 | 364 def onDisconnectRequest(self, e): |
365 self.bridge.disconnect() | |
366 | |
0 | 367 def __updateStatus(self): |
368 show = const_STATUS[self.statusBox.GetValue()] | |
369 status = self.statusTxt.GetValue() | |
370 self.bridge.setPresence(show=show, status=status) | |
371 | |
372 def onStatusChange(self, e): | |
373 debug("Status change request") | |
374 self.__updateStatus() | |
375 | |
376 def onParam(self, e): | |
377 debug("Param request") | |
22
bb72c29f3432
added action cb mechanism for buttons. Tested with a temporary new user registration button.
Goffi <goffi@goffi.org>
parents:
18
diff
changeset
|
378 param=Param(self) |
0 | 379 |
380 def onExit(self, e): | |
381 self.Close() | |
382 | |
383 def onAddContact(self, e): | |
384 debug("Add contact request") | |
385 dlg = wx.TextEntryDialog( | |
386 self, 'Please enter new contact JID', | |
387 'Adding a contact', 'name@server.ext') | |
388 | |
389 if dlg.ShowModal() == wx.ID_OK: | |
390 jid=JID(dlg.GetValue()) | |
391 if jid.is_valid(): | |
392 self.bridge.addContact(jid.short) | |
393 else: | |
394 error ("'%s' is an invalid JID !", jid) | |
395 #TODO: notice the user | |
396 | |
397 dlg.Destroy() | |
398 | |
399 def onRemoveContact(self, e): | |
400 debug("Remove contact request") | |
401 target = self.contactList.getSelection() | |
402 if not target: | |
403 dlg = wx.MessageDialog(self, "You haven't selected any contact !", | |
404 'Error', | |
405 wx.OK | wx.ICON_ERROR | |
406 ) | |
407 dlg.ShowModal() | |
408 dlg.Destroy() | |
409 return | |
410 | |
411 dlg = wx.MessageDialog(self, "Are you sure you want to delete %s from your roster list ?" % target.short, | |
412 'Contact suppression', | |
413 wx.YES_NO | wx.ICON_QUESTION | |
414 ) | |
415 | |
416 if dlg.ShowModal() == wx.ID_YES: | |
417 info("Unsubsribing %s presence", target.short) | |
418 self.bridge.delContact(target.short) | |
419 | |
420 dlg.Destroy() | |
421 | |
422 def onClose(self, e): | |
423 info("Exiting...") | |
424 e.Skip() | |
11 | 425 |
426 def onTrayClick(self, e): | |
427 debug("Tray Click") | |
428 if self.IsShown(): | |
429 self.Hide() | |
430 else: | |
431 self.Show() | |
432 self.Raise() | |
433 e.Skip() | |
0 | 434 |