Mercurial > libervia-backend
comparison frontends/src/primitivus/chat.py @ 501:e9634d2e7b38
core, quick_frontend, primitivus, wix: Contacts List refactoring phase 1:
- QuickContactManagement is not used anymore and will be removed, ContactList + Core are used instead
- disconnected contacts are now displayed in Primitivus (M-d to show/hide them)
- avatars are temporary unavailable in wix
- new bridge method: getContactsFromGroup
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 25 Sep 2012 00:58:34 +0200 |
parents | 2a072735e459 |
children | f98bef71a918 |
comparison
equal
deleted
inserted
replaced
500:00d3679976ab | 501:e9634d2e7b38 |
---|---|
260 self.host.notify.sendNotification(_("Primitivus: Somebody is talking about you in %s room") % self.target) | 260 self.host.notify.sendNotification(_("Primitivus: Somebody is talking about you in %s room") % self.target) |
261 | 261 |
262 def startGame(self, game_type, referee, players): | 262 def startGame(self, game_type, referee, players): |
263 """Configure the chat window to start a game""" | 263 """Configure the chat window to start a game""" |
264 if game_type=="Tarot": | 264 if game_type=="Tarot": |
265 try: | 265 self.tarot_wid = CardGame(self, referee, players, self.nick) |
266 self.tarot_wid = CardGame(self, referee, players, self.nick) | 266 self.__appendGamePanel(self.tarot_wid) |
267 self.__appendGamePanel(self.tarot_wid) | |
268 except e: | |
269 self.host.debug() | |
270 | 267 |
271 def getGame(self, game_type): | 268 def getGame(self, game_type): |
272 """Return class managing the game type""" | 269 """Return class managing the game type""" |
273 #TODO: check that the game is launched, and manage errors | 270 #TODO: check that the game is launched, and manage errors |
274 if game_type=="Tarot": | 271 if game_type=="Tarot": |
286 self.host.showPopUp(dialog, 80, 80) | 283 self.host.showPopUp(dialog, 80, 80) |
287 | 284 |
288 #MISC EVENTS# | 285 #MISC EVENTS# |
289 def onFileSelected(self, filepath): | 286 def onFileSelected(self, filepath): |
290 self.host.removePopUp() | 287 self.host.removePopUp() |
291 full_jid = self.host.CM.get_full(self.target) | 288 #FIXME: check last_resource: what if self.target.resource exists ? |
289 last_resource = self.host.bridge.getLastResource(unicode(self.target.short), self.host.profile) | |
290 if last_resource: | |
291 full_jid = JID("%s/%s" % (self.target.short, last_resource)) | |
292 else: | |
293 full_jid = self.target | |
292 id = self.host.bridge.sendFile(full_jid, filepath, {}, self.host.profile) | 294 id = self.host.bridge.sendFile(full_jid, filepath, {}, self.host.profile) |
293 self.host.addProgress(id,filepath) | 295 self.host.addProgress(id,filepath) |