Пример #1
0
    def __init__(self, name, configfile):
        super(self.__class__, self).__init__()
        self.setupUi(self)
        self.connectionname = name
        # label
        common.setRessourceFile(configfile)
        self.setWindowTitle(common.getRessource("xdmcpDialogTitle"))
        self.xdmcpOKButton.setText(common.getRessource("ButtonOK"))
        self.xdmcpCancelButton.setText(common.getRessource("ButtonCancel"))
        self.xdmcpLabelName.setText(common.getRessource("configDialogLabelName"))
        self.xdmcpLabelAddress.setText(common.getRessource("configDialogLabelAddress"))
        self.xdmcpLabelPort.setText(common.getRessource("configDialogLabelPort"))
        self.xdmcpLabelResolution.setText(common.getRessource("configDialogLabelResolution"))
        self.xdmcpLabelParameter.setText(common.getRessource("configDialogLabelParameter"))
        self.xdmcpInputRepeat.setText(common.getRessource("configDialogLabelRepeat"))
        self.xdmcpLabelAlternative.setText(common.getRessource("configDialogLabelAlternative"))
        self.xdmcpInputIcon.setText(common.getRessource("configDialogLabelIcon"))
        self.xdmcpLabelIconName.setText(common.getRessource("configDialogLabelIconName"))
        # fill ComboBox
        common.fillComboBox(self, "xdmcpResolutions", self.xdmcpInputResolution)
        common.fillComboBoxConnections(self, self.xdmcpInputAlternative)
        # action
        self.xdmcpOKButton.clicked.connect(self.ButtonOK)
        self.xdmcpCancelButton.clicked.connect(self.ButtonCancel)

        if self.connectionname != "":
            # read connection parameter and fill dialog
            connection = common.readConnection(self.connectionname)
            self.xdmcpInputName.setText(self.connectionname)
            self.xdmcpInputAddress.setText(connection["address"])
            self.xdmcpInputPort.setText(connection["port"])
            self.xdmcpInputParameter.setText(connection["parameter"])
            # Resolution
            index = self.xdmcpInputResolution.findText(connection["resolution"],
                                                       QtCore.Qt.MatchFixedString)
            if index >= 0:
                self.xdmcpInputResolution.setCurrentIndex(index)
            autostart = connection["autostart"]
            # Autostart
            if autostart == "yes":
                self.xdmcpInputAutostart.setChecked(True)
            # Repeat
            repeat = connection["repeat"]
            if repeat == "yes":
                self.x2goInputRepeat.setChecked(True)
            # Alternative
            alternative = connection["alternative"]
            if alternative != "":
                index = self.xdmcpInputAlternative.findText(alternative, QtCore.Qt.MatchFixedString)
                self.xdmcpInputAlternative.setCurrentIndex(index)    
            # Icon
            icon = "no"
            if "icon" in connection:
                icon = connection["icon"]
            if icon == "yes":
                self.xdmcpInputIcon.setChecked(True)
            iconname = ""
            if "iconname" in connection:
                iconname = connection["iconname"]
            self.xdmcpInputIconName.setText(iconname)
Пример #2
0
    def __init__(self, name, configfile):
        super(self.__class__, self).__init__()
        self.setupUi(self)
        self.connectionname = name
        # label
        common.setRessourceFile(configfile)
        self.setWindowTitle(common.getRessource("rdesktopDialogTitle"))
        self.rdesktopOKButton.setText(common.getRessource("ButtonOK"))
        self.rdesktopCancelButton.setText(common.getRessource("ButtonCancel"))
        self.rdesktopLabelName.setText(
            common.getRessource("configDialogLabelName"))
        self.rdesktopLabelAddress.setText(
            common.getRessource("configDialogLabelAddress"))
        self.rdesktopLabelResolution.setText(
            common.getRessource("configDialogLabelResolution"))
        self.rdesktopLabelColor.setText(
            common.getRessource("configDialogLabelColor"))
        self.rdesktopLabelParameter.setText(
            common.getRessource("configDialogLabelParameter"))
        self.rdesktopInputAutostart.setText(
            common.getRessource("configDialogLabelAutostart"))
        self.rdesktopInputRepeat.setText(
            common.getRessource("configDialogLabelRepeat"))
        self.rdesktopInputSystemLogin.setText(
            common.getRessource("configDialogLabelSystemLogin"))
        self.rdesktopLabelAlternative.setText(
            common.getRessource("configDialogLabelAlternative"))
        #action
        self.rdesktopOKButton.clicked.connect(self.ButtonOK)
        self.rdesktopCancelButton.clicked.connect(self.ButtonCancel)
        # fill ComboBox
        common.fillComboBox(self, "rdesktopResolutions",
                            self.rdesktopInputResolution)
        common.fillComboBox(self, "rdesktopColorLevel",
                            self.rdesktopInputColor)
        common.fillComboBoxConnections(self, self.rdesktopInputAlternative)

        if self.connectionname != "":
            # read connection parameter and fill dialog
            connection = common.readConnection(self.connectionname)
            self.rdesktopInputName.setText(self.connectionname)
            self.rdesktopInputAddress.setText(connection["address"])
            self.rdesktopInputParameter.setText(connection["parameter"])
            # Resolution
            index = self.rdesktopInputResolution.findText(
                connection["resolution"], QtCore.Qt.MatchFixedString)
            if index >= 0:
                self.rdesktopInputResolution.setCurrentIndex(index)
            # Color
            index = self.rdesktopInputColor.findText(
                connection["color"], QtCore.Qt.MatchFixedString)
            if index >= 0:
                self.rdesktopInputColor.setCurrentIndex(index)
            # Autostart
            autostart = connection["autostart"]
            if autostart == "yes":
                self.rdesktopInputAutostart.setChecked(True)
            # Repeat
            repeat = connection["repeat"]
            if repeat == "yes":
                self.rdesktopInputRepeat.setChecked(True)
            # Own Login
            systemlogin = connection["systemlogin"]
            if systemlogin == "yes":
                self.rdesktopInputSystemLogin.setChecked(True)
            # Alternative
            alternative = connection["alternative"]
            if alternative != "":
                index = self.rdesktopInputAlternative.findText(
                    alternative, QtCore.Qt.MatchFixedString)
                self.rdesktopInputAlternative.setCurrentIndex(index)
Пример #3
0
    def __init__(self, name, configfile):
        super(self.__class__, self).__init__()
        self.setupUi(self)
        self.connectionname = name
        # label
        common.setRessourceFile(configfile)
        self.setWindowTitle(common.getRessource("x2goDialogTitle"))
        self.x2goOKButton.setText(common.getRessource("ButtonOK"))
        self.x2goCancelButton.setText(common.getRessource("ButtonCancel"))
        self.x2goLabelName.setText(common.getRessource("configDialogLabelName"))
        self.x2goLabelAddress.setText(common.getRessource("configDialogLabelAddress"))
        self.x2goLabelUser.setText(common.getRessource("configDialogLabelUser"))
        self.x2goLabelPassword.setText(common.getRessource("configDialogLabelPassword"))
        self.x2goLabelKeyboard.setText(common.getRessource("configDialogLabelKeyboard"))
        self.x2goLabelResolution.setText(common.getRessource("configDialogLabelResolution"))
        self.x2goLabelDesktop.setText(common.getRessource("configDialogLabelDesktop"))
        self.x2goLabelParameter.setText(common.getRessource("configDialogLabelParameter"))
        self.x2goInputRepeat.setText(common.getRessource("configDialogLabelRepeat"))
        self.x2goLabelAlternative.setText(common.getRessource("configDialogLabelAlternative"))
        self.x2goInputSystemLogin.setText(common.getRessource("configDialogLabelSystemLogin"))
        self.x2goInputIcon.setText(common.getRessource("configDialogLabelIcon"))
        self.x2goLabelIconName.setText(common.getRessource("configDialogLabelIconName"))        
        # fill ComboBox
        common.fillComboBox(self, "x2goResolutions", self.x2goInputResolution)
        common.fillComboBox(self, "x2goKeyboardLayout", self.x2goInputKeyboard)
        common.fillComboBox(self, "x2goDesktop", self.x2goInputDesktop)
        common.fillComboBoxConnections(self, self.x2goInputAlternative)
        # action
        self.x2goOKButton.clicked.connect(self.ButtonOK)
        self.x2goCancelButton.clicked.connect(self.ButtonCancel)

        if self.connectionname != "":
            # read connection parameter and fill dialog
            connection = common.readConnection(self.connectionname)
            self.x2goInputName.setText(self.connectionname)
            self.x2goInputAddress.setText(connection["address"])
            self.x2goInputUser.setText(connection["user"])
            self.x2goInputPassword.setText(connection["password"])
            self.x2goInputParameter.setText(connection["parameter"])
            # Keyboard layout
            index = self.x2goInputKeyboard.findText(connection["keyboard"],
                                                    QtCore.Qt.MatchFixedString)
            if index >= 0:
                self.x2goInputKeyboard.setCurrentIndex(index)
            # Resolution
            index = self.x2goInputResolution.findText(connection["resolution"],
                                                      QtCore.Qt.MatchFixedString)
            if index >= 0:
                self.x2goInputResolution.setCurrentIndex(index)
            # Desktop
            index = self.x2goInputDesktop.findText(connection["desktop"],
                                                   QtCore.Qt.MatchFixedString)
            if index >= 0:
                self.x2goInputDesktop.setCurrentIndex(index)
            # Own Login
            systemlogin = connection["systemlogin"]
            if systemlogin == "yes":
                self.x2goInputSystemLogin.setChecked(True)
            # Autostart
            autostart = connection["autostart"]
            if autostart == "yes":
                self.x2goInputAutostart.setChecked(True)
            # Repeat
            repeat = connection["repeat"]
            if repeat == "yes":
                self.x2goInputRepeat.setChecked(True)
            # Alternative
            alternative = connection["alternative"]
            if alternative != "":
                index = self.x2goInputAlternative.findText(alternative, QtCore.Qt.MatchFixedString)
                self.x2goInputAlternative.setCurrentIndex(index)    
            # Icon
            icon = "no"
            if "icon" in connection:
                icon = connection["icon"]
            if icon == "yes":
                self.x2goInputIcon.setChecked(True)
            iconname = ""
            if "iconname" in connection:
                iconname = connection["iconname"]
            self.x2goInputIconName.setText(iconname)
Пример #4
0
    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)
Пример #5
0
    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