Beispiel #1
0
 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/';''')
Beispiel #2
0
 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/';''');
Beispiel #3
0
 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()
Beispiel #4
0
 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/';''');
Beispiel #5
0
 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/';''');
Beispiel #6
0
 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/';"""
     )
Beispiel #7
0
 def on_mitem_about_activate(self, item):
     agent.execute_script('globals.about_dialog.open();');
     self.window.present()
Beispiel #8
0
 def on_mitem_compose(self, item):
     if self.is_sign_in:
         agent.execute_script('ui.StatusBox.open();')
     self.window.present()
Beispiel #9
0
 def on_mitem_about_activate(self, item):
     agent.execute_script('ui.DialogHelper.open(ui.AboutDlg);');
     self.window.present()
     pass
Beispiel #10
0
 def on_mitem_about_activate(self, item):
     agent.execute_script('globals.about_dialog.open();')
     self.window.present()
Beispiel #11
0
 def on_mitem_compose(self, item):
     if self.is_sign_in:
         agent.execute_script('ui.StatusBox.open();')
     self.window.present()
Beispiel #12
0
 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()