summaryrefslogtreecommitdiff
path: root/grc/gui/ActionHandler.py
diff options
context:
space:
mode:
Diffstat (limited to 'grc/gui/ActionHandler.py')
-rw-r--r--grc/gui/ActionHandler.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py
index 116dff189b..6dc088c36d 100644
--- a/grc/gui/ActionHandler.py
+++ b/grc/gui/ActionHandler.py
@@ -407,16 +407,22 @@ class ActionHandler:
elif action == Actions.BLOCK_PARAM_MODIFY:
selected_block = self.get_flow_graph().get_selected_block()
if selected_block:
- if PropsDialog(selected_block).run():
- #save the new state
- self.get_flow_graph().update()
- self.get_page().get_state_cache().save_new_state(self.get_flow_graph().export_data())
- self.get_page().set_saved(False)
- else:
- #restore the current state
- n = self.get_page().get_state_cache().get_current_state()
- self.get_flow_graph().import_data(n)
- self.get_flow_graph().update()
+ dialog = PropsDialog(selected_block)
+ response = gtk.RESPONSE_APPLY
+ while response == gtk.RESPONSE_APPLY: # do while construct: rerun the dialog if Apply was hit
+ response = dialog.run()
+ if response == gtk.RESPONSE_APPLY:
+ self.get_flow_graph().update()
+ Actions.ELEMENT_SELECT() # empty action, that updates the main window and flowgraph
+ elif response == gtk.RESPONSE_ACCEPT:
+ self.get_flow_graph().update()
+ self.get_page().get_state_cache().save_new_state(self.get_flow_graph().export_data())
+ self.get_page().set_saved(False)
+ else: # restore the current state
+ n = self.get_page().get_state_cache().get_current_state()
+ self.get_flow_graph().import_data(n)
+ self.get_flow_graph().update()
+ dialog.destroy()
##################################################
# View Parser Errors
##################################################