Пример #1
0
 def close(self, _):
     g_messengerEvents.channels.onMessageReceived -= self.__me_onMessageReceived
     g_messengerEvents.channels.onCommandReceived -= self.__me_onCommandReceived
     g_messengerEvents.users.onUserActionReceived -= self.__me_onUserActionReceived
     g_messengerEvents.onErrorReceived -= self.__me_onErrorReceived
     g_messengerEvents.onWarningReceived -= self.__me_onWarningReceived
     g_settings.onUserPreferencesUpdated -= self.__ms_onUserPreferencesUpdated
     g_settings.onColorsSchemesUpdated -= self.__ms_onColorsSchemesUpdated
     g_settings.resetBattleReceiverIfNeed()
     self.__initialized = 0
     self.__focused = False
     if self.__channelsCtrl is not None:
         self.__channelsCtrl.clear()
         self.__channelsCtrl = None
     removeListener = g_eventBus.removeListener
     removeListener(MessengerEvent.BATTLE_CHANNEL_CTRL_INITED,
                    self.__handleChannelControllerInited,
                    scope=EVENT_BUS_SCOPE.BATTLE)
     removeListener(ChannelManagementEvent.REGISTER_BATTLE,
                    self.__handleRegisterBattleView,
                    scope=EVENT_BUS_SCOPE.BATTLE)
     removeListener(ChannelManagementEvent.UNREGISTER_BATTLE,
                    self.__handleUnregisterBattleView,
                    scope=EVENT_BUS_SCOPE.BATTLE)
     self.__view = lambda: None
     return
Пример #2
0
 def close(self, _):
     g_messengerEvents.channels.onMessageReceived -= self.__me_onMessageReceived
     g_messengerEvents.channels.onCommandReceived -= self.__me_onCommandReceived
     g_messengerEvents.users.onUserActionReceived -= self.__me_onUserActionReceived
     g_messengerEvents.onErrorReceived -= self.__me_onErrorReceived
     g_messengerEvents.onWarningReceived -= self.__me_onWarningReceived
     g_settings.onUserPreferencesUpdated -= self.__ms_onUserPreferencesUpdated
     g_settings.onColorsSchemesUpdated -= self.__ms_onColorsSchemesUpdated
     g_settings.resetBattleReceiverIfNeed()
     self.__initialized = 0
     self.__focused = False
     if self.__channelsCtrl is not None:
         self.__channelsCtrl.clear()
         self.__channelsCtrl = None
     removeListener = g_eventBus.removeListener
     removeListener(MessengerEvent.BATTLE_CHANNEL_CTRL_INITED, self.__handleChannelControllerInited, scope=EVENT_BUS_SCOPE.BATTLE)
     removeListener(ChannelManagementEvent.REGISTER_BATTLE, self.__handleRegisterBattleView, scope=EVENT_BUS_SCOPE.BATTLE)
     removeListener(ChannelManagementEvent.UNREGISTER_BATTLE, self.__handleUnregisterBattleView, scope=EVENT_BUS_SCOPE.BATTLE)
     self.__view = lambda : None
     return