Пример #1
0
    def ButtonOK(self):
        logging.info("ButtonOK")
        error = False
        if self.sshInputName.text() == "":
            common.messageDialog("configDialogErrorName")
            error = True
        elif self.sshInputAddress.text() == "":
            common.messageDialog("configDialogErrorAddress")
            error = True
        elif self.sshInputLogin.text() == "":
            common.messageDialog("configDialogErrorLogin")
            error = True
        elif self.sshInputApplication.text() == "":
            common.messageDialog("configDialogErrorApplication")
            error = True
        elif self.sshInputPassword.text() == "":
            common.messageDialog("configDialogErrorPassword")
            error = True

        name = self.sshInputName.text()
        if common.existingConnection(name):
            common.messageDialog("configDialogErrorAddress")
            error = True

        if error == False:
            values = {}
            values["typ"] = "ssh"
            values["name"] = self.sshInputName.text()
            values["address"] = self.sshInputAddress.text()
            values["port"] = self.sshInputPort.text()
            values["login"] = self.sshInputLogin.text()
            values["application"] = self.sshInputApplication.text()
            values["password"] = self.sshInputPassword.text()
            values["parameter"] = self.sshInputParameter.text()
            if self.sshInputAutostart.isChecked():
                values["autostart"] = "yes"
            else:
                values["autostart"] = "no"
            if self.sshInputRepeat.isChecked():
                values["repeat"] = "yes"
            else:
                values["repeat"] = "no"

            values["alternative"] = str(self.sshInputAlternative.currentText())

            # delete old connection
            if self.connectionname != "":
                common.deleteConnection(self.connectionname)
                common.deletePasswordFile(self.connectionname)
            # delete new connection
            common.deleteConnection(self.sshInputName.text())
            common.deletePasswordFile(self.sshInputName.text())
            # make new connection
            parameter = self.parameterssh(self.sshInputName.text(), values)
            common.newConnection(values, parameter, self.sshInputName.text())
            self.close()
Пример #2
0
    def ButtonOK(self):
        logging.info("ButtonOK")
        error = False
        if self.x2goInputName.text() == "":
            common.messageDialog("configDialogErrorName")
            error = True
        elif self.x2goInputAddress.text() == "":
            common.messageDialog("configDialogErrorAddress")
            error = True

        name = self.x2goInputName.text()
        if common.existingConnection(name):
            common.messageDialog("configDialogErrorAddress")
            error = True

        if error == False:
            values = {}
            values["typ"] = "x2go"
            values["name"] = self.x2goInputName.text()
            values["address"] = self.x2goInputAddress.text()
            values["user"] = self.x2goInputUser.text()
            values["password"] = self.x2goInputPassword.text()
            values["parameter"] = self.x2goInputParameter.text()
            values["resolution"] = self.x2goInputResolution.currentText()
            values["keyboard"] = self.x2goInputKeyboard.currentText()
            values["desktop"] = self.x2goInputDesktop.currentText()
            if self.x2goInputAutostart.isChecked():
                values["autostart"] = "yes"
            else:
                values["autostart"] = "no"                
                
            if self.x2goInputRepeat.isChecked():
                values["repeat"] = "yes"
            else:
                values["repeat"] = "no"

            if self.x2goInputSystemLogin.isChecked():
                values["systemlogin"] = "******"
            else:
                values["systemlogin"] = "******"
                
            values["alternative"] = str(self.x2goInputAlternative.currentText())

            # delete old connection
            if self.connectionname != "":
                common.deleteConnection(self.connectionname)
                common.deletePasswordFile(self.connectionname)
            # delete new connection
            common.deleteConnection(self.x2goInputName.text())
            common.deletePasswordFile(self.x2goInputName.text())
            # make new connection
            parameter = self.parameterx2go(self.x2goInputName.text(), values)
            common.newConnection(values, parameter, self.x2goInputName.text())
            self.close()
Пример #3
0
    def ButtonOK(self):
        logging.info("ButtonOK")
        error = False
        if self.vncInputName.text() == "":
            common.messageDialog("configDialogErrorName")
            error = True
        elif " " in self.vncInputName.text():
            common.messageDialog("configDialogErrorCharacter")
            error = True
        elif "[" in self.vncInputName.text():
            common.messageDialog("configDialogErrorCharacter")
            error = True
        elif "]" in self.vncInputName.text():
            common.messageDialog("configDialogErrorCharacter")
            error = True
        elif self.vncInputAddress.text() == "":
            common.messageDialog("configDialogErrorAddress")
            error = True
        elif self.vncInputPort.text() == "":
            common.messageDialog("configDialogErrorPort")
            error = True
        elif common.isNetworkAddress(self.vncInputAddress.text()) == False:
            error = True

        name = self.vncInputName.text()
        if common.existingConnection(name):
            common.messageDialog("configDialogErrorAddress")
            error = True

        if error == False:
            values = {}
            values["typ"] = "vnc"
            values["address"] = self.vncInputAddress.text()
            values["port"] = self.vncInputPort.text()
            values["password"] = self.vncInputPassword.text()
            values["resolution"] = self.vncInputResolution.currentText()
            values["color"] = self.vncInputColor.currentText()
            values["parameter"] = self.vncInputParameter.text()
            if self.vncInputAutostart.isChecked():
                values["autostart"] = "yes"
            else:
                values["autostart"] = "no"
            if self.vncInputRepeat.isChecked():
                values["repeat"] = "yes"
            else:
                values["repeat"] = "no"

            values["alternative"] = str(self.vncInputAlternative.currentText())

            # delete old connection
            if self.connectionname != "":
                common.deleteConnection(self.connectionname)
                common.deletePasswordFile(self.connectionname)
            # delete new connection
            common.deleteConnection(self.vncInputName.text())
            common.deletePasswordFile(self.vncInputName.text())
            # make new connection
            parameter = self.parameterVNC(self.vncInputName.text(), values)
            common.newConnection(values, parameter, self.vncInputName.text())
            password = self.vncInputPassword.text()
            if password != "":
                self.newPasswordFile(self.vncInputName.text(), password)
            self.close()