def connectionExtended(self): logging.info("connectionExtended") dialogPassword = dialogpassword.dialogPasswordUI(self.configfile) dialogPassword.exec_() result = dialogPassword.getResult() if result is True: password = dialogPassword.getPassword() values = common.readSystem() if "adminPassword" in values: inputpassword = common.convertPassword(password) if values["adminPassword"] == inputpassword: common.enableTabs(self, True) else: common.messageDialog("connectExtendedPasswordError") else: common.enableTabs(self, True)
def configSystem(systemfile): print("read file " + systemfile) values = readParameters(systemfile) networksave = True if "system_networksave" in values: if values["system_networksave"] == "no": networksave = False print("config network") if networksave: # write network if not "network_address" in values: values["network_address"] = "" if not "network_subnetmask" in values: values["network_subnetmask"] = "" if not "network_gateway" in values: values["network_gateway"] = "" if not "network_dns" in values: values["network_dns"] = "" if not "network_wlan_ssid" in values: values["network_wlan_ssid"] = "" if not "network_wlan_password" in values: values["network_wlan_password"] = "" networkvalues = {} networkvalues["connection"] = values["network_interface"] networkvalues["address"] = values["network_address"] networkvalues["subnetmask"] = values["network_subnetmask"] networkvalues["gateway"] = values["network_gateway"] networkvalues["dns"] = values["network_dns"] networkvalues["ssid"] = values["network_wlan_ssid"] networkvalues["password"] = values["network_wlan_password"] if values["network_typ"] == "dhcp": print(" set network") common.networkWriteDHCP(networkvalues) else: print(" set network") common.networkWriteStaticIP(networkvalues) print("OK") print("config vnc") if "system_vnc" in values: print(" set vnc") if values["system_vnc"] == "on": if values["sytem_vnc_password"] != "": common.remoteVNC(True, values["system_vnc_password"]) else: common.remoteVNC(False, None) else: values["system_vnc"] = "off" print("OK") print("config ssh") if "system_ssh" in values: print(" set ssh") if values["system_ssh"] == "on": if values["system_ssh_password"] != "": common.remoteSSH(True, values["system_ssh_password"]) else: common.remoteSSH(False, None) else: values["system_ssh"] = "off" print("OK") # set up config scripts # read system print("config system") systemValues = common.readSystem() if not "startAdmin" in systemValues: systemValues["startAdmin"] = "yes" if not "language" in systemValues: systemValues["language"] = "English" if not "keyboardLayout" in systemValues: systemValues["keyboardLayout"] = "gb" if not "startminimized" in values: systemValues["startMinimized"] = "no" if not "networkSave" in values: systemValues["networkSave"] = "yes" if not "resolution" in values: systemValues["resolution"] = "auto" if not "resolution2" in values: systemValues["resolution2"] = "auto" if "system_admin" in values: systemValues["startAdmin"] = values["system_admin"] if systemValues["startAdmin"] == "no": if "system_admin_password" in values: if values["sytem_admin_password"] != "": systemValues["adminPassword"] = common.convertPassword( values["system_admin_password"]) if "system_language" in values: systemValues["language"] = values["system_language"] if "system_keyboard" in values: systemValues["keyboardLayout"] = values["system_keyboard"] if "system_startminimized" in values: systemValues["startMinimized"] = values["system_startminimized"] if "system_networkSave" in values: systemValues["networkSave"] = values["system_networksave"] if "monitor_resolution" in values: systemValues["resolution"] = values["monitor_resolution"] common.setResolution(values["monitor_resolution"]) if "monitor_resolution2" in values: systemValues["resolution2"] = values["monitor_resolution2"] if "monitor_orientation" in values: common.setMultiMonitor(True, values["monitor_orientation"], values["monitor_resolution2"]) if len(systemValues) > 0: print("set system") common.writeSystem(systemValues) if "system_keyboard" in values: print(" set keyboard") common.writeKeyboardLayout(values["system_keyboard"]) if "monitor_screensaver" in values: print(" set screensaver") common.setScreensaver(values["monitor_screensaver"]) if "monitor_standby" in values: print(" set monitor standby") common.setMonitorStandby(values["monitor_standby"]) if "monitor_resolution" in values: print(" set resolution") common.setResolution(values["monitor_resolution"]) if "system_usbautomount" in values: print(" set usb automount") common.setUSBAutomount(values["system_usbautomount"]) if "system_oneninedesign" in values: print(" set case oneninedesign") common.setOneninedesign(values["system_oneninedesign"]) if "system_argon1" in values: print(" set case argon1") common.setArgon1(values["system_argon1"]) if "system_soundcard" in values: print(" set soundcard") common.setSoundCard(values["system_soundcard"]) print("OK") print("config time") timeValues = common.readTime() if "time_save" in values: timeValues["save"] = values["time_save"] if "time_time" in values: timeValues["time"] = values["time_time"] timeValues["automatic"] = "no" if "time_automatic" in values: timeValues["automatic"] = values["time_automatic"] if "time_ntp" in values: timeValues["ntp"] = values["time_ntp"] if "time_timezone" in values: timeValues["timezone"] = values["time_timezone"] timeValues["execute"] = "no" if "time_execute" in values: timeValues["execute"] = values["time_execute"] timeValues["repeat"] = "no" if "time_repeat" in values: timeValues["repeat"] = values["time_repeat"] if "time_action" in values: timeValues["action"] = values["time_action"] if "time_at" in values: timeValues["at"] = values["time_at"] if "time_last" in values: timeValues["last"] = values["time_last"] if len(timeValues) > 0: print(" set time") common.writeTime(timeValues) timeValues = {} if "time_show" in values: timeValues["show"] = values["time_show"] if len(timeValues) > 0: common.writeTimeTemp(timeValues) print("OK") # write vpn print("config vpn") vpnvalues = {} if "ovpn" in values: vpnvalues["ovpn"] = values["vpn_ovpn"] if "vpn_parameter" in values: vpnvalues["parametervpn"] = values["vpn_parameter"] if "vpn_autostart" in values: vpnvalues["autostartvpn"] = values["vpn_autostart"] if "vpn_systemlogin" in values: vpnvalues["systemlogin"] = values["vpn_systemlogin"] if len(vpnvalues) > 0: print(" set vpn") vpn.writeVPN(vpnvalues) print("OK")
def __init__(self, configfile): super(self.__class__, self).__init__() self.setupUi(self) self.configfile = configfile if self.configfile == "": self.configfile = "thinclient.conf" if not os.path.isfile(self.configfile): print("ERROR: Config file not found: " + self.configfile) sys.exit(1) # logging loggingfilename = common.getRessourceByName(self.configfile, "loggingFile") debugfile = common.getRessourceByName(self.configfile, "debugSwitch") debug = False if os.path.isfile(debugfile): debug = True common.loggingStart(loggingfilename, debug) # init system common.getSystemFile(self.configfile) common.setRessourceFile(self.configfile) systemLanguage = common.getLanguage() # delete existing config file common.deleteConfigScript() # label self.connectButton.setText(common.getRessource("connect")) self.connectButtonCancel.setText( common.getRessource("connectButtonCancel")) self.connectButtonExtended.setText( common.getRessource("connectButtonExtended")) self.systemButtonReboot.setText( common.getRessource("systemButtonReboot")) self.systemButtonShutdown.setText( common.getRessource("systemButtonShutdown")) self.configButtonNew.setText(common.getRessource("configButtonNew")) self.configButtonEdit.setText(common.getRessource("configButtonEdit")) self.configButtonDelete.setText( common.getRessource("configButtonDelete")) self.networkLabelInterface.setText( common.getRessource("networkLabelInterface")) self.networkInputDHCP.setText(common.getRessource("networkInputDHCP")) self.networkInputStaticIP.setText( common.getRessource("networkInputStaticIP")) self.networkLabelAddress.setText( common.getRessource("networkLabelAddress")) self.networkLabelSubnetmask.setText( common.getRessource("networkLabelSubnetmask")) self.networkLabelGateway.setText( common.getRessource("networkLabelGateway")) self.networkLabelDNS.setText(common.getRessource("networkLabelDNS")) self.networkLabelWlanSSID.setText( common.getRessource("networkLabelWlanSSID")) self.networkLabelWlanPassword.setText( common.getRessource("networkLabelWlanPassword")) self.networkButtonTransfer.setText( common.getRessource("networkButtonTransfer")) self.systemButtonTerminal.setText( common.getRessource("systemButtonTerminal")) self.systemLabelLanguage.setText( common.getRessource("systemLabelLanguage")) self.systemLabelKeyboardLayout.setText( common.getRessource("systemLabelKeyboardLayout")) self.systemInputStartAdmin.setText( common.getRessource("systemStartAdmin")) self.systemLabelPassword.setText( common.getRessource("systemLabelPassword")) self.systemLabelPasswordRepeat.setText( common.getRessource("systemLabelPasswordRepeat")) self.systemInputRemoteVNC.setText( common.getRessource("systemInputRemoteVNC")) self.systemLabelRemotePassword.setText( common.getRessource("systemLabelRemotePassword")) self.systemLabelRemotePasswordRepeat.setText( common.getRessource("systemLabelRemotePasswordRepeat")) self.systemInputSSH.setText(common.getRessource("systemInputSSH")) self.systemInputUSBAutomount.setText( common.getRessource("systemInputUSBAutomount")) self.systemInputOneninedesign.setText( common.getRessource("systemInputOneninedesign")) self.systemInputArgon1.setText( common.getRessource("systemInputArgon1")) self.systemButtonAssume.setText( common.getRessource("systemButtonAssume")) self.systemInputScreensaver.setText( common.getRessource("systemScreensaver")) self.systemInputMonitorStandby.setText( common.getRessource("systemMonitorStandby")) self.systemLabelResolution.setText( common.getRessource("systemLabelResolution")) #self.systemMonitorGroupBox.setTitle(common.getRessource( # "systemMonitorGroupBox")) self.vpnLabelovpn.setText(common.getRessource("vpnLabelovpn")) self.vpnInputSystemLogin.setText( common.getRessource("configDialogLabelSystemLogin")) self.vpnInputAutostart.setText( common.getRessource("configDialogLabelAutostart")) self.vpnButtonConnect.setText(common.getRessource("vpnButtonConnect")) self.vpnButtonCancel.setText(common.getRessource("vpnButtonCancel")) self.vpnLabelParameter.setText( common.getRessource("configDialogLabelParameter")) self.vpnButtonTransfer.setText( common.getRessource("networkButtonTransfer")) self.vpnButtonCondition.setText( common.getRessource("vpnButtonCondition")) self.vpnButtonCondition.setIcon( QtGui.QIcon(common.getRessource("disconnectIcon"))) self.vpnButtonFiles.setText( common.getRessource("vpnButtonAdditionalFiles")) pixmap = QPixmap(common.getRessource("connectIcon")) self.systemLabelInfoImage.setPixmap(pixmap) self.thinClientTab.setTabText(0, common.getRessource("tabConnect")) self.thinClientTab.setTabText(1, common.getRessource("tabSystem")) self.thinClientTab.setTabText(2, common.getRessource("tabConfig")) self.thinClientTab.setTabText(3, common.getRessource("tabNetwork")) self.thinClientTab.setTabText(4, common.getRessource("tabVPN")) self.thinClientTab.setTabText(5, common.getRessource("tabSystem")) # widget actions self.connectButton.clicked.connect(self.connection) self.connectButtonCancel.clicked.connect(self.connectionCancel) self.connectButtonExtended.clicked.connect(self.connectionExtended) self.configButtonNew.clicked.connect(self.configNewConnection) self.configButtonEdit.clicked.connect(self.configEdit) self.configButtonDelete.clicked.connect(self.configDelete) self.networkInputDHCP.toggled.connect(self.networkType) self.networkInputStaticIP.toggled.connect(self.networkType) self.networkButtonTransfer.clicked.connect(self.networkTransfer) self.systemButtonReboot.clicked.connect(self.systemReboot) self.systemButtonShutdown.clicked.connect(self.systemShutdown) self.connectList.doubleClicked.connect(self.connection) self.configList.doubleClicked.connect(self.configListItem) self.systemButtonTerminal.clicked.connect(self.systemTerminal) self.systemButtonAssume.clicked.connect(self.systemAssume) self.vpnButtonFile.clicked.connect(self.vpnGetFile) self.vpnButtonTransfer.clicked.connect(self.vpnTransfer) self.vpnButtonConnect.clicked.connect(self.vpnConnect) self.vpnButtonCancel.clicked.connect(self.vpnCancel) self.vpnButtonCondition.clicked.connect(self.vpnCondition) self.vpnButtonFiles.clicked.connect(self.vpnAdditionalFiles) self.systemInputArgon1.toggled.connect(self.systemCaseArgon1) self.systemInputOneninedesign.toggled.connect( self.systemCaseOneninedesign) # get system #system = common.runProgramResult(common.getRessource("commandGetSystem")) system = common.getSystem() if system != "PI4": self.systemInputArgon1.setEnabled(False) self.systemInputOneninedesign.setEnabled(False) # read network interfaces = common.readConnectionInterfaces() for interface in interfaces: self.networkInputInterface.addItem(interface) for interface in interfaces: if common.isNetworkInterfaceUp(interface): index = self.networkInputInterface.findText( interface, QtCore.Qt.MatchFixedString) self.networkInputInterface.setCurrentIndex(index) values = common.readNetwork(self) dhcp = True if "dhcp" in values: dhcp = values["dhcp"] if "address" in values: self.networkInputAddress.setText(values["address"]) if "netmask" in values: self.networkInputSubnetmask.setText(values["netmask"]) if "gateway" in values: self.networkInputGateway.setText(values["gateway"]) if "dns" in values: self.networkInputDNS.setText(values["dns"]) if "ssid" in values: self.networkInputWlanSSID.setText(values["ssid"]) if "password" in values: self.networkInputWlanPassword.setText(values["password"]) if dhcp: self.networkInputDHCP.setChecked(True) self.networkInputStaticIP.setChecked(False) else: self.networkInputDHCP.setChecked(False) self.networkInputStaticIP.setChecked(True) # fill ComboBox with connection types common.fillComboBox(self, "configConnectionType", self.configInputConnectionType) # Get Language common.fillComboBox(self, "language", self.systemInputLanguage) if systemLanguage == "DE": language = "Deutsch" index = self.systemInputLanguage.findText( language, QtCore.Qt.MatchFixedString) self.systemInputLanguage.setCurrentIndex(index) # Get Keyboard Layout values = common.getKeyboardLayouts() common.fillComboBoxList(self, values, self.systemInputKeyboardLayout) layout = common.getCurrentKeyboardLayout() index = self.systemInputKeyboardLayout.findText( layout, QtCore.Qt.MatchFixedString) if index >= 0: self.systemInputKeyboardLayout.setCurrentIndex(index) # Check VNC if common.isRemoteVNC(): self.systemInputRemoteVNC.setChecked(True) # Check SSH if common.isRemoteSSH(): self.systemInputSSH.setChecked(True) # check USB automount if common.isUSBAutomount(): self.systemInputUSBAutomount.setChecked(True) # hide tabs when in user mode startadmin = True autostartvpn = False values = common.readSystem() if "startAdmin" in values: if values["startAdmin"] == "yes": self.systemInputStartAdmin.setChecked(True) if values["startAdmin"] == "no": startadmin = False if not "adminPassword" in values: startadmin = True if "adminPassword" in values: if values["adminPassword"] == "": startadmin = True values = vpn.readVPN(self) if "ovpn" in values: self.vpnInputovpn.setText(values["ovpn"]) if "parametervpn" in values: self.vpnInputParameter.setText(values["parametervpn"]) if "systemlogin" in values: if values["systemlogin"] == "yes": self.vpnInputSystemLogin.setChecked(True) if "autostartvpn" in values: if values["autostartvpn"] == "yes": self.vpnInputAutostart.setChecked(True) autostartvpn = True if startadmin is True: self.connectButtonExtended.setEnabled(False) else: common.enableTabs(self, False) # get screensaver state if common.isScreensaver(): self.systemInputScreensaver.setChecked(True) else: self.systemInputScreensaver.setChecked(False) # get monitor standby state if common.isMonitorStandby(): self.systemInputMonitorStandby.setChecked(True) else: self.systemInputMonitorStandby.setChecked(False) # get state Oneninedesign power case if common.isOneninedesign(): self.systemInputOneninedesign.setChecked(True) else: self.systemInputOneninedesign.setChecked(False) # get state Argop1 power case if common.isArgon1(): self.systemInputArgon1.setChecked(True) else: self.systemInputArgon1.setChecked(False) # set title self.setWindowTitle(common.getRessource("dialogTitle")) # Select first Tab self.thinClientTab.setCurrentIndex(0) # start vpn connection if autostartvpn: parameter = None systemlogin = None if "parametervpn" in values: parameter = values["paramtervpn"] systemlogin = None if "systemlogin" in values: systemlogin = values["systemlogin"] vpn.autostartvpn(self, values["ovpn"], parameter, systemlogin) # autostart connections self.autostart() # read existing connections self.fillListWidgets() # get resolution resolution = common.getResolution() self.systemInputResolution.setText(resolution)
def __init__(self, configfile): super(self.__class__, self).__init__() self.setupUi(self) self.configfile = configfile if self.configfile == "": self.configfile = "thinclient.conf" if not os.path.isfile(self.configfile): print("ERROR: Config file not found: " + self.configfile) sys.exit(1) # logging loggingfilename = common.getRessourceByName(self.configfile, "loggingFileThinclient") debugfile = common.getRessourceByName(self.configfile, "debugSwitch") debug = False if os.path.isfile(debugfile): debug = True common.loggingStart(loggingfilename, debug) # init system common.getSystemFile(self.configfile) common.setRessourceFile(self.configfile) systemLanguage = common.getLanguage() # delete connection log file common.deleteConnectionLog() # delete existing config file common.deleteConfigScript() # label self.connectButton.setText(common.getRessource("connect")) self.connectButtonCancel.setText( common.getRessource("connectButtonCancel")) self.connectButtonExtended.setText( common.getRessource("connectButtonExtended")) self.systemButtonReboot.setText( common.getRessource("systemButtonReboot")) self.systemButtonShutdown.setText( common.getRessource("systemButtonShutdown")) self.connectButtonLog.setText(common.getRessource("connectButtonLog")) self.configButtonNew.setText(common.getRessource("configButtonNew")) self.configButtonEdit.setText(common.getRessource("configButtonEdit")) self.configButtonDelete.setText( common.getRessource("configButtonDelete")) self.networkInputSave.setText(common.getRessource("networkInputSave")) self.networkLabelInterface.setText( common.getRessource("networkLabelInterface")) self.networkInputDHCP.setText(common.getRessource("networkInputDHCP")) self.networkInputStaticIP.setText( common.getRessource("networkInputStaticIP")) self.networkLabelAddress.setText( common.getRessource("networkLabelAddress")) self.networkLabelSubnetmask.setText( common.getRessource("networkLabelSubnetmask")) self.networkLabelGateway.setText( common.getRessource("networkLabelGateway")) self.networkLabelDNS.setText(common.getRessource("networkLabelDNS")) self.networkLabelWlanSSID.setText( common.getRessource("networkLabelWlanSSID")) self.networkInputSearchSSID.setText( common.getRessource("networkInputSearchSSID")) self.networkLabelWlanPassword.setText( common.getRessource("networkLabelWlanPassword")) self.systemButtonTerminal.setText( common.getRessource("systemButtonTerminal")) self.systemInputMinimize.setText( common.getRessource("systemInputMinimize")) self.systemLabelLanguage.setText( common.getRessource("systemLabelLanguage")) self.systemLabelKeyboardLayout.setText( common.getRessource("systemLabelKeyboardLayout")) self.systemInputStartAdmin.setText( common.getRessource("systemStartAdmin")) self.systemLabelPassword.setText( common.getRessource("systemLabelPassword")) self.systemLabelPasswordRepeat.setText( common.getRessource("systemLabelPasswordRepeat")) self.systemInputRemoteVNC.setText( common.getRessource("systemInputRemoteVNC")) self.systemLabelRemotePassword.setText( common.getRessource("systemLabelRemotePassword")) self.systemLabelRemotePasswordRepeat.setText( common.getRessource("systemLabelRemotePasswordRepeat")) self.systemInputSSH.setText(common.getRessource("systemInputSSH")) self.systemLabelsshPassword.setText( common.getRessource("systemLabelsshPassword")) self.systemLabelsshPasswordRepeat.setText( common.getRessource("systemLabelsshPasswordRepeat")) self.systemInputUSBAutomount.setText( common.getRessource("systemInputUSBAutomount")) self.systemInputOneninedesign.setText( common.getRessource("systemInputOneninedesign")) self.systemInputArgon1.setText( common.getRessource("systemInputArgon1")) self.systemInputScreensaver.setText( common.getRessource("systemScreensaver")) self.systemInputMonitorStandby.setText( common.getRessource("systemMonitorStandby")) self.systemLabelResolution.setText( common.getRessource("systemLabelResolution")) self.systemLabelResolution2.setText( common.getRessource("systemLabelResolution2")) self.vpnLabelovpn.setText(common.getRessource("vpnLabelovpn")) self.vpnInputSystemLogin.setText( common.getRessource("configDialogLabelSystemLogin")) self.vpnInputAutostart.setText( common.getRessource("configDialogLabelAutostart")) self.vpnButtonConnect.setText(common.getRessource("vpnButtonConnect")) self.vpnButtonCancel.setText(common.getRessource("vpnButtonCancel")) self.vpnLabelParameter.setText( common.getRessource("configDialogLabelParameter")) self.vpnButtonCondition.setText( common.getRessource("vpnButtonCondition")) self.vpnButtonCondition.setIcon( QtGui.QIcon(common.getRessource("disconnectIcon"))) self.vpnButtonFiles.setText( common.getRessource("vpnButtonAdditionalFiles")) self.vpnButtonDelete.setText(common.getRessource("vpnButtonDelete")) self.saveButtonSave.setText(common.getRessource("saveButtonSave")) self.systemLabelSound.setText(common.getRessource("systemLabelSound")) self.systemInputMultiMonitorLeft.setText( common.getRessource("systemInputMultiMonitorLeft")) self.systemInputMultiMonitorRight.setText( common.getRessource("systemInputMultiMonitorRight")) self.systemInputMultiMonitorAbove.setText( common.getRessource("systemInputMultiMonitorAbove")) self.systemInputMultiMonitorBelow.setText( common.getRessource("systemInputMultiMonitorBelow")) self.timeInputSave.setText(common.getRessource("timeInputSave")) self.timeInputAuto.setText(common.getRessource("timeInputAuto")) self.timeInputView.setText(common.getRessource("timeInputView")) self.timeLabelTime.setText(common.getRessource("timeLabelTime")) self.timeLabelNTP.setText(common.getRessource("timeLabelNTP")) self.timeLabelActionGroup.setTitle( common.getRessource("timeLabelActionGroup")) self.timeInputAction.setText(common.getRessource("timeInputAction")) self.timeLabelActionAction.setText( common.getRessource("timeLabelActionAction")) self.timeLabelActionTime.setText( common.getRessource("timeLabelActionTime")) self.timeInputActionRepeat.setText( common.getRessource("timeInputActionRepeat")) self.timeLabelActionLast.setText( common.getRessource("timeLabelActionLast")) self.timeLabelTimezone.setText( common.getRessource("timeLabelTimezone")) self.timeInputTime.setDisplayFormat("yyyy-MM-dd HH:mm") # get current time and show self.timeInputTime.setDateTime(QtCore.QDateTime.currentDateTime()) pixmap = QPixmap(common.getRessource("connectIcon")) self.systemLabelInfoImage.setPixmap(pixmap) self.thinClientTab.setTabText(0, common.getRessource("tabConnect")) self.thinClientTab.setTabText(1, common.getRessource("tabSystem")) self.thinClientTab.setTabText(2, common.getRessource("tabConfig")) self.thinClientTab.setTabText(3, common.getRessource("tabNetwork")) self.thinClientTab.setTabText(4, common.getRessource("tabVPN")) self.thinClientTab.setTabText(5, common.getRessource("tabSystem")) self.thinClientTab.setTabText(6, common.getRessource("tabHardware")) self.thinClientTab.setTabText(7, common.getRessource("tabMonitor")) self.thinClientTab.setTabText(8, common.getRessource("tabTime")) self.thinClientTab.setTabText(9, common.getRessource("tabSave")) # widget actions self.connectButton.clicked.connect(self.connection) self.connectButtonCancel.clicked.connect(self.connectionCancel) self.connectButtonExtended.clicked.connect(self.connectionExtended) self.configButtonNew.clicked.connect(self.configNewConnection) self.configButtonEdit.clicked.connect(self.configEdit) self.configButtonDelete.clicked.connect(self.configDelete) self.networkInputDHCP.toggled.connect(self.networkType) self.networkInputStaticIP.toggled.connect(self.networkType) self.systemButtonReboot.clicked.connect(self.systemReboot) self.systemButtonShutdown.clicked.connect(self.systemShutdown) self.connectButtonLog.clicked.connect(self.connectionLog) self.connectList.doubleClicked.connect(self.connection) self.configList.doubleClicked.connect(self.configListItem) self.systemButtonTerminal.clicked.connect(self.systemTerminal) self.vpnButtonFile.clicked.connect(self.vpnGetFile) self.vpnButtonDelete.clicked.connect(self.vpnDeleteFile) self.vpnButtonConnect.clicked.connect(self.vpnConnect) self.vpnButtonCancel.clicked.connect(self.vpnCancel) self.vpnButtonCondition.clicked.connect(self.vpnCondition) self.vpnButtonFiles.clicked.connect(self.vpnAdditionalFiles) self.systemInputArgon1.toggled.connect(self.systemCaseArgon1) self.systemInputOneninedesign.toggled.connect( self.systemCaseOneninedesign) self.saveButtonSave.clicked.connect(self.save) self.systemInputRemotePassword.textChanged.connect( self.remotePasswordChanged) self.systemInputPassword.textChanged.connect(self.passwordChanged) self.systemInputsshPassword.textChanged.connect( self.sshPasswordChanged) self.networkInputSearchSSID.clicked.connect(self.searchSSID) # read network interfaces = common.readConnectionInterfaces() for interface in interfaces: self.networkInputInterface.addItem(interface) for interface in interfaces: if common.isNetworkInterfaceUp(interface): index = self.networkInputInterface.findText( interface, QtCore.Qt.MatchFixedString) self.networkInputInterface.setCurrentIndex(index) # get wlan devices self.searchSSID() values = common.readNetwork(self) if len(values) == 0: self.networkInputSave.setChecked(True) dhcp = True if "dhcp" in values: dhcp = values["dhcp"] if "address" in values: self.networkInputAddress.setText(values["address"]) if "netmask" in values: self.networkInputSubnetmask.setText(values["netmask"]) if "gateway" in values: self.networkInputGateway.setText(values["gateway"]) if "dns" in values: self.networkInputDNS.setText(values["dns"]) if "ssid" in values: index = self.networkInputWlanSSID.findText( values["ssid"], QtCore.Qt.MatchFixedString) if index >= 0: self.networkInputWlanSSID.setCurrentIndex(index) else: if values["ssid"] != "": self.networkInputWlanSSID.addItem(values["ssid"]) if "password" in values: self.networkInputWlanPassword.setText(values["password"]) if dhcp: self.networkInputDHCP.setChecked(True) self.networkInputStaticIP.setChecked(False) else: self.networkInputDHCP.setChecked(False) self.networkInputStaticIP.setChecked(True) # fill ComboBox with connection types common.fillComboBox(self, "configConnectionType", self.configInputConnectionType) # Get Language common.fillComboBox(self, "language", self.systemInputLanguage) if systemLanguage == "DE": language = "Deutsch" index = self.systemInputLanguage.findText( language, QtCore.Qt.MatchFixedString) self.systemInputLanguage.setCurrentIndex(index) # Get Keyboard Layout values = common.getKeyboardLayouts() common.fillComboBoxList(self, values, self.systemInputKeyboardLayout) layout = common.getCurrentKeyboardLayout() index = self.systemInputKeyboardLayout.findText( layout, QtCore.Qt.MatchFixedString) if index >= 0: self.systemInputKeyboardLayout.setCurrentIndex(index) # Get Resolution List resolution, resolution2 = common.getResolutionList() common.fillComboBoxList(self, resolution, self.systemInputResolution) common.fillComboBoxList(self, resolution2, self.systemInputResolution2) # get orientation orientation = common.getOrientationMonitor2() if orientation == "left": self.systemInputMultiMonitorLeft.setChecked(True) if orientation == "right": self.systemInputMultiMonitorRight.setChecked(True) if orientation == "above": self.systemInputMultiMonitorAbove.setChecked(True) if orientation == "below": self.systemInputMultiMonitorBelow.setChecked(True) # Check VNC if common.isRemoteVNC(): self.systemInputRemoteVNC.setChecked(True) # Check SSH if common.isRemoteSSH(): self.systemInputSSH.setChecked(True) self.systemInputsshPassword.setText("1111111111") # check USB automount if common.isUSBAutomount(): self.systemInputUSBAutomount.setChecked(True) # set time parameter if common.isDateShow(): self.timeInputView.setChecked(True) # list time zones values = common.getTimezones() common.fillComboBoxList(self, values, self.timeInputTimezone) # fill action common.fillComboBox(self, "timeActions", self.timeInputActionAction) # is date and time showing? value = common.isDateShow() if value: self.timeInputView.setChecked(True) # get time parameter timeValues = common.readTime() for value in timeValues: if "save" in value: if timeValues["save"] == "no": self.timeInputSave.setChecked(True) if "automatic" in value: if timeValues["automatic"] == "yes": self.timeInputAuto.setChecked(True) if "ntp" in value: self.timeInputNTP.setText(timeValues["ntp"]) if "zone" in value: index = self.timeInputTimezone.findText( timeValues["zone"], QtCore.Qt.MatchFixedString) if index < 0: index = 0 self.timeInputTimezone.setCurrentIndex(index) if "time" in value: time = datetime.strptime(timeValues["time"], "%Y-%m-%d %H:%M") self.timeInputTime.setDateTime(time) if "execute" in value: if timeValues["execute"] == "yes": self.timeInputAction.setChecked(True) if "repeat" in value: if timeValues["repeat"] == "yes": self.timeInputActionRepeat.setChecked(True) if "action" in value: index = self.timeInputActionAction.findText( timeValues["action"], QtCore.Qt.MatchFixedString) self.timeInputActionAction.setCurrentIndex(index) if "execat" in value: if timeValues["execat"].startswith("+"): self.timeInputActionTime.setText(timeValues["execat"]) else: if timeValues["execat"] != "": time = datetime.strptime(timeValues["execat"], "%Y-%m-%d %H:%M") strtime = time.strftime("%Y-%m-%d %H:%M") self.timeInputActionTime.setText(strtime) if "last" in value: self.timeInputActionLast.setText(timeValues["last"]) # hide tabs when in user mode startadmin = True autostartvpn = False values = common.readSystem() self.systemInputStartAdmin.setChecked(True) if "startAdmin" in values: if values["startAdmin"] == "no": startadmin = False self.systemInputStartAdmin.setChecked(False) if not "adminPassword" in values: startadmin = True if "adminPassword" in values: self.systemInputPassword.setText(values["adminPassword"]) if values["adminPassword"] == "": startadmin = True # minimize dialog? if "startMinimized" in values: if values["startMinimized"] == "yes": self.systemInputMinimize.setChecked(True) self.showMinimized() # save network if "networkSave" in values: if values["networkSave"] == "no": self.networkInputSave.setChecked(True) # get current resolution resolution, resolution2 = common.getResolution() # set resolution monitor 1 if "resolution" in values: if values["resolution"] == "auto": resolution = "auto" index = self.systemInputResolution.findText(resolution, QtCore.Qt.MatchFixedString) if index >= 0: self.systemInputResolution.setCurrentIndex(index) else: if resolution != "": self.systemInputResolution.addItem(resolution) # set resolution monitor 2 if "resolution2" in values: if values["resolution2"] == "auto": resolution2 = "auto" index = self.systemInputResolution2.findText( resolution2, QtCore.Qt.MatchFixedString) if index >= 0: self.systemInputResolution2.setCurrentIndex(index) else: if resolution != "": self.systemInputResolution2.addItem(resolution2) # vpn vpnvalues = vpn.readVPN(self) if "ovpn" in vpnvalues: self.vpnInputovpn.setText(vpnvalues["ovpn"]) if "parametervpn" in vpnvalues: self.vpnInputParameter.setText(vpnvalues["parametervpn"]) if "systemlogin" in vpnvalues: if vpnvalues["systemlogin"] == "yes": self.vpnInputSystemLogin.setChecked(True) if "autostartvpn" in vpnvalues: if vpnvalues["autostartvpn"] == "yes": self.vpnInputAutostart.setChecked(True) autostartvpn = True if startadmin is True: self.connectButtonExtended.setEnabled(False) else: common.enableTabs(self, False) # get screensaver state if common.isScreensaver(): self.systemInputScreensaver.setChecked(True) else: self.systemInputScreensaver.setChecked(False) # get monitor standby state if common.isMonitorStandby(): self.systemInputMonitorStandby.setChecked(True) else: self.systemInputMonitorStandby.setChecked(False) # get state Oneninedesign power case if common.isOneninedesign(): self.systemInputOneninedesign.setChecked(True) else: self.systemInputOneninedesign.setChecked(False) # get state Argop1 power case if common.isArgon1(): self.systemInputArgon1.setChecked(True) else: self.systemInputArgon1.setChecked(False) system = common.getSystemTyp() if system != "PI4": self.systemInputArgon1.setEnabled(False) self.systemInputOneninedesign.setEnabled(False) # get sound cards values = common.getSoundCards() common.fillComboBoxList(self, values, self.systemInputSound) soundcard = common.getCurrentSoundCard() stringsplit = soundcard.split(" ") cardnumber = stringsplit[0].strip() + " " for index in range(self.systemInputSound.count()): value = self.systemInputSound.itemText(index) if value.startswith(cardnumber): self.systemInputSound.setCurrentIndex(index) break # set title self.setWindowTitle(common.getRessource("dialogTitle")) # Select first Tab self.thinClientTab.setCurrentIndex(0) # start vpn connection if autostartvpn: parameter = None systemlogin = None if "parametervpn" in vpnvalues: parameter = vpnvalues["parametervpn"] systemlogin = None if "systemlogin" in vpnvalues: systemlogin = vpnvalues["systemlogin"] vpn.autostartvpn(self, vpnvalues["ovpn"], parameter, systemlogin) # autostart connections self.autostart() # read existing connections self.fillListWidgets() # set passwort to "not changed" self.RemotePasswordChanged = False self.PasswordChanged = False self.sshPasswordChanged = False