comparison libervia.py @ 285:4f0c2fea358a

browser_side (plugin radiocol): use the status label to give more information
author souliane <souliane@mailoo.org>
date Tue, 26 Nov 2013 19:51:02 +0100
parents ae3ec654836d
children 92d76ab67156
comparison
equal deleted inserted replaced
284:bee4719af9b9 285:4f0c2fea358a
367 elif name == 'askConfirmation': 367 elif name == 'askConfirmation':
368 self._askConfirmation(*args) 368 self._askConfirmation(*args)
369 elif name == 'newAlert': 369 elif name == 'newAlert':
370 self._newAlert(*args) 370 self._newAlert(*args)
371 elif name == 'tarotGamePlayers': 371 elif name == 'tarotGamePlayers':
372 self._tarotGameStartedCb(*args, waiting=True) 372 self._tarotGameStartedCb(True, *args)
373 elif name == 'tarotGameStarted': 373 elif name == 'tarotGameStarted':
374 self._tarotGameStartedCb(*args) 374 self._tarotGameStartedCb(False, *args)
375 elif name == 'tarotGameNew' or \ 375 elif name == 'tarotGameNew' or \
376 name == 'tarotGameChooseContrat' or \ 376 name == 'tarotGameChooseContrat' or \
377 name == 'tarotGameShowCards' or \ 377 name == 'tarotGameShowCards' or \
378 name == 'tarotGameInvalidCards' or \ 378 name == 'tarotGameInvalidCards' or \
379 name == 'tarotGameCardsPlayed' or \ 379 name == 'tarotGameCardsPlayed' or \
380 name == 'tarotGameYourTurn' or \ 380 name == 'tarotGameYourTurn' or \
381 name == 'tarotGameScore': 381 name == 'tarotGameScore':
382 self._tarotGameGenericCb(name, args[0], args[1:]) 382 self._tarotGameGenericCb(name, args[0], args[1:])
383 elif name == 'radiocolPlayers': 383 elif name == 'radiocolPlayers':
384 self._radioColStartedCb(*args, waiting=True) 384 self._radioColStartedCb(True, *args)
385 elif name == 'radiocolStarted': 385 elif name == 'radiocolStarted':
386 self._radioColStartedCb(*args) 386 self._radioColStartedCb(False, *args)
387 elif name == 'radiocolPreload': 387 elif name == 'radiocolPreload':
388 self._radioColGenericCb(name, args[0], args[1:]) 388 self._radioColGenericCb(name, args[0], args[1:])
389 elif name == 'radiocolPlay': 389 elif name == 'radiocolPlay':
390 self._radioColGenericCb(name, args[0], args[1:]) 390 self._radioColGenericCb(name, args[0], args[1:])
391 elif name == 'radiocolNoUpload': 391 elif name == 'radiocolNoUpload':
637 def _roomUserLeftCb(self, room_jid_s, user_nick, user_data): 637 def _roomUserLeftCb(self, room_jid_s, user_nick, user_data):
638 for lib_wid in self.libervia_widgets: 638 for lib_wid in self.libervia_widgets:
639 if isinstance(lib_wid, panels.ChatPanel) and lib_wid.type == 'group' and lib_wid.target.bare == room_jid_s: 639 if isinstance(lib_wid, panels.ChatPanel) and lib_wid.type == 'group' and lib_wid.target.bare == room_jid_s:
640 lib_wid.userLeft(user_nick, user_data) 640 lib_wid.userLeft(user_nick, user_data)
641 641
642 def _tarotGameStartedCb(self, room_jid_s, referee, players, waiting=False): 642 def _tarotGameStartedCb(self, waiting, room_jid_s, referee, players):
643 for lib_wid in self.libervia_widgets: 643 for lib_wid in self.libervia_widgets:
644 if isinstance(lib_wid, panels.ChatPanel) and lib_wid.type == 'group' and lib_wid.target.bare == room_jid_s: 644 if isinstance(lib_wid, panels.ChatPanel) and lib_wid.type == 'group' and lib_wid.target.bare == room_jid_s:
645 lib_wid.startGame("Tarot", referee, players, waiting) 645 lib_wid.startGame("Tarot", waiting, referee, players)
646 646
647 def _tarotGameGenericCb(self, event_name, room_jid_s, args): 647 def _tarotGameGenericCb(self, event_name, room_jid_s, args):
648 for lib_wid in self.libervia_widgets: 648 for lib_wid in self.libervia_widgets:
649 if isinstance(lib_wid, panels.ChatPanel) and lib_wid.type == 'group' and lib_wid.target.bare == room_jid_s: 649 if isinstance(lib_wid, panels.ChatPanel) and lib_wid.type == 'group' and lib_wid.target.bare == room_jid_s:
650 getattr(lib_wid.getGame("Tarot"), event_name)(*args) 650 getattr(lib_wid.getGame("Tarot"), event_name)(*args)
651 651
652 def _radioColStartedCb(self, room_jid_s, referee, players, waiting=False): 652 def _radioColStartedCb(self, waiting, room_jid_s, referee, players, queue_data):
653 for lib_wid in self.libervia_widgets: 653 for lib_wid in self.libervia_widgets:
654 if isinstance(lib_wid, panels.ChatPanel) and lib_wid.type == 'group' and lib_wid.target.bare == room_jid_s: 654 if isinstance(lib_wid, panels.ChatPanel) and lib_wid.type == 'group' and lib_wid.target.bare == room_jid_s:
655 lib_wid.startGame("RadioCol", referee, players, waiting) 655 lib_wid.startGame("RadioCol", waiting, referee, players, queue_data)
656 656
657 def _radioColGenericCb(self, event_name, room_jid_s, args): 657 def _radioColGenericCb(self, event_name, room_jid_s, args):
658 for lib_wid in self.libervia_widgets: 658 for lib_wid in self.libervia_widgets:
659 if isinstance(lib_wid, panels.ChatPanel) and lib_wid.type == 'group' and lib_wid.target.bare == room_jid_s: 659 if isinstance(lib_wid, panels.ChatPanel) and lib_wid.type == 'group' and lib_wid.target.bare == room_jid_s:
660 getattr(lib_wid.getGame("RadioCol"), event_name)(*args) 660 getattr(lib_wid.getGame("RadioCol"), event_name)(*args)