commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r10856 - in gnuradio/branches/developers/jblum/grc/grc


From: jblum
Subject: [Commit-gnuradio] r10856 - in gnuradio/branches/developers/jblum/grc/grc/src: gui platforms/base
Date: Wed, 15 Apr 2009 22:53:22 -0600 (MDT)

Author: jblum
Date: 2009-04-15 22:53:22 -0600 (Wed, 15 Apr 2009)
New Revision: 10856

Modified:
   gnuradio/branches/developers/jblum/grc/grc/src/gui/Actions.py
   gnuradio/branches/developers/jblum/grc/grc/src/gui/BlockTreeWindow.py
   gnuradio/branches/developers/jblum/grc/grc/src/gui/Dialogs.py
   gnuradio/branches/developers/jblum/grc/grc/src/gui/DrawingArea.py
   gnuradio/branches/developers/jblum/grc/grc/src/gui/ParamsDialog.py
   gnuradio/branches/developers/jblum/grc/grc/src/platforms/base/Platform.py
Log:
little tweaks

Modified: gnuradio/branches/developers/jblum/grc/grc/src/gui/Actions.py
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/src/gui/Actions.py       
2009-04-16 00:37:49 UTC (rev 10855)
+++ gnuradio/branches/developers/jblum/grc/grc/src/gui/Actions.py       
2009-04-16 04:53:22 UTC (rev 10856)
@@ -83,6 +83,7 @@
        FLOW_GRAPH_EXEC: ('F6', 0),
        FLOW_GRAPH_KILL: ('F7', 0),
        FLOW_GRAPH_SCREEN_CAPTURE: ('Print', 0),
+       HELP_WINDOW_DISPLAY: ('F1', 0),
 }
 
 
######################################################################################################

Modified: gnuradio/branches/developers/jblum/grc/grc/src/gui/BlockTreeWindow.py
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/src/gui/BlockTreeWindow.py       
2009-04-16 00:37:49 UTC (rev 10855)
+++ gnuradio/branches/developers/jblum/grc/grc/src/gui/BlockTreeWindow.py       
2009-04-16 04:53:22 UTC (rev 10856)
@@ -63,12 +63,11 @@
                scrolled_window.set_size_request(DEFAULT_BLOCKS_WINDOW_WIDTH, 
-1)
                self.pack_start(scrolled_window)
                #add button
-               self.add_button = gtk.Button(None, 'gtk-add')
+               self.add_button = gtk.Button(None, gtk.STOCK_ADD)
                self.add_button.connect('clicked', self._handle_add_button)
                self.pack_start(self.add_button, False)
-               #map categories to iters
-               self.categories = dict()
-               self.categories[tuple()] = None
+               #map categories to iters, automatic mapping for root
+               self._categories = {tuple(): None}
                #add blocks and categories
                self.platform.load_block_tree(self)
                #initialize
@@ -81,22 +80,21 @@
                """
                Add a block with category to this selection window.
                Add only the category when block is None.
-               @param category the category string
+               @param category the category list
                @param block the block object or None
                """
-               #rectify category
-               category = filter(lambda x: x, category.split('/'))
+               category = tuple(category)[1:] #tuple is hashable
                #add category and all sub categories
-               for i in range(len(category)):
-                       sub_category = tuple(category[:i+1])
-                       if sub_category not in self.categories.keys():
-                               iter = 
self.treestore.insert_before(self.categories[tuple(category[:i])], None)
-                               self.treestore.set_value(iter, NAME_INDEX, '[ 
%s ]'%category[i])
+               for i, cat_name in enumerate(category):
+                       sub_category = category[:i+1]
+                       if sub_category not in self._categories:
+                               iter = 
self.treestore.insert_before(self._categories[sub_category[:-1]], None)
+                               self.treestore.set_value(iter, NAME_INDEX, '[ 
%s ]'%cat_name)
                                self.treestore.set_value(iter, KEY_INDEX, '')
-                               self.categories[sub_category] = iter
+                               self._categories[sub_category] = iter
                #add block
                if block is None: return
-               iter = 
self.treestore.insert_before(self.categories[tuple(category)], None)
+               iter = self.treestore.insert_before(self._categories[category], 
None)
                self.treestore.set_value(iter, NAME_INDEX, block.get_name())
                self.treestore.set_value(iter, KEY_INDEX, block.get_key())
 

Modified: gnuradio/branches/developers/jblum/grc/grc/src/gui/Dialogs.py
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/src/gui/Dialogs.py       
2009-04-16 00:37:49 UTC (rev 10855)
+++ gnuradio/branches/developers/jblum/grc/grc/src/gui/Dialogs.py       
2009-04-16 04:53:22 UTC (rev 10856)
@@ -87,12 +87,14 @@
                type=gtk.MESSAGE_INFO,
                buttons=gtk.BUTTONS_CLOSE,
                title='Help',
-               markup="""
+               markup="""\
 <b>Usage Tips</b>
- * <u>Add block</u>: double click on a block in the block selection window.
- * <u>Make connection</u>: click on the source port of one block, then click 
on the sink port of another block.
- * <u>Remove connection</u>: select the connection and press delete, or drag 
the connection.
- * <u>Edit parameters</u>: double click on a block in the flow graph.
- * <u>Type Change</u>: Select a block, press up/down on the keyboard.
- * <u>Rotation</u>: Select a block, press left/right on the keyboard.
-""")
+
+<u>Add block</u>: drag and drop or double click a block in the block selection 
window.
+<u>Rotate block</u>: Select a block, press left/right on the keyboard.
+<u>Change type</u>: Select a block, press up/down on the keyboard.
+<u>Edit parameters</u>: double click on a block in the flow graph.
+<u>Make connection</u>: click on the source port of one block, then click on 
the sink port of another block.
+<u>Remove connection</u>: select the connection and press delete, or drag the 
connection.
+
+* See the menu for other keyboard shortcuts.""")

Modified: gnuradio/branches/developers/jblum/grc/grc/src/gui/DrawingArea.py
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/src/gui/DrawingArea.py   
2009-04-16 00:37:49 UTC (rev 10855)
+++ gnuradio/branches/developers/jblum/grc/grc/src/gui/DrawingArea.py   
2009-04-16 04:53:22 UTC (rev 10856)
@@ -57,8 +57,8 @@
                #setup the focus flag
                self._focus_flag = False
                self.get_focus_flag = lambda: self._focus_flag
-               self.connect("leave-notify-event", self._handle_focus_event, 
False)
-               self.connect("enter-notify-event", self._handle_focus_event, 
True)
+               self.connect('leave-notify-event', self._handle_focus_event, 
False)
+               self.connect('enter-notify-event', self._handle_focus_event, 
True)
                #pixmap for drawing
                self.pixmap = None
 
@@ -85,7 +85,6 @@
                        double_click=(event.type == gtk.gdk._2BUTTON_PRESS),
                        coordinate=(event.x, event.y),
                )
-               return True
 
        def _handle_mouse_button_release(self, widget, event):
                """
@@ -96,7 +95,6 @@
                        left_click=(event.button == 1),
                        coordinate=(event.x, event.y),
                )
-               return True
 
        def _handle_mouse_motion(self, widget, event):
                """
@@ -106,7 +104,6 @@
                self._main_window.get_flow_graph().handle_mouse_motion(
                        coordinate=(event.x, event.y),
                )
-               return True
 
        def _handle_window_expose(self, widget, event):
                """

Modified: gnuradio/branches/developers/jblum/grc/grc/src/gui/ParamsDialog.py
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/src/gui/ParamsDialog.py  
2009-04-16 00:37:49 UTC (rev 10855)
+++ gnuradio/branches/developers/jblum/grc/grc/src/gui/ParamsDialog.py  
2009-04-16 04:53:22 UTC (rev 10856)
@@ -1,5 +1,5 @@
 """
-Copyright 2007 Free Software Foundation, Inc.
+Copyright 2007, 2008, 2009 Free Software Foundation, Inc.
 This file is part of GNU Radio
 
 GNU Radio Companion is free software; you can redistribute it and/or
@@ -47,7 +47,7 @@
                """
                gtk.Dialog.__init__(self,
                        title='Properties: %s'%block.get_name(),
-                       buttons=('gtk-close', gtk.RESPONSE_CLOSE),
+                       buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE),
                )
                self.block = block
                self.set_size_request(MIN_DIALOG_WIDTH, MIN_DIALOG_HEIGHT)

Modified: 
gnuradio/branches/developers/jblum/grc/grc/src/platforms/base/Platform.py
===================================================================
--- gnuradio/branches/developers/jblum/grc/grc/src/platforms/base/Platform.py   
2009-04-16 00:37:49 UTC (rev 10855)
+++ gnuradio/branches/developers/jblum/grc/grc/src/platforms/base/Platform.py   
2009-04-16 04:53:22 UTC (rev 10856)
@@ -92,9 +92,9 @@
                @param block_tree the block tree object
                """
                #recursive function to load categories and blocks
-               def load_category(cat_n, parent=''):
+               def load_category(cat_n, parent=[]):
                        #add this category
-                       parent = '%s/%s'%(parent, cat_n.find('name'))
+                       parent = parent + [cat_n.find('name')]
                        block_tree.add_block(parent)
                        #recursive call to load sub categories
                        map(lambda c: load_category(c, parent), 
cat_n.findall('cat'))





reply via email to

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