Merge commit 'v3.3.1' into try-3.3.1
[debian/gnuradio] / gr-wxgui / src / python / common.py
index 17a7dc0de550fa8ae5fa32da1f938d3f5fd7edd8..3641ae6448f7ff4f4203c82e2210ea135d8d4579 100644 (file)
@@ -25,6 +25,8 @@
 import wx
 from gnuradio import gr
 
+RUN_ALWAYS = gr.prefs().get_bool ('wxgui', 'run_always', False)
+
 class wxgui_hb(object):
        """
        The wxgui hier block helper/wrapper class:
@@ -47,7 +49,10 @@ class wxgui_hb(object):
                        assert points[0] == self or points[0][0] == self
                        copy = gr.copy(self._hb.input_signature().sizeof_stream_item(0))
                        handler = self._handler_factory(copy.set_enabled)
-                       handler(False) #initially disable the copy block
+                       if RUN_ALWAYS == False:
+                               handler(False) #initially disable the copy block
+                       else:
+                               handler(True) #initially enable the copy block
                        self._bind_to_visible_event(win=self.win, handler=handler)
                        points = list(points)
                        points.insert(1, copy) #insert the copy block into the chain
@@ -67,7 +72,10 @@ class wxgui_hb(object):
                        if cache[0] == visible: return
                        cache[0] = visible
                        #print visible, handler
-                       handler(visible)
+                       if RUN_ALWAYS == False:
+                               handler(visible)
+                       else:
+                               handler(True)
                return callback
 
        @staticmethod