def run(self): dlg = PolygonizerDialog(self.iface) # show the dialog dlg.show() result = dlg.exec_() # See if OK was pressed if result == 1: # do something useful (delete the line containing pass and # substitute with your code pass