class PublisherDialog(QDialog): if USE_MAEMO_5: switchRequested = Signal() def __init__(self, parent=None): QDialog.__init__(self, parent) self.ui = Ui_PublisherDialog() self.ui.setupUi(self) self.publisher = None if USE_MAEMO_5: switchButton = self.ui.buttonBox.addButton( self.tr('Switch'), QDialogButtonBox.ActionRole) switchButton.clicked.connect(self.switchRequested) self.ui.connectButton.clicked.connect(self.createNewObject) self.ui.intValue.valueChanged.connect(self.intValueChanged) self.ui.unsetIntButton.clicked.connect(self.unsetIntValue) self.ui.setStringButton.clicked.connect(self.setStringValue) self.ui.setByteArrayButton.clicked.connect(self.setByteArrayValue) self.createNewObject() def changeEvent(self, e): QDialog.changeEvent(self, e) if e.type() == QEvent.LanguageChange: self.ui.retranslateUi(self) def intValueChanged(self, value): self.publisher.setValue('intValue', value) def unsetIntValue(self): self.publisher.resetValue('intValue') def setStringValue(self): self.publisher.setValue('stringValue', self.ui.stringValue.text()) def setByteArrayValue(self): self.publisher.setValue('byteArrayValue', self.ui.byteArrayValue.text()) def createNewObject(self): if self.publisher: del self.publisher self.publisher = QValueSpacePublisher(QValueSpace.WritableLayer, self.ui.basePath.text()) if self.publisher.isConnected(): self.ui.setters.setEnabled(True) self.intValueChanged(self.ui.intValue.value()) self.setStringValue() self.setByteArrayValue() else: self.ui.setters.setEnabled(False)
class PublisherDialog(QDialog): if USE_MAEMO_5: switchRequested = Signal() def __init__(self, parent=None): QDialog.__init__(self, parent) self.ui = Ui_PublisherDialog() self.ui.setupUi(self) self.publisher = None if USE_MAEMO_5: switchButton = self.ui.buttonBox.addButton(self.tr("Switch"), QDialogButtonBox.ActionRole) switchButton.clicked.connect(self.switchRequested) self.ui.connectButton.clicked.connect(self.createNewObject) self.ui.intValue.valueChanged.connect(self.intValueChanged) self.ui.unsetIntButton.clicked.connect(self.unsetIntValue) self.ui.setStringButton.clicked.connect(self.setStringValue) self.ui.setByteArrayButton.clicked.connect(self.setByteArrayValue) self.createNewObject() def changeEvent(self, e): QDialog.changeEvent(self, e) if e.type() == QEvent.LanguageChange: self.ui.retranslateUi(self) def intValueChanged(self, value): self.publisher.setValue("intValue", value) def unsetIntValue(self): self.publisher.resetValue("intValue") def setStringValue(self): self.publisher.setValue("stringValue", self.ui.stringValue.text()) def setByteArrayValue(self): self.publisher.setValue("byteArrayValue", self.ui.byteArrayValue.text()) def createNewObject(self): if self.publisher: del self.publisher self.publisher = QValueSpacePublisher(QValueSpace.WritableLayer, self.ui.basePath.text()) if self.publisher.isConnected(): self.ui.setters.setEnabled(True) self.intValueChanged(self.ui.intValue.value()) self.setStringValue() self.setByteArrayValue() else: self.ui.setters.setEnabled(False)
def __init__(self, parent=None): QDialog.__init__(self, parent) self.ui = Ui_PublisherDialog() self.ui.setupUi(self) self.publisher = None if USE_MAEMO_5: switchButton = self.ui.buttonBox.addButton( self.tr('Switch'), QDialogButtonBox.ActionRole) switchButton.clicked.connect(self.switchRequested) self.ui.connectButton.clicked.connect(self.createNewObject) self.ui.intValue.valueChanged.connect(self.intValueChanged) self.ui.unsetIntButton.clicked.connect(self.unsetIntValue) self.ui.setStringButton.clicked.connect(self.setStringValue) self.ui.setByteArrayButton.clicked.connect(self.setByteArrayValue) self.createNewObject()
def __init__(self, parent=None): QDialog.__init__(self, parent) self.ui = Ui_PublisherDialog() self.ui.setupUi(self) self.publisher = None if USE_MAEMO_5: switchButton = self.ui.buttonBox.addButton(self.tr("Switch"), QDialogButtonBox.ActionRole) switchButton.clicked.connect(self.switchRequested) self.ui.connectButton.clicked.connect(self.createNewObject) self.ui.intValue.valueChanged.connect(self.intValueChanged) self.ui.unsetIntButton.clicked.connect(self.unsetIntValue) self.ui.setStringButton.clicked.connect(self.setStringValue) self.ui.setByteArrayButton.clicked.connect(self.setByteArrayValue) self.createNewObject()