moved some constants
authorjblum <jblum@221aa14e-8319-0410-a670-987f0aec2ac5>
Thu, 18 Sep 2008 16:56:25 +0000 (16:56 +0000)
committerjblum <jblum@221aa14e-8319-0410-a670-987f0aec2ac5>
Thu, 18 Sep 2008 16:56:25 +0000 (16:56 +0000)
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9601 221aa14e-8319-0410-a670-987f0aec2ac5

grc/data/platforms/python/blocks/preferences.xml
grc/data/platforms/python/flow_graph.tmpl
grc/src/gui/Constants.py
grc/src/gui/Dialogs.py
grc/src/gui/MainWindow.py
grc/src/gui/Messages.py
grc/src/gui/Preferences.py

index e426b5a34706d5e0e20cdbd717a3844c48b8f844..62f7e17c10277de6699c5e15b1effbb489be6374 100644 (file)
                <value>.grc</value>
                <type>string</type>
        </param>
                <value>.grc</value>
                <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>
        <param>
                <name>File Open</name>
                <key>file_open</key>
index 2341ef46fb64b148e865193a9a144502fbcb27ce..0d02d258e63117a9a440c763abdb49bb0d815cf0 100644 (file)
@@ -42,13 +42,13 @@ $imp
 #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
 #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,
 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'
                        icon="$(os.path.join($DATA_DIR, 'grc-icon-32.png'))",
                )
 #elif $generate_options == 'no_gui'
index 2f6af9a1f3b4614f400472731f768fc28ddd30fe..804fff4c9a45a303d74dd4c81ae08f7d8cb49366 100644 (file)
@@ -17,66 +17,34 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 """
 
 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'
 
 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'
 DIR_LEFT = 'left'
-
-##direction of rotation right.
 DIR_RIGHT = 'right'
 
 DIR_RIGHT = 'right'
 
-##################################################
-## Dimension constraints for the various windows (in pixels)
-##################################################
-
 ##main window constraints
 MIN_WINDOW_WIDTH = 600
 MIN_WINDOW_HEIGHT = 400
 ##main window constraints
 MIN_WINDOW_WIDTH = 600
 MIN_WINDOW_HEIGHT = 400
-
 ##dialog constraints
 MIN_DIALOG_WIDTH = 500
 MIN_DIALOG_HEIGHT = 500
 ##dialog constraints
 MIN_DIALOG_WIDTH = 500
 MIN_DIALOG_HEIGHT = 500
-
 ##static height of reports window
 REPORTS_WINDOW_HEIGHT = 100
 ##static height of reports window
 REPORTS_WINDOW_HEIGHT = 100
-
 ##static width of block selection window
 BLOCK_SELECTION_WINDOW_WIDTH = 200
 
 ##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 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
 ##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
 ##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
 ##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
 
 ##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
 ##The size of the state saving cache in the flow graph (for undo/redo functionality)
 STATE_CACHE_SIZE = 42
index f7ba2954b851d267d070100cf01a9a648621783f..415a53c9393760d5dd56811b8dac2963ba1f692f 100644 (file)
@@ -20,9 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 import pygtk
 pygtk.require('2.0')
 import gtk
 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
 
 from .. platforms.base.Constants import VERSION
 import Preferences
 
@@ -88,20 +86,21 @@ class AboutDialog(gtk.AboutDialog):
                """AboutDialog constructor."""
                gtk.AboutDialog.__init__(self)
                self.set_version(VERSION)
                """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_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.
                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
 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
 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()
 
                self.run()
                self.destroy()
 
index e4c60fce522929347b8dc53a67b5f1344e3cb6ce..16bbd8dba9f50795bcab91d5c92820da1d33c6c8 100644 (file)
@@ -19,8 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 
 from Constants import \
        MIN_WINDOW_WIDTH, MIN_WINDOW_HEIGHT, \
 
 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
 from .. platforms.base.Constants import FLOW_GRAPH_FILE_EXTENSION
 from Actions import APPLICATION_QUIT, FLOW_GRAPH_KILL
 import pygtk
@@ -241,7 +240,7 @@ class MainWindow(gtk.Window):
                """
                if self.get_page():
                        title = ''.join((
                """
                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
                                        ' - Editing: ',
                                        (self.get_page().get_file_path() or NEW_FLOGRAPH_TITLE),
                                        (self.get_page().get_saved() and ' ' or '*'), #blank must be non empty
index 1d9a8021117062da0cfc16361ce421b7afcabe38..8f6a280480b42cb707f40bf12b3cad31e8f8dab5 100644 (file)
@@ -45,7 +45,7 @@ register_messenger(sys.stdout.write)
 # Special functions for specific program functionalities
 ###########################################################################
 def send_init():
 # 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)
 
 def send_page_switch(file_path):
        send('\nShowing: "%s"\n'%file_path)
index fc06d924641e464d0471ee71e8b6698138c94365..08b3da5cc68d948fa3f673866d537e46f96b494e 100644 (file)
@@ -46,6 +46,7 @@ class _Preferences(object):
                        self._prefs_block.import_data(n['block'])
                except: Messages.send_fail_load_preferences(self._prefs_file_path)
                ##all params
                        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')
                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 @@ Restore previously opened files on start-up.
 # Special methods for specific program functionalities
 ###########################################################################
 
 # 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:
 def window_size(size=None):
        if size: _get_prefs().window_size_param.set_value(size)
        else: