Exemplo n.º 1
0
 def __init__(self, ctx=None):
     super(StrongholdView, self).__init__(ctx)
     self.__browser = None
     self.__hasFocus = False
     self.__browserId = 0
     self.__url = ctx.get('url', getStrongholdUrl())
     return
 def openConfigureWindow(self):
     url = getStrongholdUrl('changeModeUrl')
     title = i18n.makeString(TOOLTIPS.CYBERSPORT_MODECHANGEFROZEN_HEADER)
     windowSize = GUI_SETTINGS.lookup('StrongholdsPopupWebWindowSize')
     browserSize = (windowSize.get('width', 800), windowSize.get('height', 600))
     self.__changeModeBrowserId = yield self.browserCtrl.load(url=url, title=title, browserSize=browserSize, isModal=True, showCreateWaiting=True, handlers=createStrongholdsWebHandlers(), showActionBtn=False)
     browser = self.browserCtrl.getBrowser(self.__changeModeBrowserId)
     if browser:
         browser.ignoreKeyEvents = True
     else:
         self.__changeModeBrowserId = 0
 def __loadBrowser(self, width, height):
     strongholdsTabUrl = getStrongholdUrl('tabUrl')
     if strongholdsTabUrl is not None:
         self.__browserId = yield self.browserCtrl.load(url=strongholdsTabUrl, useBrowserWindow=False, browserSize=(width, height), showBrowserCallback=self.__showBrowser)
         self.__browser = self.browserCtrl.getBrowser(self.__browserId)
         if self.__browser:
             self.__browser.allowRightClick = True
             self.__browser.useSpecialKeys = False
         self.__updateSkipEscape(not self.__hasFocus)
     else:
         LOG_ERROR('Setting "StrongholdsTabUrl" missing!')
     return
Exemplo n.º 4
0
 def __loadBrowser(self, width, height):
     battlesListUrl = getStrongholdUrl('battlesListUrl')
     if battlesListUrl is not None:
         self.__browserId = yield self.browserCtrl.load(
             url=battlesListUrl,
             useBrowserWindow=False,
             showBrowserCallback=self.__showBrowser,
             browserSize=(width, height))
     browser = self.browserCtrl.getBrowser(self.__browserId)
     if browser:
         browser.useSpecialKeys = False
     else:
         LOG_ERROR('Setting "StrongholdsBattlesListUrl" missing!')
     return