commit-gnuradio
[Top][All Lists]
Advanced

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

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


From: jblum
Subject: [Commit-gnuradio] r9601 - in gnuradio/trunk/grc: data/platforms/python data/platforms/python/blocks src/gui
Date: Thu, 18 Sep 2008 10:56:27 -0600 (MDT)

Author: jblum
Date: 2008-09-18 10:56:25 -0600 (Thu, 18 Sep 2008)
New Revision: 9601

Modified:
   gnuradio/trunk/grc/data/platforms/python/blocks/preferences.xml
   gnuradio/trunk/grc/data/platforms/python/flow_graph.tmpl
   gnuradio/trunk/grc/src/gui/Constants.py
   gnuradio/trunk/grc/src/gui/Dialogs.py
   gnuradio/trunk/grc/src/gui/MainWindow.py
   gnuradio/trunk/grc/src/gui/Messages.py
   gnuradio/trunk/grc/src/gui/Preferences.py
Log:
moved some constants

Modified: gnuradio/trunk/grc/data/platforms/python/blocks/preferences.xml
===================================================================
--- gnuradio/trunk/grc/data/platforms/python/blocks/preferences.xml     
2008-09-17 14:34:27 UTC (rev 9600)
+++ gnuradio/trunk/grc/data/platforms/python/blocks/preferences.xml     
2008-09-18 16:56:25 UTC (rev 9601)
@@ -17,6 +17,12 @@
                <type>string</type>
        </param>
        <param>
+               <name>Window Prefix</name>
+               <key>window_prefix</key>
+               <value>GRC</value>
+               <type>string</type>
+       </param>
+       <param>
                <name>File Open</name>
                <key>file_open</key>
                <value></value>

Modified: gnuradio/trunk/grc/data/platforms/python/flow_graph.tmpl
===================================================================
--- gnuradio/trunk/grc/data/platforms/python/flow_graph.tmpl    2008-09-17 
14:34:27 UTC (rev 9600)
+++ gnuradio/trunk/grc/data/platforms/python/flow_graph.tmpl    2008-09-18 
16:56:25 UTC (rev 9601)
@@ -42,13 +42,13 @@
 #set $param_str = ', '.join(['self'] + ['%s=%s'%(param.get_id(), 
param.get_make()) for param in $parameters])
 #if $generate_options == 'wx_gui'
        #from gnuradio.grc.platforms.base.Constants import DATA_DIR
-       #from gnuradio.grc.gui.Constants import MAIN_WINDOW_PREFIX
+       #from gnuradio.grc.gui import Preferences
 class $(class_name)(grc_wxgui.top_block_gui):
 
        def __init__($param_str):
                grc_wxgui.top_block_gui.__init__(
                        self,
-                       title="$MAIN_WINDOW_PREFIX - Executing: 
$flow_graph.get_option('title')",
+                       title="$Preferences.window_prefix() - Executing: 
$flow_graph.get_option('title')",
                        icon="$(os.path.join($DATA_DIR, 'grc-icon-32.png'))",
                )
 #elif $generate_options == 'no_gui'

Modified: gnuradio/trunk/grc/src/gui/Constants.py
===================================================================
--- gnuradio/trunk/grc/src/gui/Constants.py     2008-09-17 14:34:27 UTC (rev 
9600)
+++ gnuradio/trunk/grc/src/gui/Constants.py     2008-09-18 16:56:25 UTC (rev 
9601)
@@ -17,66 +17,34 @@
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
 
-##################################################
-## Global Titles
-##################################################
-
-##The name to appear in the main window for a flow graph that has not been 
saved to file.
+##The name for new/unsaved flow graphs
 NEW_FLOGRAPH_TITLE = 'untitled'
 
-##The prefix title on the main window.
-MAIN_WINDOW_PREFIX = "GRC"
-
-##################################################
-## Signal block rotations
-##################################################
-
-##direction of rotation left.
+##Rotation constants
 DIR_LEFT = 'left'
-
-##direction of rotation right.
 DIR_RIGHT = 'right'
 
-##################################################
-## Dimension constraints for the various windows (in pixels)
-##################################################
-
 ##main window constraints
 MIN_WINDOW_WIDTH = 600
 MIN_WINDOW_HEIGHT = 400
-
 ##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
 
-##################################################
-## Dragging, scrolling, and redrawing constants for the flow graph window in 
pixels
-##################################################
-
 ##How close can the mouse get to the window border before mouse events are 
ignored.
 BORDER_PROXIMITY_SENSITIVITY = 50
-
 ##How close the mouse can get to the edge of the visible window before 
scrolling is invoked.
 SCROLL_PROXIMITY_SENSITIVITY = 30
-
 ##When the window has to be scrolled, move it this distance in the required 
direction.
 SCROLL_DISTANCE = 15
-
 ##The redrawing sensitivity, how many seconds must pass between motion events 
before a redraw?
 MOTION_DETECT_REDRAWING_SENSITIVITY = .02
-
 ##How close the mouse click can be to a connection and register a connection 
select.
 CONNECTION_SELECT_SENSITIVITY = 5
 
-##################################################
-# A state is recorded for each change to the flow graph, the size dictates how 
many states we can record
-##################################################
-
 ##The size of the state saving cache in the flow graph (for undo/redo 
functionality)
 STATE_CACHE_SIZE = 42

Modified: gnuradio/trunk/grc/src/gui/Dialogs.py
===================================================================
--- gnuradio/trunk/grc/src/gui/Dialogs.py       2008-09-17 14:34:27 UTC (rev 
9600)
+++ gnuradio/trunk/grc/src/gui/Dialogs.py       2008-09-18 16:56:25 UTC (rev 
9601)
@@ -20,9 +20,7 @@
 import pygtk
 pygtk.require('2.0')
 import gtk
-from Constants import \
-       MIN_DIALOG_WIDTH, MIN_DIALOG_HEIGHT, \
-       MAIN_WINDOW_PREFIX
+from Constants import MIN_DIALOG_WIDTH, MIN_DIALOG_HEIGHT
 from .. platforms.base.Constants import VERSION
 import Preferences
 
@@ -88,20 +86,21 @@
                """AboutDialog constructor."""
                gtk.AboutDialog.__init__(self)
                self.set_version(VERSION)
-               self.set_name(MAIN_WINDOW_PREFIX)
+               self.set_name('GNU Radio Companion')
                self.set_license(__doc__)
-               self.set_copyright('Copyright 2008 Free Software Foundation, 
Inc.')
+               self.set_copyright(__doc__.strip().splitlines()[0])
                
self.set_website('http://gnuradio.org/trac/wiki/GNURadioCompanion')
                self.set_comments("""\
 Thank you to all those from the mailing list who tested GNU Radio Companion 
and offered advice.
---
+-----
 Special Thanks:
 A. Brinton Cooper -> starting the project
+Patrick Mulligan -> starting the project
 CER Technology Fellowship Grant -> initial funding
 William R. Kenan Jr. Fund -> usrp & computers
 Patrick Strasser -> the GRC icon
 Achilleas Anastasopoulos -> trellis support
---""")
+-----""")
                self.run()
                self.destroy()
 

Modified: gnuradio/trunk/grc/src/gui/MainWindow.py
===================================================================
--- gnuradio/trunk/grc/src/gui/MainWindow.py    2008-09-17 14:34:27 UTC (rev 
9600)
+++ gnuradio/trunk/grc/src/gui/MainWindow.py    2008-09-18 16:56:25 UTC (rev 
9601)
@@ -19,8 +19,7 @@
 
 from Constants import \
        MIN_WINDOW_WIDTH, MIN_WINDOW_HEIGHT, \
-       NEW_FLOGRAPH_TITLE, MAIN_WINDOW_PREFIX, \
-       REPORTS_WINDOW_HEIGHT
+       NEW_FLOGRAPH_TITLE, REPORTS_WINDOW_HEIGHT
 from .. platforms.base.Constants import FLOW_GRAPH_FILE_EXTENSION
 from Actions import APPLICATION_QUIT, FLOW_GRAPH_KILL
 import pygtk
@@ -241,7 +240,7 @@
                """
                if self.get_page():
                        title = ''.join((
-                                       MAIN_WINDOW_PREFIX,
+                                       Preferences.window_prefix(),
                                        ' - Editing: ',
                                        (self.get_page().get_file_path() or 
NEW_FLOGRAPH_TITLE),
                                        (self.get_page().get_saved() and ' ' or 
'*'), #blank must be non empty

Modified: gnuradio/trunk/grc/src/gui/Messages.py
===================================================================
--- gnuradio/trunk/grc/src/gui/Messages.py      2008-09-17 14:34:27 UTC (rev 
9600)
+++ gnuradio/trunk/grc/src/gui/Messages.py      2008-09-18 16:56:25 UTC (rev 
9601)
@@ -45,7 +45,7 @@
 # Special functions for specific program functionalities
 ###########################################################################
 def send_init():
-       send("""<<< Welcome to GRC %s >>>\n"""%VERSION)
+       send("""<<< Welcome to GNU Radio Companion %s >>>\n"""%VERSION)
 
 def send_page_switch(file_path):
        send('\nShowing: "%s"\n'%file_path)

Modified: gnuradio/trunk/grc/src/gui/Preferences.py
===================================================================
--- gnuradio/trunk/grc/src/gui/Preferences.py   2008-09-17 14:34:27 UTC (rev 
9600)
+++ gnuradio/trunk/grc/src/gui/Preferences.py   2008-09-18 16:56:25 UTC (rev 
9601)
@@ -46,6 +46,7 @@
                        self._prefs_block.import_data(n['block'])
                except: 
Messages.send_fail_load_preferences(self._prefs_file_path)
                ##all params
+               self.window_prefix_param = 
self._prefs_block.get_param('window_prefix')
                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')
@@ -92,6 +93,9 @@
 # Special methods for specific program functionalities
 ###########################################################################
 
+def window_prefix():
+       return _get_prefs().window_prefix_param.get_value()
+
 def window_size(size=None):
        if size: _get_prefs().window_size_param.set_value(size)
        else:





reply via email to

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