- Timestamp:
- Dec 4, 2013 2:46:42 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/pjsua2/pjsip-apps/src/pygui/application.py
r4665 r4671 52 52 53 53 # Logger 54 self.logger = log.Logger()54 self.logger = None #log.Logger() 55 55 56 56 # Accounts … … 136 136 # Start polling 137 137 self._onTimer() 138 139 def updateCall(self, acc):140 iid = str(acc.randId)141 for call in acc.callList:142 calliid = str(call.randId)143 uri, status = call.statusText()144 if self.tv.exists(calliid):145 self.tv.item(call.iid, text=uri, values=(status,))146 else:147 call.iid = self.tv.insert(iid, 0, calliid, open=True, text=uri, values=(status,))148 138 149 139 def updateAccount(self, acc): … … 226 216 self.accMenu = tk.Menu(top, tearoff=False) 227 217 # Labels, must match with _onAccContextMenu() 228 labels = [' Call', '-', 'Unregister', 'Reregister', 'Add buddy...', '-',218 labels = ['Unregister', 'Reregister', 'Add buddy...', '-', 229 219 'Online', 'Invisible', 'Away', 'Busy', '-', 230 220 'Settings...', '-', … … 238 228 239 229 # Create Buddy context menu 240 # Labels, must match with _on AccContextMenu()230 # Labels, must match with _onBuddyContextMenu() 241 231 self.buddyMenu = tk.Menu(top, tearoff=False) 242 labels = [' Video call', 'Audio call', 'Send instant message', '-',232 labels = ['Audio call', 'Send instant message', '-', 243 233 'Subscribe', 'Unsubscribe', '-', 244 234 'Settings...', '-', … … 257 247 else: 258 248 self.tv.bind('<3>', self._onTvRightClick) 249 self.tv.bind('<Double-Button-1>', self._onTvDoubleClick) 259 250 260 251 def _getSelectedAccount(self): … … 303 294 self.buddyMenu.post(event.x_root, event.y_root) 304 295 296 def _onTvDoubleClick(self, event): 297 iid = self.tv.identify_row(event.y) 298 if iid: 299 self.tv.selection_set( (iid,) ) 300 acc = self._getSelectedAccount() 301 if acc: 302 self.cfgChanged = False 303 dlg = accountsetting.Dialog(self.master, acc.cfg) 304 if dlg.doModal(): 305 self.updateAccount(acc) 306 acc.modify(acc.cfg) 307 else: 308 bud = self._getSelectedBuddy() 309 acc = bud.account 310 chat = acc.findChat(bud) 311 if not chat: 312 chat = acc.newChat(bud) 313 chat.showWindow() 314 305 315 def _onAccContextMenu(self, label): 306 316 acc = self._getSelectedAccount() … … 308 318 return 309 319 310 if label=='Call': 311 acc.makeCall() 312 elif label=='Unregister': 320 if label=='Unregister': 313 321 acc.setRegistration(False) 314 322 elif label=='Reregister': … … 362 370 acc = bud.account 363 371 364 if label=='Video call': 365 pass 366 elif label=='Audio call': 367 pass 372 if label=='Audio call': 373 chat = acc.findChat(bud) 374 if not chat: chat = acc.newChat(bud) 375 chat.showWindow() 376 chat.startAudio() 368 377 elif label=='Send instant message': 369 pass 378 chat = acc.findChat(bud) 379 if not chat: chat = acc.newChat(bud) 380 chat.showWindow() 370 381 elif label=='Subscribe': 371 382 bud.subscribePresence(True) … … 476 487 477 488 if __name__ == '__main__': 489 print pj 478 490 main()
Note: See TracChangeset
for help on using the changeset viewer.