def apply_proxy_setting(self): proxy_type = agent.get_prefs('proxy_type') if proxy_type == 'http': proxy_host = agent.get_prefs('proxy_host') proxy_port = agent.get_prefs('proxy_port') proxy_scheme = 'https' if agent.get_prefs('proxy_auth'): auth_user = agent.get_prefs('proxy_auth_name') auth_pass = agent.get_prefs('proxy_auth_password') utils.webkit_set_proxy_uri(proxy_scheme, proxy_host, proxy_port, auth_user, auth_pass) else: utils.webkit_set_proxy_uri(proxy_scheme, proxy_host, proxy_port) elif proxy_type == 'system': if 'HTTP_PROXY' in os.environ and os.environ["HTTP_PROXY"]: url = os.environ["HTTP_PROXY"] elif 'http_proxy' in os.environ and os.environ["http_proxy"]: url = os.environ["http_proxy"] else: url = None utils.webkit_set_proxy_uri(url) elif proxy_type == 'socks': # TODO not implemented yet utils.webkit_set_proxy_uri() else: utils.webkit_set_proxy_uri() # workaround for a BUG of webkitgtk/soupsession # proxy authentication agent.execute_script(''' new Image().src='http://google.com/';''')
def apply_proxy_setting(self): proxy_type = agent.get_prefs('proxy_type') if proxy_type == 'http': proxy_host = agent.get_prefs('proxy_host') proxy_port = agent.get_prefs('proxy_port') proxy_scheme = 'https' if agent.get_prefs('proxy_auth'): auth_user = agent.get_prefs('proxy_auth_name') auth_pass = agent.get_prefs('proxy_auth_password') utils.webkit_set_proxy_uri(proxy_scheme, proxy_host, proxy_port, auth_user, auth_pass) else: utils.webkit_set_proxy_uri(proxy_scheme, proxy_host, proxy_port) elif proxy_type == 'system': if 'HTTP_PROXY' in os.environ and os.environ["HTTP_PROXY"]: url = os.environ["HTTP_PROXY"] elif 'http_proxy' in os.environ and os.environ["http_proxy"]: url = os.environ["http_proxy"] else: url = None utils.webkit_set_proxy_uri(url) elif proxy_type == 'socks': # TODO not implemented yet utils.webkit_set_proxy_uri() else: utils.webkit_set_proxy_uri() # workaround for a BUG of webkitgtk/soupsession # proxy authentication agent.execute_script(''' new Image().src='http://google.com/';''');
def on_mitem_prefs_activate(self, item): agent.execute_script( """ ui.PrefsDlg.load_settings(conf.settings); ui.PrefsDlg.load_prefs(); globals.prefs_dialog.open();""" ) self.window.present()
def apply_proxy_setting(self): if config.settings['use_http_proxy']: proxy_uri = "https://%s:%s" % ( config.settings['http_proxy_host'] , config.settings['http_proxy_port']) if config.settings['http_proxy_host'].startswith('http://'): proxy_uri = "%s:%s" % ( config.settings['http_proxy_host'] , config.settings['http_proxy_port']) utils.webkit_set_proxy_uri(proxy_uri) else: utils.webkit_set_proxy_uri("") # workaround for a BUG of webkitgtk/soupsession # proxy authentication agent.execute_script(''' new Image().src='http://google.com/';''');
def apply_proxy_setting(self): if config.settings['use_http_proxy']: proxy_host = config.settings['http_proxy_host'] proxy_port = config.settings['http_proxy_port'] proxy_scheme = 'https' if config.settings['use_http_proxy_auth']: auth_user = config.settings['http_proxy_auth_name'] auth_pass = config.settings['http_proxy_auth_password'] utils.webkit_set_proxy_uri(proxy_scheme, proxy_host, proxy_port, auth_user, auth_pass) else: utils.webkit_set_proxy_uri(proxy_scheme, proxy_host, proxy_port, '', '') else: utils.webkit_set_proxy_uri('', '', '', '', '') # workaround for a BUG of webkitgtk/soupsession # proxy authentication agent.execute_script(''' new Image().src='http://google.com/';''');
def apply_proxy_setting(self): if config.settings["use_http_proxy"]: proxy_host = config.settings["http_proxy_host"] proxy_port = config.settings["http_proxy_port"] proxy_scheme = "https" if config.settings["use_http_proxy_auth"]: auth_user = config.settings["http_proxy_auth_name"] auth_pass = config.settings["http_proxy_auth_password"] utils.webkit_set_proxy_uri(proxy_scheme, proxy_host, proxy_port, auth_user, auth_pass) else: utils.webkit_set_proxy_uri(proxy_scheme, proxy_host, proxy_port, "", "") else: utils.webkit_set_proxy_uri("", "", "", "", "") # workaround for a BUG of webkitgtk/soupsession # proxy authentication agent.execute_script( """ new Image().src='http://google.com/';""" )
def on_mitem_about_activate(self, item): agent.execute_script('globals.about_dialog.open();'); self.window.present()
def on_mitem_compose(self, item): if self.is_sign_in: agent.execute_script('ui.StatusBox.open();') self.window.present()
def on_mitem_about_activate(self, item): agent.execute_script('ui.DialogHelper.open(ui.AboutDlg);'); self.window.present() pass
def on_mitem_about_activate(self, item): agent.execute_script('globals.about_dialog.open();') self.window.present()
def on_mitem_prefs_activate(self, item): agent.execute_script(''' ui.PrefsDlg.load_settings(conf.settings); ui.PrefsDlg.load_prefs(); globals.prefs_dialog.open();''') self.window.present()