summaryrefslogtreecommitdiff
path: root/grc/gui
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2009-09-06 01:58:25 -0700
committerJosh Blum <josh@joshknows.com>2009-09-06 01:58:25 -0700
commit6b1d8817a7fc6dd99a770cb11fac7ca48a3c81b0 (patch)
tree9afb4f16562d64aa44682fb9b7d19fbc2031e9b1 /grc/gui
parente39507bf32666f9b17d2249106aac0d6cbcacc58 (diff)
Fixed the usrp and usrp2 probe scripts to work with the new gui param api.
Also fixed the scripts to work since they were broken by previous changes. Get input in param class now pases a param instance (self) into the object.
Diffstat (limited to 'grc/gui')
-rw-r--r--grc/gui/Param.py14
-rw-r--r--grc/gui/PropsDialog.py2
2 files changed, 10 insertions, 6 deletions
diff --git a/grc/gui/Param.py b/grc/gui/Param.py
index b84598e61c..7fabb66713 100644
--- a/grc/gui/Param.py
+++ b/grc/gui/Param.py
@@ -30,7 +30,7 @@ class InputParam(gtk.HBox):
gtk.HBox.__init__(self)
self.param = param
self._callback = callback
- self.label = gtk.Label('') #no label, markup is added by set_markup
+ self.label = gtk.Label() #no label, markup is added by set_markup
self.label.set_size_request(150, -1)
self.pack_start(self.label, False)
self.set_markup = lambda m: self.label.set_markup(m)
@@ -66,7 +66,11 @@ class InputParam(gtk.HBox):
self.param.set_value(self.get_text())
#call the callback
if self._callback: self._callback()
- #self.update() #dont update here, parent will update
+ else:
+ #no callback mode (used in supporting gui scripts)
+ #internally re-validate the param and update the gui
+ self.param.validate()
+ self.update()
class EntryParam(InputParam):
"""Provide an entry box for strings and numbers."""
@@ -155,9 +159,9 @@ class Param(Element):
All others get a standard entry parameter.
@return gtk input class
"""
- if self.is_enum(): return EnumParam(*args, **kwargs)
- if self.get_options(): return EnumEntryParam(*args, **kwargs)
- return EntryParam(*args, **kwargs)
+ if self.is_enum(): return EnumParam(self, *args, **kwargs)
+ if self.get_options(): return EnumEntryParam(self, *args, **kwargs)
+ return EntryParam(self, *args, **kwargs)
def get_layout(self):
"""
diff --git a/grc/gui/PropsDialog.py b/grc/gui/PropsDialog.py
index aa86f7214b..34fd7ec179 100644
--- a/grc/gui/PropsDialog.py
+++ b/grc/gui/PropsDialog.py
@@ -123,7 +123,7 @@ class PropsDialog(gtk.Dialog):
io_param.destroy()
#repopulate the params box
for param in self._block.get_params():
- io_param = param.get_input(param, callback=self._update)
+ io_param = param.get_input(self._update)
self._input_object_params.append(io_param)
self._params_box.pack_start(io_param, False)
#update the gui inputs