def getSettingsFromDe(self, link='', just_check=False): cf = path.join(Pds.config_path, 'share/config/kioslaverc') config = Pds.parse(cf, force=True) proxyType = config.value('Proxy Settings/ProxyType').toString() if proxyType: if int(proxyType) > 0: if just_check: return True items = parse_proxy( config.value('Proxy Settings/httpProxy').toString()) self.settings.httpProxy.setText(items['host']) self.settings.httpProxyPort.setValue(int(items['port'])) items = parse_proxy( config.value('Proxy Settings/httpsProxy').toString()) self.settings.httpsProxy.setText(items['host']) self.settings.httpsProxyPort.setValue(int(items['port'])) items = parse_proxy( config.value('Proxy Settings/ftpProxy').toString()) self.settings.ftpProxy.setText(items['host']) self.settings.ftpProxyPort.setValue(int(items['port'])) return True return False
def initialize(self): self.settings.useProxy.setChecked(False) self.settings.useDe.hide() self.clear() proxyInUse = False config = self.iface.getConfig() https = config.get("general", "https_proxy") if https and https != "None": items = parse_proxy(https) self.settings.httpsProxy.setText(items['host']) self.settings.httpsProxyPort.setValue(int(items['port'])) proxyInUse = True ftp = config.get("general", "ftp_proxy") if ftp and ftp != "None": items = parse_proxy(ftp) self.settings.ftpProxy.setText(items['host']) self.settings.ftpProxyPort.setValue(int(items['port'])) proxyInUse = True http = config.get("general", "http_proxy") if http and http != "None": items = parse_proxy(http) self.settings.httpProxy.setText(items['host']) self.settings.httpProxyPort.setValue(int(items['port'])) proxyInUse = True if proxyInUse: self.settings.useProxy.setChecked(True) if items['domain']: self.settings.domainProxy.setText(items['domain']) if items['user']: self.settings.userProxy.setText(items['user']) if items['pass']: self.settings.passwordProxy.setText(items['pass'])
def getSettingsFromDe(self, link = '', just_check = False): cf = path.join(Pds.config_path, 'share/config/kioslaverc') config = Pds.parse(cf, force=True) proxyType = config.value('Proxy Settings/ProxyType').toString() if proxyType: if int(proxyType) > 0: if just_check: return True items = parse_proxy(config.value('Proxy Settings/httpProxy').toString()) self.settings.httpProxy.setText(items['host']) self.settings.httpProxyPort.setValue(int(items['port'])) items = parse_proxy(config.value('Proxy Settings/httpsProxy').toString()) self.settings.httpsProxy.setText(items['host']) self.settings.httpsProxyPort.setValue(int(items['port'])) items = parse_proxy(config.value('Proxy Settings/ftpProxy').toString()) self.settings.ftpProxy.setText(items['host']) self.settings.ftpProxyPort.setValue(int(items['port'])) return True return False