示例#1
0
    def __init__(self, parent, package, deviceID, deviceName):
        QtGui.QDialog.__init__(self, parent)
        self.ui = Ui_NMWizard()
        self.ui.setupUi(self)

        self.isAvailable = False

        self.iface = parent.iface
        self.package = package
        self.device = deviceID
        self.pin = ""

        self.ui.txtDevice.setText(deviceName)
        self.ui.txtIMEI.setText(deviceID.split(":")[-1])

        # Create PIN Dialog
        self.pinDialog = PINDialog(self, deviceName)

        # Signals & Slots
        self.connect(self.ui.buttonBox, SIGNAL("accepted()"),
                     self.applyChanges)
        self.connect(self.ui.buttonBox, SIGNAL("rejected()"), self.reject)
        self.connect(self.ui.lineEditPIN, SIGNAL("editingFinished()"),
                     self.savePIN)

        # Ask for pin and scan if OK
        self.isAvailable = self.askForPIN()
示例#2
0
class ConnectionWizard(QtGui.QDialog):
    def __init__(self, parent, package, deviceID, deviceName):
        QtGui.QDialog.__init__(self, parent)
        self.ui = Ui_NMWizard()
        self.ui.setupUi(self)

        self.isAvailable = False

        self.iface = parent.iface
        self.package = package
        self.device = deviceID
        self.pin = ""

        self.ui.txtDevice.setText(deviceName)
        self.ui.txtIMEI.setText(deviceID.split(":")[-1])

        # Create PIN Dialog
        self.pinDialog = PINDialog(self, deviceName)

        # Signals & Slots
        self.connect(self.ui.buttonBox, SIGNAL("accepted()"),
                     self.applyChanges)
        self.connect(self.ui.buttonBox, SIGNAL("rejected()"), self.reject)
        self.connect(self.ui.lineEditPIN, SIGNAL("editingFinished()"),
                     self.savePIN)

        # Ask for pin and scan if OK
        self.isAvailable = self.askForPIN()

    def savePIN(self):
        self.pin = str(self.ui.lineEditPIN.text())

    def applyChanges(self):
        def collectDataFromUI():
            data = {}

            data["device_id"] = self.device
            data["name"] = self.connectionName
            data["auth"] = "pin"

            if self.pin and self.ui.checkBoxRemember.isChecked():
                data["auth_pin"] = self.pin

            return data

        self.connectionName = str(
            self.ui.comboBoxOperators.itemData(
                self.ui.comboBoxOperators.currentIndex()).toString())

        try:
            self.iface.updateConnection(self.package, self.connectionName,
                                        collectDataFromUI())
            self.accept()
        except Exception, e:
            KMessageBox.error(self, unicode(e))
            return
示例#3
0
class ConnectionWizard(QtGui.QDialog):
    def __init__(self, parent, package, deviceID, deviceName):
        QtGui.QDialog.__init__(self, parent)
        self.ui = Ui_NMWizard()
        self.ui.setupUi(self)

        self.isAvailable = False

        self.iface = parent.iface
        self.package = package
        self.device = deviceID
        self.pin = ""

        self.ui.txtDevice.setText(deviceName)
        self.ui.txtIMEI.setText(deviceID.split(":")[-1])

        # Create PIN Dialog
        self.pinDialog = PINDialog(self, deviceName)

        # Signals & Slots
        self.connect(self.ui.buttonBox, SIGNAL("accepted()"), self.applyChanges)
        self.connect(self.ui.buttonBox, SIGNAL("rejected()"), self.reject)
        self.connect(self.ui.lineEditPIN, SIGNAL("editingFinished()"), self.savePIN)

        # Ask for pin and scan if OK
        self.isAvailable = self.askForPIN()

    def savePIN(self):
        self.pin = str(self.ui.lineEditPIN.text())

    def applyChanges(self):
        def collectDataFromUI():
            data = {}

            data["device_id"] = self.device
            data["name"] = self.connectionName
            data["auth"] = "pin"

            if self.pin and self.ui.checkBoxRemember.isChecked():
                data["auth_pin"] = self.pin

            return data

        self.connectionName = str(self.ui.comboBoxOperators.itemData(self.ui.comboBoxOperators.currentIndex()).toString())

        try:
            self.iface.updateConnection(self.package, self.connectionName, collectDataFromUI())
            self.accept()
        except Exception, e:
            KMessageBox.error(self, unicode(e))
            return
示例#4
0
    def __init__(self, parent, package, deviceID, deviceName):
        QtGui.QDialog.__init__(self, parent)
        self.ui = Ui_NMWizard()
        self.ui.setupUi(self)

        self.isAvailable = False

        self.iface = parent.iface
        self.package = package
        self.device = deviceID
        self.pin = ""

        self.ui.txtDevice.setText(deviceName)
        self.ui.txtIMEI.setText(deviceID.split(":")[-1])

        # Create PIN Dialog
        self.pinDialog = PINDialog(self, deviceName)

        # Signals & Slots
        self.connect(self.ui.buttonBox, SIGNAL("accepted()"), self.applyChanges)
        self.connect(self.ui.buttonBox, SIGNAL("rejected()"), self.reject)
        self.connect(self.ui.lineEditPIN, SIGNAL("editingFinished()"), self.savePIN)

        # Ask for pin and scan if OK
        self.isAvailable = self.askForPIN()