summaryrefslogtreecommitdiff
path: root/grc/gui/PropsDialog.py
diff options
context:
space:
mode:
Diffstat (limited to 'grc/gui/PropsDialog.py')
-rw-r--r--grc/gui/PropsDialog.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/grc/gui/PropsDialog.py b/grc/gui/PropsDialog.py
index d7ba8c51c9..d172175aba 100644
--- a/grc/gui/PropsDialog.py
+++ b/grc/gui/PropsDialog.py
@@ -65,7 +65,9 @@ class PropsDialog(gtk.Dialog):
gtk.Dialog.__init__(
self,
title='Properties: %s' % block.get_name(),
- buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT, gtk.STOCK_OK, gtk.RESPONSE_ACCEPT),
+ buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT,
+ gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
+ gtk.STOCK_APPLY, gtk.RESPONSE_APPLY)
)
self._block = block
self.set_size_request(MIN_DIALOG_WIDTH, MIN_DIALOG_HEIGHT)
@@ -109,6 +111,7 @@ class PropsDialog(gtk.Dialog):
# Connect events
self.connect('key-press-event', self._handle_key_press)
self.connect('show', self._update_gui)
+ self.connect('response', self._handle_response)
self.show_all() # show all (performs initial gui update)
def _params_changed(self):
@@ -183,11 +186,18 @@ class PropsDialog(gtk.Dialog):
Returns:
false to forward the keypress
"""
- if event.keyval == gtk.keysyms.Return:
+ if event.keyval == gtk.keysyms.Return and event.state & gtk.gdk.CONTROL_MASK == 0:
self.response(gtk.RESPONSE_ACCEPT)
return True # handled here
return False # forward the keypress
+ def _handle_response(self, widget, response):
+ if response == gtk.RESPONSE_APPLY:
+ for tab, label, vbox in self._params_boxes:
+ vbox.forall(lambda c: c.apply_change())
+ return True
+ return False
+
def run(self):
"""
Run the dialog and get its response.
@@ -195,6 +205,9 @@ class PropsDialog(gtk.Dialog):
Returns:
true if the response was accept
"""
- response = gtk.Dialog.run(self)
+ response = gtk.RESPONSE_APPLY
+ # don't close dialog on apply click
+ while response == gtk.RESPONSE_APPLY:
+ response = gtk.Dialog.run(self)
self.destroy()
return response == gtk.RESPONSE_ACCEPT