diff --git a/plugin/quickdraw.py b/plugin/quickdraw.py index 6eeff84..182b47f 100644 --- a/plugin/quickdraw.py +++ b/plugin/quickdraw.py @@ -90,7 +90,8 @@ def initGui(self): self.iface.addPluginToMenu(u"&Quick Draw", self.action) QObject.connect(self.dlg.clearButton, SIGNAL("clicked()"), self.clearButtonClicked) - self.dlg.buttonBox.clicked.connect(self.buttonBoxClicked) + self.dlg.buttonBox.button(QDialogButtonBox.Reset).clicked.connect(self.buttonBoxReset) + self.dlg.buttonBox.button(QDialogButtonBox.Apply).clicked.connect(self.buttonBoxApply) self.dlg.exampleComboBox.activated.connect(self.exampleSelected) def unload(self): @@ -99,13 +100,12 @@ def unload(self): self.iface.removeToolBarIcon(self.action) self.removeItems() - def buttonBoxClicked(self, button): - button_text = str(button.text()) - if button_text == 'Apply': - self.draw() - self.applied = True - elif button_text == 'Reset': - self.resetText() + def buttonBoxReset(self, button): + self.resetText() + + def buttonBoxApply(self, button): + self.draw() + self.applied = True def clearButtonClicked(self): self.dlg.geometryTextEdit.setPlainText('')