commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 14/24: grc: tabbed props: no more double en


From: git
Subject: [Commit-gnuradio] [gnuradio] 14/24: grc: tabbed props: no more double entries
Date: Tue, 18 Mar 2014 17:51:41 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

trondeau pushed a commit to branch master
in repository gnuradio.

commit dcde42fdbdd590218f572734c07047b4c19fab75
Author: Sebastian Koslowski <address@hidden>
Date:   Mon Mar 17 09:58:35 2014 +0100

    grc: tabbed props: no more double entries
---
 grc/gui/PropsDialog.py | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/grc/gui/PropsDialog.py b/grc/gui/PropsDialog.py
index 0e85a4b..8a7a8b1 100644
--- a/grc/gui/PropsDialog.py
+++ b/grc/gui/PropsDialog.py
@@ -85,12 +85,11 @@ class PropsDialog(gtk.Dialog):
         for tab in block.get_param_tab_labels():
             label = gtk.Label()
             vbox = gtk.VBox()
-            input_objects = []
             scroll_box = gtk.ScrolledWindow()
             scroll_box.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
             scroll_box.add_with_viewport(vbox)
             notebook.append_page(scroll_box, label)
-            self._params_boxes.append((tab, label, vbox, input_objects))
+            self._params_boxes.append((tab, label, vbox))
 
         # Docs for the block
         self._docs_text_display = TextDisplay()
@@ -152,21 +151,17 @@ class PropsDialog(gtk.Dialog):
         #update the params box
         if self._params_changed():
             #hide params box before changing
-            for tab, label, vbox, input_objects in self._params_boxes:
+            for tab, label, vbox in self._params_boxes:
                 vbox.hide_all()
                 # empty the params box
-                for io_param in input_objects:
-                    vbox.remove(io_param)
-                    input_objects.remove(io_param)
-                    io_param.destroy()
+                vbox.forall(lambda c: vbox.remove(c) or c.destroy())
                 # repopulate the params box
                 box_all_valid = True
                 for param in filter(lambda p: p.get_tab_label() == tab, 
self._block.get_params()):
-                    if param.get_hide() == 'all': continue
-                    io_param = param.get_input(self._handle_changed)
-                    input_objects.append(io_param)
-                    vbox.pack_start(io_param, False)
+                    if param.get_hide() == 'all':
+                        continue
                     box_all_valid = box_all_valid and param.is_valid()
+                    vbox.pack_start(param.get_input(self._handle_changed), 
False)
                 label.set_markup(Utils.parse_template(TAB_LABEL_MARKUP_TMPL, 
valid=box_all_valid, tab=tab))
                 #show params box with new params
                 vbox.show_all()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]