commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r10078 - in gnuradio/trunk/grc: data/platforms/python/


From: jblum
Subject: [Commit-gnuradio] r10078 - in gnuradio/trunk/grc: data/platforms/python/blocks src/gui
Date: Thu, 27 Nov 2008 00:12:16 -0700 (MST)

Author: jblum
Date: 2008-11-27 00:12:15 -0700 (Thu, 27 Nov 2008)
New Revision: 10078

Modified:
   gnuradio/trunk/grc/data/platforms/python/blocks/preferences.xml
   gnuradio/trunk/grc/src/gui/Constants.py
   gnuradio/trunk/grc/src/gui/MainWindow.py
   gnuradio/trunk/grc/src/gui/Preferences.py
Log:
resizable reports window

Modified: gnuradio/trunk/grc/data/platforms/python/blocks/preferences.xml
===================================================================
--- gnuradio/trunk/grc/data/platforms/python/blocks/preferences.xml     
2008-11-27 05:17:20 UTC (rev 10077)
+++ gnuradio/trunk/grc/data/platforms/python/blocks/preferences.xml     
2008-11-27 07:12:15 UTC (rev 10078)
@@ -37,7 +37,6 @@
        <param>
                <name>Window Size</name>
                <key>window_size</key>
-               <value>800, 600</value>
                <type>int_vector</type>
        </param>
        <!-- Snap to Grid -->
@@ -93,20 +92,6 @@
        </param>
        <!-- Appearance Prefs -->
        <param>
-               <name>Show Reports Window</name>
-               <key>show_reports</key>
-               <value>show</value>
-               <type>enum</type>
-               <option>
-                       <name>Show</name>
-                       <key>show</key>
-               </option>
-               <option>
-                       <name>Hide</name>
-                       <key>hide</key>
-               </option>
-       </param>
-       <param>
                <name>Show Params Labels</name>
                <key>show_params</key>
                <value>show</value>
@@ -135,4 +120,9 @@
                        <key>no</key>
                </option>
        </param>
+       <param>
+               <name>Reports Window Position</name>
+               <key>reports_window_position</key>
+               <type>string</type>
+       </param>
 </block>

Modified: gnuradio/trunk/grc/src/gui/Constants.py
===================================================================
--- gnuradio/trunk/grc/src/gui/Constants.py     2008-11-27 05:17:20 UTC (rev 
10077)
+++ gnuradio/trunk/grc/src/gui/Constants.py     2008-11-27 07:12:15 UTC (rev 
10078)
@@ -39,8 +39,6 @@
 ##dialog constraints
 MIN_DIALOG_WIDTH = 500
 MIN_DIALOG_HEIGHT = 500
-##static height of reports window
-REPORTS_WINDOW_HEIGHT = 100
 ##static width of block selection window
 BLOCK_SELECTION_WINDOW_WIDTH = 200
 

Modified: gnuradio/trunk/grc/src/gui/MainWindow.py
===================================================================
--- gnuradio/trunk/grc/src/gui/MainWindow.py    2008-11-27 05:17:20 UTC (rev 
10077)
+++ gnuradio/trunk/grc/src/gui/MainWindow.py    2008-11-27 07:12:15 UTC (rev 
10078)
@@ -19,7 +19,7 @@
 
 from Constants import \
        MIN_WINDOW_WIDTH, MIN_WINDOW_HEIGHT, \
-       NEW_FLOGRAPH_TITLE, REPORTS_WINDOW_HEIGHT
+       NEW_FLOGRAPH_TITLE
 from Actions import \
        APPLICATION_QUIT, FLOW_GRAPH_KILL, \
        FLOW_GRAPH_SAVE, get_accel_group
@@ -71,31 +71,27 @@
                self.notebook.set_show_border(False)
                self.notebook.set_scrollable(True) #scroll arrows for page tabs
                self.notebook.connect('switch-page', self._handle_page_change)
-               fg_and_report_box = gtk.VBox(False, 0)
-               fg_and_report_box.pack_start(self.notebook, False, False, 0)
-               fg_and_report_box.pack_start(self.scrolled_window)
-               hbox.pack_start(fg_and_report_box)
+               #setup containers
+               flow_graph_box = gtk.VBox(False, 0)
+               self.flow_graph_vpaned = gtk.VPaned()
+               flow_graph_box.pack_start(self.notebook, False, False, 0)
+               flow_graph_box.pack_start(self.scrolled_window)
+               self.flow_graph_vpaned.pack1(flow_graph_box)
+               hbox.pack_start(self.flow_graph_vpaned)
                vbox.pack_start(hbox)
-               #create the side windows
-               side_box = gtk.VBox()
-               hbox.pack_start(side_box, False)
-               side_box.pack_start(BlockTreeWindow(platform, 
self.get_flow_graph)) #allow resize, selection window can have more space
+               hbox.pack_start(BlockTreeWindow(platform, self.get_flow_graph), 
False) #dont allow resize
                #create the reports window
                self.text_display = TextDisplay()
                #house the reports in a scrolled window
                self.reports_scrolled_window = gtk.ScrolledWindow()
-               self.reports_scrolled_window.set_size_request(-1, 
REPORTS_WINDOW_HEIGHT)
                self.reports_scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, 
gtk.POLICY_AUTOMATIC)
                
self.reports_scrolled_window.add_with_viewport(self.text_display)
-               fg_and_report_box.pack_end(self.reports_scrolled_window, False) 
#dont allow resize, fg should get all the space
-               #show all but the main window container and the reports window
-               vbox.show_all()
-               self.notebook.hide()
-               self._show_reports_window(False)
-               # load preferences and show the main window
+               self.flow_graph_vpaned.pack2(self.reports_scrolled_window, 
False) #dont allow resize
+               #load preferences and show the main window
                Preferences.load(platform)
                self.resize(*Preferences.window_size())
-               self.show()#show after resize in preferences
+               
self.flow_graph_vpaned.set_position(Preferences.reports_window_position())
+               self.show_all()
 
        ############################################################
        # Event Handlers
@@ -138,15 +134,6 @@
                vadj.set_value(vadj.upper)
                vadj.emit('changed')
 
-       def _show_reports_window(self, show):
-               """
-               Show the reports window when show is True.
-               Hide the reports window when show is False.
-               @param show boolean flag
-               """
-               if show: self.reports_scrolled_window.show()
-               else: self.reports_scrolled_window.hide()
-
        ############################################################
        # Pages: create and close
        ############################################################
@@ -202,6 +189,7 @@
                Preferences.files_open(open_files)
                Preferences.file_open(open_file)
                Preferences.window_size(self.get_size())
+               
Preferences.reports_window_position(self.flow_graph_vpaned.get_position())
                Preferences.save()
                return True
 
@@ -262,8 +250,6 @@
                                        )
                                )
                        )
-               #reports window
-               self._show_reports_window(Preferences.show_reports_window())
                #show/hide notebook tabs
                if len(self._get_pages()) > 1: self.notebook.show()
                else: self.notebook.hide()

Modified: gnuradio/trunk/grc/src/gui/Preferences.py
===================================================================
--- gnuradio/trunk/grc/src/gui/Preferences.py   2008-11-27 05:17:20 UTC (rev 
10077)
+++ gnuradio/trunk/grc/src/gui/Preferences.py   2008-11-27 07:12:15 UTC (rev 
10078)
@@ -50,7 +50,7 @@
                self.snap_to_grid_param = 
self._prefs_block.get_param('snap_to_grid')
                self.grid_size_param = self._prefs_block.get_param('grid_size')
                self.show_grid_param = self._prefs_block.get_param('show_grid')
-               self.show_reports_param = 
self._prefs_block.get_param('show_reports')
+               self.reports_window_position_param = 
self._prefs_block.get_param('reports_window_position')
                self.restore_files_param = 
self._prefs_block.get_param('restore_files')
                self.window_size_param = 
self._prefs_block.get_param('window_size')
                self.file_open_param = self._prefs_block.get_param('file_open')
@@ -75,10 +75,9 @@
                        (
                                'Appearance',
                                '''
-Show or hide the reports window at the bottom of the main window.
 Show or hide all paramater labels in the signal blocks.
 ''',
-                               [self.show_reports_param, 
self.show_params_param],
+                               [self.show_params_param],
                        ),
                        (
                                'Misc',
@@ -113,8 +112,11 @@
        if files is not None: 
_get_prefs().files_open_param.set_value('\n'.join(files))
        else: return _get_prefs().files_open_param.get_value().split('\n')
 
-def show_reports_window():
-       return _get_prefs().show_reports_param.get_value() == 'show'
+def reports_window_position(pos=None):
+       if pos is not None: 
_get_prefs().reports_window_position_param.set_value('%d'%pos)
+       else:
+               try: return 
int(_get_prefs().reports_window_position_param.get_value()) or 1 #greater than 0
+               except: return -1
 
 def get_grid_size():
        return int(_get_prefs().grid_size_param.get_value())





reply via email to

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