def showPSTNAccessforAccount_(self, account): if account.server.settings_url is None: return self._account = account self.webView.setHidden_(True) self.loadingText.setHidden_(False) self.spinWheel.setHidden_(False) self.spinWheel.startAnimation_(None) self.errorText.setHidden_(True) self.window.setTitle_( NSLocalizedString("Server Tools For %s", "Window title") % self._account.id) query_string = "realm=%s&tab=payments&user_agent=blink" % self._account.id if account.server.settings_url.query: query_string = "%s&%s" % (account.server.settings_url.query, query_string) url = urllib.parse.urlunparse(account.server.settings_url[:4] + (query_string, ) + account.server.settings_url[5:]) url = NSURL.URLWithString_(url) request = NSURLRequest.requestWithURL_cachePolicy_timeoutInterval_( url, NSURLRequestReloadIgnoringLocalAndRemoteCacheData, 15) self.webView.mainFrame().loadRequest_(request) self.window.makeKeyAndOrderFront_(self)
def startLoading(self): self.loading = True self.setTitle() delimiter = '&' if '?' in self.screensharing_url else '?' url = '%s%sfit=1' % (self.screensharing_url, delimiter) if self.screensharing_fit_window else self.screensharing_url url = NSURL.URLWithString_(url) request = NSURLRequest.requestWithURL_cachePolicy_timeoutInterval_(url, NSURLRequestReloadIgnoringLocalAndRemoteCacheData, 15) self.webView.mainFrame().loadRequest_(request)
def viewDidLoad(self): super().viewDidLoad() request = NSURLRequest.requestWithURL_cachePolicy_timeoutInterval_( NSURL.URLWithString_(self.url), NSURLRequestReloadIgnoringLocalCacheData, 3, ) self.webView.loadRequest_(request)
def showSettingsForAccount_(self, account): if account.server.settings_url is None: return query_string = "realm=%s&tab=settings&user_agent=blink" % account.id.domain if account.server.settings_url.query: query_string = "%s&%s" % (account.server.settings_url.query, query_string) url = urlparse.urlunparse(account.server.settings_url[:4] + (query_string,) + account.server.settings_url[5:]) url = NSURL.URLWithString_(url) request = NSURLRequest.requestWithURL_cachePolicy_timeoutInterval_(url, NSURLRequestReloadIgnoringLocalAndRemoteCacheData, 15) self.showAccountRequest(account, request)
def startLoading(self): self.loading = True self.setTitle() delimiter = '&' if '?' in self.screensharing_url else '?' url = '%s%sfit=1' % ( self.screensharing_url, delimiter ) if self.screensharing_fit_window else self.screensharing_url url = NSURL.URLWithString_(url) request = NSURLRequest.requestWithURL_cachePolicy_timeoutInterval_( url, NSURLRequestReloadIgnoringLocalAndRemoteCacheData, 15) self.webView.mainFrame().loadRequest_(request)
def showSettingsForAccount_(self, account): if account.server.settings_url is None: return query_string = "realm=%s&tab=settings&user_agent=blink" % account.id.domain if account.server.settings_url.query: query_string = "%s&%s" % (account.server.settings_url.query, query_string) url = urllib.parse.urlunparse(account.server.settings_url[:4] + (query_string, ) + account.server.settings_url[5:]) url = NSURL.URLWithString_(url) request = NSURLRequest.requestWithURL_cachePolicy_timeoutInterval_( url, NSURLRequestReloadIgnoringLocalAndRemoteCacheData, 15) self.showAccountRequest(account, request)
def showIncomingCall(self, session, url): self._account = session.account self.webView.setHidden_(True) self.loadingText.setHidden_(False) self.spinWheel.setHidden_(False) self.spinWheel.startAnimation_(None) self.errorText.setHidden_(True) self.window.setTitle_("Incoming Call from %s <%s@%s>"%(session.remote_identity.display_name, session.remote_identity.uri.user, session.remote_identity.uri.host)) url = NSURL.URLWithString_(url) request = NSURLRequest.requestWithURL_cachePolicy_timeoutInterval_(url, NSURLRequestReloadIgnoringLocalAndRemoteCacheData, 15) self.webView.mainFrame().loadRequest_(request) self.window.makeKeyAndOrderFront_(self)
def showIncomingCall(self, session, url): self._account = session.account self.webView.setHidden_(True) self.loadingText.setHidden_(False) self.spinWheel.setHidden_(False) self.spinWheel.startAnimation_(None) self.errorText.setHidden_(True) _t = "%s <%s@%s>" % (session.remote_identity.display_name, session.remote_identity.uri.user, session.remote_identity.uri.host) self.window.setTitle_( NSLocalizedString("Incoming Call From %s", "Window title") % _t) url = NSURL.URLWithString_(url) request = NSURLRequest.requestWithURL_cachePolicy_timeoutInterval_( url, NSURLRequestReloadIgnoringLocalAndRemoteCacheData, 15) self.webView.mainFrame().loadRequest_(request) self.window.makeKeyAndOrderFront_(self)
def showPSTNAccessforAccount_(self, account): if account.server.settings_url is None: return self._account = account self.webView.setHidden_(True) self.loadingText.setHidden_(False) self.spinWheel.setHidden_(False) self.spinWheel.startAnimation_(None) self.errorText.setHidden_(True) self.window.setTitle_("%s %s Blink Server Tools"%(self._account.id, unichr(0x2014))) query_string = "realm=%s&tab=payments&user_agent=blink" % self._account.id if account.server.settings_url.query: query_string = "%s&%s" % (account.server.settings_url.query, query_string) url = urlparse.urlunparse(account.server.settings_url[:4] + (query_string,) + account.server.settings_url[5:]) url = NSURL.URLWithString_(url) request = NSURLRequest.requestWithURL_cachePolicy_timeoutInterval_(url, NSURLRequestReloadIgnoringLocalAndRemoteCacheData, 15) self.webView.mainFrame().loadRequest_(request) self.window.makeKeyAndOrderFront_(self)
def requestForURL_(self, url): return NSURLRequest.requestWithURL_cachePolicy_timeoutInterval_( url, self._requestCachePolicy, self._timeout)