Esempio n. 1
0
 def onHandleQueue(self, serverName, queueNumber):
     showAutoSearchBtn = AUTO_LOGIN_QUERY_ENABLED and not self.__autoSearchVisited
     cancelBtnLbl = WAITING.BUTTONS_CANCEL if showAutoSearchBtn else WAITING.BUTTONS_EXITQUEUE
     message = i18n.makeString(WAITING.MESSAGE_QUEUE, serverName,
                               queueNumber)
     if showAutoSearchBtn:
         message = i18n.makeString(WAITING.MESSAGE_USEAUTOSEARCH,
                                   serverName, queueNumber, serverName)
     if not self.__onLoginQueue:
         Waiting.close()
         self.__setLoginQueue(True)
         self.fireEvent(
             LoginEventEx(LoginEventEx.SET_LOGIN_QUEUE, View.alias,
                          WAITING.TITLES_QUEUE, message, cancelBtnLbl,
                          showAutoSearchBtn), EVENT_BUS_SCOPE.LOBBY)
         self.addListener(LoginEventEx.ON_LOGIN_QUEUE_CLOSED,
                          self.__onLoginQueueClosed, EVENT_BUS_SCOPE.LOBBY)
         self.addListener(LoginEventEx.SWITCH_LOGIN_QUEUE_TO_AUTO,
                          self.__onLoginQueueSwitched,
                          EVENT_BUS_SCOPE.LOBBY)
     else:
         ctx = {
             'title': WAITING.TITLES_QUEUE,
             'message': message,
             'cancelLabel': cancelBtnLbl,
             'showAutoLoginBtn': showAutoSearchBtn
         }
         self.fireEvent(
             ArgsEvent(ArgsEvent.UPDATE_ARGS, VIEW_ALIAS.LOGIN_QUEUE, ctx),
             EVENT_BUS_SCOPE.LOBBY)
Esempio n. 2
0
 def _onHandleQueue(self, queueNumber):
     serverName = connectionManager.serverUserName
     showAutoSearchBtn = AUTO_LOGIN_QUERY_ENABLED and not self._autoSearchVisited
     cancelBtnLbl = WAITING.BUTTONS_CANCEL if showAutoSearchBtn else WAITING.BUTTONS_EXITQUEUE
     message = _ms(WAITING.MESSAGE_QUEUE, serverName, queueNumber)
     if showAutoSearchBtn:
         message = _ms(WAITING.MESSAGE_USEAUTOSEARCH, serverName,
                       queueNumber, serverName)
     if not self.__loginQueueDialogShown:
         self._clearLoginView()
         self.__loginQueueDialogShown = True
         self.fireEvent(
             LoginEventEx(LoginEventEx.SET_LOGIN_QUEUE, View.alias,
                          WAITING.TITLES_QUEUE, message, cancelBtnLbl,
                          showAutoSearchBtn), EVENT_BUS_SCOPE.LOBBY)
         self.addListener(LoginEventEx.ON_LOGIN_QUEUE_CLOSED,
                          self._onLoginQueueClosed, EVENT_BUS_SCOPE.LOBBY)
         self.addListener(LoginEventEx.SWITCH_LOGIN_QUEUE_TO_AUTO,
                          self._onLoginQueueSwitched, EVENT_BUS_SCOPE.LOBBY)
     else:
         ctx = {
             'title': WAITING.TITLES_QUEUE,
             'message': message,
             'cancelLabel': cancelBtnLbl,
             'showAutoLoginBtn': showAutoSearchBtn
         }
         self.fireEvent(
             ArgsEvent(ArgsEvent.UPDATE_ARGS, VIEW_ALIAS.LOGIN_QUEUE, ctx),
             EVENT_BUS_SCOPE.LOBBY)
Esempio n. 3
0
 def __showLoginRetryDialog(self, data):
     self._clearLoginView()
     self.fireEvent(
         LoginEventEx(LoginEventEx.SET_AUTO_LOGIN, View.alias,
                      data['waitingOpen'], data['message'],
                      data['waitingClose'], False), EVENT_BUS_SCOPE.LOBBY)
     self.addListener(LoginEventEx.ON_LOGIN_QUEUE_CLOSED,
                      self.__closeLoginRetryDialog, EVENT_BUS_SCOPE.LOBBY)
     self.__loginRetryDialogShown = True
Esempio n. 4
0
 def __setAutoLogin(self, waitingOpen, message, waitingClose):
     Waiting.hide('login')
     if not self.__onLoginQueue:
         self.__setLoginQueue(True)
         self.fireEvent(
             LoginEventEx(LoginEventEx.SET_AUTO_LOGIN, View.alias,
                          waitingOpen, message, waitingClose),
             EVENT_BUS_SCOPE.LOBBY)
         self.addListener(LoginEventEx.ON_LOGIN_QUEUE_CLOSED,
                          self.__onLoginQueueClosed, EVENT_BUS_SCOPE.LOBBY)
Esempio n. 5
0
 def onHandleQueue(self, message):
     if not self.__onLoginQueue:
         Waiting.close()
         self.__setLoginQueue(True)
         self.fireEvent(
             LoginEventEx(LoginEventEx.SET_LOGIN_QUEUE, View.alias,
                          WAITING.TITLES_QUEUE, message,
                          WAITING.BUTTONS_EXITQUEUE), EVENT_BUS_SCOPE.LOBBY)
         self.addListener(LoginEventEx.ON_LOGIN_QUEUE_CLOSED,
                          self.__onLoginQueueClosed, EVENT_BUS_SCOPE.LOBBY)
     else:
         ctx = {
             'title': WAITING.TITLES_QUEUE,
             'message': message,
             'cancelLabel': WAITING.BUTTONS_EXITQUEUE
         }
         self.fireEvent(
             ArgsEvent(ArgsEvent.UPDATE_ARGS, VIEW_ALIAS.LOGIN_QUEUE, ctx),
             EVENT_BUS_SCOPE.LOBBY)
Esempio n. 6
0
 def __windowClosing(self):
     self.fireEvent(
         LoginEventEx(LoginEventEx.ON_LOGIN_QUEUE_CLOSED, '', '', '', '',
                      False), EVENT_BUS_SCOPE.LOBBY)
     connectionManager.disconnect()
     self.destroy()
Esempio n. 7
0
 def onAutoLoginClick(self):
     self.fireEvent(
         LoginEventEx(LoginEventEx.SWITCH_LOGIN_QUEUE_TO_AUTO, '', '', '',
                      '', False), EVENT_BUS_SCOPE.LOBBY)
     connectionManager.disconnect()
     self.destroy()
Esempio n. 8
0
 def __windowClosing(self):
     self.fireEvent(LoginEventEx(LoginEventEx.ON_LOGIN_QUEUE_CLOSED, '', '', '', ''), EVENT_BUS_SCOPE.LOBBY)
     self.app.disconnect(True)
     self.destroy()