From 69159cfe1d8c24be516ebe4fab3e7bdd320285b1 Mon Sep 17 00:00:00 2001 From: "Thomas Baumann @work" Date: Thu, 14 Jun 2018 11:23:33 +0200 Subject: [PATCH] fix for issue #2 https://github.com/geo-data/qgis-quick-draw/issues/2 --- plugin/quickdraw.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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('')