commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r5882 - in grc/trunk/src: . Elements Graphics


From: jblum
Subject: [Commit-gnuradio] r5882 - in grc/trunk/src: . Elements Graphics
Date: Sun, 1 Jul 2007 10:49:49 -0600 (MDT)

Author: jblum
Date: 2007-07-01 10:49:49 -0600 (Sun, 01 Jul 2007)
New Revision: 5882

Modified:
   grc/trunk/src/ActionHandler.py
   grc/trunk/src/Elements/Connection.py
   grc/trunk/src/Elements/Element.py
   grc/trunk/src/Elements/GraphicalElement.py
   grc/trunk/src/Elements/GraphicalParam.py
   grc/trunk/src/Elements/GraphicalSignalBlock.py
   grc/trunk/src/Elements/Param.py
   grc/trunk/src/Elements/SignalBlock.py
   grc/trunk/src/Elements/Socket.py
   grc/trunk/src/ExecFlowGraph.py
   grc/trunk/src/ExecFlowGraphGUI.py
   grc/trunk/src/Graphics/Bars.py
   grc/trunk/src/Graphics/Dialogs.py
   grc/trunk/src/Graphics/FileDialogs.py
   grc/trunk/src/Graphics/FlowGraph.py
   grc/trunk/src/Graphics/MainWindow.py
   grc/trunk/src/Graphics/SignalBlockParamsDialog.py
   grc/trunk/src/Graphics/SignalBlockSelectionWindow.py
   grc/trunk/src/Graphics/USRPDiagnostics.py
   grc/trunk/src/Graphics/VariableModificationWindow.py
   grc/trunk/src/Graphics/__init__.py
   grc/trunk/src/StateCache.py
Log:
file dialog clean up, formatting, docs

Modified: grc/trunk/src/ActionHandler.py
===================================================================
--- grc/trunk/src/ActionHandler.py      2007-06-30 23:48:47 UTC (rev 5881)
+++ grc/trunk/src/ActionHandler.py      2007-07-01 16:49:49 UTC (rev 5882)
@@ -38,12 +38,12 @@
        The action handler will setup all the major window components,
        and handle button presses and flow graph operations from the GUI.
        """
+       
        def __init__(self, input_arg_file_path=''): 
                """!
                ActionHandler constructor.
-               Parse the config files for signals blocks and gtk actions. 
Connect the actions to the handler method.
-               Create a new main window, intialize preferences and the message 
handler. 
-               Finally, enter the gtk main loop and block
+               Create the main window, setup the message handler, import the 
preferences, 
+               and connect all of the action handlers. Finally, enter the gtk 
main loop and block.
                @param input_arg_file_path a flow graph file passed from 
command line           
                """                             
                if PY_GTK_ICON: 
gtk.window_set_default_icon_from_file(PY_GTK_ICON)

Modified: grc/trunk/src/Elements/Connection.py
===================================================================
--- grc/trunk/src/Elements/Connection.py        2007-06-30 23:48:47 UTC (rev 
5881)
+++ grc/trunk/src/Elements/Connection.py        2007-07-01 16:49:49 UTC (rev 
5882)
@@ -27,7 +27,9 @@
 
 class Connection(Element.Element):
        """Connection provides elemental interfaces for a connection of 
sockets."""     
+       
        type = 'connection'
+       
        def __init__(self, parent, socket1, socket2):
                """!
                Connection constructor.         

Modified: grc/trunk/src/Elements/Element.py
===================================================================
--- grc/trunk/src/Elements/Element.py   2007-06-30 23:48:47 UTC (rev 5881)
+++ grc/trunk/src/Elements/Element.py   2007-07-01 16:49:49 UTC (rev 5882)
@@ -24,8 +24,11 @@
 from Constants import POSSIBLE_ROTATIONS,DIR_LEFT,DIR_RIGHT
 
 class Element:
-       """Element is the base class for all elements. It contains an X,Y 
coordinate, a list
-       of rectangular areas (and lines) that the element occupies and methods 
to detect selection."""                  
+       """
+       Element is the base class for all elements. It contains an X,Y 
coordinate, a list
+       of rectangular areas (and lines) that the element occupies and methods 
to detect selection.
+       """             
+               
        def __init__(self, parent, coor, rotation):
                """!
                Make a new list of rectangular areas and lines, and set the 
coordinate and the rotation.

Modified: grc/trunk/src/Elements/GraphicalElement.py
===================================================================
--- grc/trunk/src/Elements/GraphicalElement.py  2007-06-30 23:48:47 UTC (rev 
5881)
+++ grc/trunk/src/Elements/GraphicalElement.py  2007-07-01 16:49:49 UTC (rev 
5882)
@@ -30,8 +30,11 @@
 import pango
 
 class GraphicalElement(Element.Element):
-       """     Element is the base class for all graphical elements. It 
contains an X,Y coordinate, a list
-       of rectangular areas that the element occupies and methods to detect 
selection. """             
+       """
+       GraphicalElement is the base class for all graphical elements. 
+       It contains an X,Y coordinate, a list of rectangular areas that the 
element occupies, 
+       and methods to detect selection of those areas.
+       """             
        
        def draw(self, window, BG_color=Colors.BG_COLOR, 
FG_color=Colors.FG_COLOR):
                """!

Modified: grc/trunk/src/Elements/GraphicalParam.py
===================================================================
--- grc/trunk/src/Elements/GraphicalParam.py    2007-06-30 23:48:47 UTC (rev 
5881)
+++ grc/trunk/src/Elements/GraphicalParam.py    2007-07-01 16:49:49 UTC (rev 
5882)
@@ -35,7 +35,8 @@
 
######################################################################################################
 
 class InputParam(gtk.HBox):
-       """ The base class for an input parameter inside the input parameters 
dialog.   """
+       """The base class for an input parameter inside the input parameters 
dialog."""
+       
        def __init__(self, data_type, _handle_changed):
                gtk.HBox.__init__(self)
                self.data_type = data_type
@@ -47,7 +48,8 @@
                self.tp = None          
                
 class EntryParam(InputParam):
-       """ Provide an entry box for strings and numbers.       """
+       """Provide an entry box for strings and numbers."""
+       
        def __init__(self, *args):
                InputParam.__init__(self, *args)
                self.entry = input = gtk.Entry()                
@@ -61,7 +63,8 @@
                self.tp.enable()
                
 class FileParam(EntryParam):
-       """ Provide an entry box for filename and a button to browse for a 
file.        """
+       """Provide an entry box for filename and a button to browse for a 
file."""
+       
        def __init__(self, *args):
                EntryParam.__init__(self, *args)                
                input = gtk.Button('...')
@@ -92,7 +95,8 @@
                file_dialog.destroy()   #destroy the dialog                     
                        
                
 class EnumParam(InputParam):
-       """ Provide an entry box for Enum types with a drop down menu.  """
+       """Provide an entry box for Enum types with a drop down menu."""
+       
        def __init__(self, *args):
                InputParam.__init__(self, *args)
                input = gtk.ComboBox(gtk.ListStore(gobject.TYPE_STRING))        
                        

Modified: grc/trunk/src/Elements/GraphicalSignalBlock.py
===================================================================
--- grc/trunk/src/Elements/GraphicalSignalBlock.py      2007-06-30 23:48:47 UTC 
(rev 5881)
+++ grc/trunk/src/Elements/GraphicalSignalBlock.py      2007-07-01 16:49:49 UTC 
(rev 5882)
@@ -35,6 +35,7 @@
 
 class GraphicalSignalBlock(SignalBlock.SignalBlock, 
GraphicalElement.GraphicalElement):
        """The graphical signal block."""               
+       
        param_constructor = GraphicalParam
        input_socket_constructor = GraphicalInputSocket
        output_socket_constructor = GraphicalOutputSocket

Modified: grc/trunk/src/Elements/Param.py
===================================================================
--- grc/trunk/src/Elements/Param.py     2007-06-30 23:48:47 UTC (rev 5881)
+++ grc/trunk/src/Elements/Param.py     2007-07-01 16:49:49 UTC (rev 5882)
@@ -22,6 +22,7 @@
 
 class Param:
        """A param holds a single signal block parameter: a data type and a 
canonical name."""
+       
        def __init__(self, cname, data_type, variable=False):
                """!
                Param constructor. Set the data type and cname.

Modified: grc/trunk/src/Elements/SignalBlock.py
===================================================================
--- grc/trunk/src/Elements/SignalBlock.py       2007-06-30 23:48:47 UTC (rev 
5881)
+++ grc/trunk/src/Elements/SignalBlock.py       2007-07-01 16:49:49 UTC (rev 
5882)
@@ -28,10 +28,12 @@
 
 class SignalBlock(Element.Element):
        """A SignalBlock is an Element with an index from the list of possible 
signal blocks and input/output sockets."""       
+       
        type = 'signal block'
        param_constructor = Param
        input_socket_constructor = InputSocket
        output_socket_constructor = OutputSocket
+       
        def __init__(self, parent, coor, rotation, tag, id):
                """!
                SignalBlock constructor.

Modified: grc/trunk/src/Elements/Socket.py
===================================================================
--- grc/trunk/src/Elements/Socket.py    2007-06-30 23:48:47 UTC (rev 5881)
+++ grc/trunk/src/Elements/Socket.py    2007-07-01 16:49:49 UTC (rev 5882)
@@ -29,7 +29,9 @@
        A Socket is an input/output element of a signal block. 
        It has an index, input/output setting, and a data type.
        """     
+       
        type = 'socket'
+       
        def __init__(self, parent, cname, index, data_type, optional=False, 
vlen=None):
                """!
                Socket constructor. 

Modified: grc/trunk/src/ExecFlowGraph.py
===================================================================
--- grc/trunk/src/ExecFlowGraph.py      2007-06-30 23:48:47 UTC (rev 5881)
+++ grc/trunk/src/ExecFlowGraph.py      2007-07-01 16:49:49 UTC (rev 5882)
@@ -35,6 +35,7 @@
 class FlowGraphBuilder(gr.top_block):
        """ Parse the input file to build the gnuradio flow graph.
                Register the variables, handle signal block callbacks.  """
+               
        def __init__(self, file_path):          
                gr.top_block.__init__(self, file_path)  
                #internal data structures               
@@ -127,6 +128,7 @@
 class FlowGraphOptionParser(OptionParser):
        """This flow graph option parser provides a basic help, 
        and ensures that a flow graph is passed on the command line."""
+       
        def __init__(self):
                """Create the base option parser and add usage and basic 
options."""                    
                usage = "usage: %prog [options] 
flow_graph"+FLOW_GRAPH_FILE_EXTENSION

Modified: grc/trunk/src/ExecFlowGraphGUI.py
===================================================================
--- grc/trunk/src/ExecFlowGraphGUI.py   2007-06-30 23:48:47 UTC (rev 5881)
+++ grc/trunk/src/ExecFlowGraphGUI.py   2007-07-01 16:49:49 UTC (rev 5882)
@@ -33,6 +33,7 @@
 
##############################################################################################
 class VariableControl(wx.BoxSizer):
        """House a Slider and a Text Box for variable control."""
+       
        def __init__(self, parent, key, parse_callbacks):
                """!
                VariableControl contructor.
@@ -126,10 +127,13 @@
 #      Flow Graph Frame
 
##############################################################################################
 
 class FlowGraphFrame(wx.Frame, FlowGraphBuilder):
-       """A FlowGraphFrame is a wx.Frame and a FlowGraphBuilder. 
+       """
+       A FlowGraphFrame is a wx.Frame and a FlowGraphBuilder. 
        This flow graph frame parses a saved flow graph file,
        houses all the sliders and graphical sinks, 
-       and starts the flow graph."""
+       and starts the flow graph.
+       """
+       
        def __init__(self, file_path):
                """!
                FlowGraphFrame contructor.
@@ -185,8 +189,10 @@
                return self.panel
                
        def _create_sliders(self):
-               """Using the list of variable keys imported by the builder, 
-               create sliders for those variables with ranges."""      
+               """
+               Using the list of variable keys imported by the builder, 
+               create sliders for those variables with ranges.
+               """     
                len = 0         
                for key in self.var_keys:
                        value, min, max, step = Variables.get_values(key)
@@ -206,6 +212,7 @@
 
##############################################################################################
 class FlowGraphApp(wx.App):
        """The FlowGraphApp is the wx.App containing the FlowGraphFrame."""
+       
        def __init__(self, flow_graph_file_path):
                """!
                FlowGraphApp constructor.

Modified: grc/trunk/src/Graphics/Bars.py
===================================================================
--- grc/trunk/src/Graphics/Bars.py      2007-06-30 23:48:47 UTC (rev 5881)
+++ grc/trunk/src/Graphics/Bars.py      2007-07-01 16:49:49 UTC (rev 5882)
@@ -85,43 +85,47 @@
 
 class Toolbar(gtk.Toolbar):
        """The gtk toolbar with actions added from the toolbar list.""" 
+       
        def __init__(self):
-               """Parse the list of action names in the toolbar list. 
-               Look up the action for each name        in the action list and 
add it to the toolbar."""        
+               """
+               Parse the list of action names in the toolbar list. 
+               Look up the action for each name        in the action list and 
add it to the toolbar.
+               """     
                gtk.Toolbar.__init__(self)              
                self.set_style(gtk.TOOLBAR_ICONS) 
                for action_name in TOOLBAR_LIST:
                        if action_name == None:
                                spacer = gtk.SeparatorToolItem()
-                               spacer.show()                           
                                self.add(spacer)
-                       else:
-                               action = get_action_from_name(action_name)      
                
-                               toolitem = action.create_tool_item()
-                               self.add(toolitem)
-                               action.set_property('tooltip', 
action.get_property('tooltip'))
+                       else:   #add a tool item
+                               action = get_action_from_name(action_name)
+                               action.set_property('tooltip', 
action.get_property('tooltip'))  
+                               self.add(action.create_tool_item())
                        
        
 class MenuBar(gtk.MenuBar):
-       """The gtk menu bar with actions added from the menu bar list."""       
                        
+       """The gtk menu bar with actions added from the menu bar list."""       
                
+               
        def __init__(self):
-               """Parse the list of submenus from the menubar list. For each 
submenu, get a list of action names.
-               Look up the action for each name in the action list and add it 
to the submenu. Add the submenu to the menu bar."""
+               """
+               Parse the list of submenus from the menubar list. 
+               For each submenu, get a list of action names.
+               Look up the action for each name in the action list and add it 
to the submenu. 
+               Add the submenu to the menu bar.
+               """
                gtk.MenuBar.__init__(self)
                for main_action,action_names in MENU_BAR_LIST:
-                       # Create the MenuItem
+                       # Create the main menu item
                        main_menu_item = main_action.create_menu_item()
                        self.append(main_menu_item)                     
-                       # Create the Menu
+                       # Create the menu
                        main_menu = gtk.Menu()
                        main_menu_item.set_submenu(main_menu)                   
        
                        for action_name in action_names:
                                if action_name == None:
                                        spacer = gtk.SeparatorMenuItem()
-                                       spacer.show()                           
                                        main_menu.append(spacer)
-                               else:                                   
-                                       # Create a proxy MenuItem
+                               else:   #append a menu item                     
                
                                        menu_item = 
get_action_from_name(action_name).create_menu_item()
                                        main_menu.append(menu_item)
                                

Modified: grc/trunk/src/Graphics/Dialogs.py
===================================================================
--- grc/trunk/src/Graphics/Dialogs.py   2007-06-30 23:48:47 UTC (rev 5881)
+++ grc/trunk/src/Graphics/Dialogs.py   2007-07-01 16:49:49 UTC (rev 5882)
@@ -31,6 +31,7 @@
 
 class TextDisplay(gtk.TextView):
        """A non editable gtk text view."""
+       
        def __init__(self, text=''):
                """!
                TextDisplay constructor.
@@ -48,6 +49,7 @@
 
######################################################################################################
 class PreferencesDialog(gtk.Dialog):
        """A dialog box to display the preferences."""
+       
        def __init__(self):
                """PreferencesDialog constructor."""
                gtk.Dialog.__init__(self, buttons=('gtk-close', 
gtk.RESPONSE_CLOSE))
@@ -73,6 +75,7 @@
 
######################################################################################################
 class FlowGraphWindowSizeDialog(gtk.Dialog):
        """A dialog box to set the window size, width and heigh in pixels."""
+       
        def __init__(self, dimensions):
                """!
                FlowGraphWindowSizeDialog constructor.
@@ -127,6 +130,7 @@
 
######################################################################################################
 class AboutDialog(gtk.AboutDialog):
        """A cute little about dialog."""
+       
        def __init__(self):
                """AboutDialog constructor."""
                gtk.AboutDialog.__init__(self)
@@ -153,6 +157,7 @@
 
######################################################################################################
                 
 class DataTypesDialog(gtk.Dialog):
        """Display each data type with its associated color."""
+       
        def __init__(self):
                """DataTypesDialog constructor."""
                gtk.Dialog.__init__(self, buttons=('gtk-close', 
gtk.RESPONSE_CLOSE))
@@ -188,6 +193,7 @@
 
######################################################################################################
                 
 class HotKeysDialog(gtk.Dialog):
        """Display each action with the associated hotkey."""
+       
        def __init__(self):
                """HotKeysDialog constructor."""
                gtk.Dialog.__init__(self, buttons=('gtk-close', 
gtk.RESPONSE_CLOSE))
@@ -222,6 +228,7 @@
 
######################################################################################################
                 
 class MathExprDialog(gtk.Dialog):
        """A dialog to test math expressions for the parser."""
+       
        ##the help message
        HELP_MSG = """\
 <b>Operators - Complex   <i>(complex arguments)</i></b> 
@@ -253,6 +260,7 @@
        () (num1,) (num2, num2, ...)    
 <b>Test Your Expressions Below:</b>\
 """
+
        def __init__(self):
                """MathExprDialog constrcutor. Create a new gtk Dialog with a 
close button, an extry box, and an output text box."""            
                gtk.Dialog.__init__(self, buttons=('gtk-close', 
gtk.RESPONSE_CLOSE))

Modified: grc/trunk/src/Graphics/FileDialogs.py
===================================================================
--- grc/trunk/src/Graphics/FileDialogs.py       2007-06-30 23:48:47 UTC (rev 
5881)
+++ grc/trunk/src/Graphics/FileDialogs.py       2007-07-01 16:49:49 UTC (rev 
5882)
@@ -31,60 +31,71 @@
 SAVE_FLOW_GRAPH = 'save flow graph'
 SAVE_IMAGE = 'save image'
 
-class FileDialog(gtk.FileChooserDialog):
-       """A dialog box to save or open flow graph files. This is a base class, 
do not use."""
+##the filter for flow graph files
+FLOW_GRAPH_FILE_FILTER = gtk.FileFilter()
+FLOW_GRAPH_FILE_FILTER.set_name('FG Files')
+FLOW_GRAPH_FILE_FILTER.add_pattern('*'+FLOW_GRAPH_FILE_EXTENSION)
+
+##the filter for image files
+IMAGE_FILE_FILTER = gtk.FileFilter()
+IMAGE_FILE_FILTER.set_name('Image Files')
+IMAGE_FILE_FILTER.add_pattern('*'+IMAGE_FILE_EXTENSION)
+
+##the filter for all files
+ALL_FILE_FILTER = gtk.FileFilter()
+ALL_FILE_FILTER.set_name('All Files')
+ALL_FILE_FILTER.add_pattern('*')       
+
+class FileDialogHelper(gtk.FileChooserDialog):
+       """
+       A wrapper class for the gtk file chooser dialog. 
+       Implement a file chooser dialog with only necessary parameters.
+       """
        
-       ##the filter for flow graph files
-       flow_graph_files_filter = gtk.FileFilter()
-       flow_graph_files_filter.set_name('FG Files')
-       flow_graph_files_filter.add_pattern('*'+FLOW_GRAPH_FILE_EXTENSION)
-       
-       ##the filter for image files
-       image_files_filter = gtk.FileFilter()
-       image_files_filter.set_name('Image Files')
-       image_files_filter.add_pattern('*'+IMAGE_FILE_EXTENSION)
-       #image_files_filter.add_pixbuf_formats()
-       
-       ##the filter for all files
-       all_files_filter = gtk.FileFilter()
-       all_files_filter.set_name('All Files')
-       all_files_filter.add_pattern('*')       
-       
-       def __init__(self, current_file_path):
+       def __init__(self, action, title):
                """!
-               FileDialog constructor.         
-               Create a new gtk.FileChooserDialog, type specifies what filter 
to use:
-               open and save are for flow graphs, save image is for 
screenshots.
-               @param current_file_path the current directory
+               FileDialogHelper contructor.
+               Create a save or open dialog with cancel and ok buttons.
+               Use standard settings: no multiple selection, local files only, 
and the * filter.
+               @param action gtk.FILE_CHOOSER_ACTION_OPEN or 
gtk.FILE_CHOOSER_ACTION_SAVE
+               @param title the title of the dialog (string)
                """
-               if current_file_path == '': current_file_path = 
DEFAULT_FILE_PATH+NEW_FLOGRAPH_TITLE+FLOW_GRAPH_FILE_EXTENSION
+               ok_stock = {gtk.FILE_CHOOSER_ACTION_OPEN : 'gtk-open', 
gtk.FILE_CHOOSER_ACTION_SAVE : 'gtk-save'}[action]
+               gtk.FileChooserDialog.__init__(self, title, None, action, 
('gtk-cancel', gtk.RESPONSE_CANCEL, ok_stock, gtk.RESPONSE_OK))               
+               self.set_select_multiple(False)
+               self.set_local_only(True)
+               self.add_filter(ALL_FILE_FILTER)
+
+class FileDialog(FileDialogHelper):
+       """A dialog box to save or open flow graph files. This is a base class, 
do not use."""
+               
+       def __init__(self, current_file_path=''):
+               """!
+               FileDialog constructor. 
+               @param current_file_path the current directory or path to the 
open flow graph
+               """
+               if not current_file_path: current_file_path = 
DEFAULT_FILE_PATH+NEW_FLOGRAPH_TITLE+FLOW_GRAPH_FILE_EXTENSION
                if self.type == OPEN_FLOW_GRAPH:
-                       gtk.FileChooserDialog.__init__(self, 'Open a Flow Graph 
from a File...', None,
-                               gtk.FILE_CHOOSER_ACTION_OPEN, 
('gtk-cancel',gtk.RESPONSE_CANCEL,'gtk-open',gtk.RESPONSE_OK))
-                       self.add_filter(self.flow_graph_files_filter)
-                       self.set_filter(self.flow_graph_files_filter)
-                       self.add_filter(self.all_files_filter)
+                       FileDialogHelper.__init__(self, 
gtk.FILE_CHOOSER_ACTION_OPEN, 'Open a Flow Graph from a File...')
+                       self.add_and_set_filter(FLOW_GRAPH_FILE_FILTER)
                elif self.type == SAVE_FLOW_GRAPH:
-                       gtk.FileChooserDialog.__init__(self, 'Save a Flow Graph 
to a File...', None,
-                               gtk.FILE_CHOOSER_ACTION_SAVE, 
('gtk-cancel',gtk.RESPONSE_CANCEL, 'gtk-save',gtk.RESPONSE_OK))
-                       #self.set_do_overwrite_confirmation(True) #enable this 
when u get it working with auto-extension        
-                       self.add_filter(self.flow_graph_files_filter)
-                       self.set_filter(self.flow_graph_files_filter)
-                       self.add_filter(self.all_files_filter)  
+                       FileDialogHelper.__init__(self, 
gtk.FILE_CHOOSER_ACTION_SAVE, 'Save a Flow Graph to a File...') 
+                       self.add_and_set_filter(FLOW_GRAPH_FILE_FILTER)
                        self.set_current_name(path.basename(current_file_path)) 
#show the current filename
                elif self.type == SAVE_IMAGE:
-                       gtk.FileChooserDialog.__init__(self, 'Save a Flow Graph 
Screen Shot...', None,
-                               gtk.FILE_CHOOSER_ACTION_SAVE, 
('gtk-cancel',gtk.RESPONSE_CANCEL, 'gtk-save',gtk.RESPONSE_OK))
-                       #self.set_do_overwrite_confirmation(True) #enable this 
when u get it working with auto-extension        
-                       self.add_filter(self.image_files_filter)
-                       self.set_filter(self.image_files_filter)
-                       self.add_filter(self.all_files_filter)          
+                       FileDialogHelper.__init__(self, 
gtk.FILE_CHOOSER_ACTION_SAVE, 'Save a Flow Graph Screen Shot...')
+                       self.add_and_set_filter(IMAGE_FILE_FILTER)
                        current_file_path = current_file_path + 
IMAGE_FILE_EXTENSION    
                        self.set_current_name(path.basename(current_file_path)) 
#show the current filename              
-               self.set_current_folder(path.dirname(current_file_path))        
#current directory 
-               #self.set_show_hidden(False)    #doesnt seem to work ;-)
-               self.set_select_multiple(False)
-               self.set_local_only(True)
+               self.set_current_folder(path.dirname(current_file_path))        
#current directory      
+               
+       def add_and_set_filter(self, filter):
+               """!
+               Add the gtk file filter to the list of filters and set it as 
the default file filter.
+               @param filter a gtk file filter.
+               """
+               self.add_filter(filter)
+               self.set_filter(filter)
 
        def get_rectified_filename(self):
                """!
@@ -100,15 +111,15 @@
                        #############################################
                        if self.type in (SAVE_FLOW_GRAPH, SAVE_IMAGE):          
                        
                                for extension,filter in (
-                                       (FLOW_GRAPH_FILE_EXTENSION, 
self.flow_graph_files_filter), 
-                                       (IMAGE_FILE_EXTENSION, 
self.image_files_filter)
+                                       (FLOW_GRAPH_FILE_EXTENSION, 
FLOW_GRAPH_FILE_FILTER), 
+                                       (IMAGE_FILE_EXTENSION, 
IMAGE_FILE_FILTER)
                                ): #append the missing file extension if the 
filter matches
                                        if      
filename[len(filename)-len(extension):] != extension and filter == 
self.get_filter(): filename = filename + extension                   
                                self.set_current_name(path.basename(filename))  
#show the filename with extension                               
                                if path.exists(filename): #ask the user to 
confirm overwrite                                            
                                        if MessageDialogHelper(
                                                gtk.MESSAGE_QUESTION, 
gtk.BUTTONS_YES_NO, 'Confirm Overwrite!',
-                                               'File "%s" Exists!\nWould you 
like to overwrite the existing file?'%filename,
+                                               'File <b>"%s"</b> 
Exists!\nWould you like to overwrite the existing file?'%filename,
                                        ) == gtk.RESPONSE_NO: filename = 
self.get_rectified_filename()                  
                        #############################################
                        # Handle Open Dialogs
@@ -117,7 +128,7 @@
                                if not path.exists(filename): #show a warning 
and re-run
                                        MessageDialogHelper(
                                                gtk.MESSAGE_WARNING, 
gtk.BUTTONS_CLOSE, 'Cannot Open!',
-                                               'File "%s" Does not 
Exist!'%filename,
+                                               'File <b>"%s"</b> Does not 
Exist!'%filename,
                                        )       
                                        filename = self.get_rectified_filename()
                        return filename 

Modified: grc/trunk/src/Graphics/FlowGraph.py
===================================================================
--- grc/trunk/src/Graphics/FlowGraph.py 2007-06-30 23:48:47 UTC (rev 5881)
+++ grc/trunk/src/Graphics/FlowGraph.py 2007-07-01 16:49:49 UTC (rev 5882)
@@ -40,10 +40,15 @@
 import Messages
 
 class FlowGraph(gtk.DrawingArea):
-       """FlowGraph is the data structure to store graphical signal blocks, 
-       their graphical input/output parameters, and the connections between 
inputs and outputs."""             
+       """
+       FlowGraph is the data structure to store graphical signal blocks, 
+       graphical inputs and outputs, 
+       and the connections between inputs and outputs.
+       """     
+               
        signal_block_constructor = GraphicalSignalBlock
        connection_contructor = GraphicalConnection     
+       
        def __init__(self, handle_states, variable_modification_window):
                """!
                FlowGraph contructor.

Modified: grc/trunk/src/Graphics/MainWindow.py
===================================================================
--- grc/trunk/src/Graphics/MainWindow.py        2007-06-30 23:48:47 UTC (rev 
5881)
+++ grc/trunk/src/Graphics/MainWindow.py        2007-07-01 16:49:49 UTC (rev 
5882)
@@ -33,6 +33,7 @@
 
 class MainWindow(gtk.Window):
        """The topmost window with menus, the tool bar, and other major 
windows."""
+       
        def __init__(self, handle_states):
                """!
                MainWindow contructor.

Modified: grc/trunk/src/Graphics/SignalBlockParamsDialog.py
===================================================================
--- grc/trunk/src/Graphics/SignalBlockParamsDialog.py   2007-06-30 23:48:47 UTC 
(rev 5881)
+++ grc/trunk/src/Graphics/SignalBlockParamsDialog.py   2007-07-01 16:49:49 UTC 
(rev 5882)
@@ -28,6 +28,7 @@
 
 class SignalBlockParamsDialog(gtk.Dialog):
        """A dialog box to set signal block parameters."""
+       
        def __init__(self, signal_block):
                """!
                SignalBlockParamsDialog contructor.

Modified: grc/trunk/src/Graphics/SignalBlockSelectionWindow.py
===================================================================
--- grc/trunk/src/Graphics/SignalBlockSelectionWindow.py        2007-06-30 
23:48:47 UTC (rev 5881)
+++ grc/trunk/src/Graphics/SignalBlockSelectionWindow.py        2007-07-01 
16:49:49 UTC (rev 5882)
@@ -29,6 +29,7 @@
 
 class SignalBlockSelectionWindow(gtk.VBox):
        """The signal block selection window."""
+       
        def __init__(self, flow_graph):
                """!
                SignalBlockSelectionWindow constructor.

Modified: grc/trunk/src/Graphics/USRPDiagnostics.py
===================================================================
--- grc/trunk/src/Graphics/USRPDiagnostics.py   2007-06-30 23:48:47 UTC (rev 
5881)
+++ grc/trunk/src/Graphics/USRPDiagnostics.py   2007-07-01 16:49:49 UTC (rev 
5882)
@@ -36,8 +36,11 @@
        except ImportError: print "USRP support missing -> USRP diagnostics 
disabled..."        
 
 class USRPDiagnosticsDialog(gtk.Dialog):
-       """The main dialog window for USRP Dignostics. 
-       The USRP parameters and feedback will be located inside this dialog."""
+       """
+       The main dialog window for USRP Dignostics. 
+       The USRP parameters and feedback will be located inside this dialog.
+       """
+       
        def __init__(self):
                """USRPDiagnosticsDialog contructor.
                Create a new gtk Dialog with a close button, USRP input 
paramaters, and output labels."""               

Modified: grc/trunk/src/Graphics/VariableModificationWindow.py
===================================================================
--- grc/trunk/src/Graphics/VariableModificationWindow.py        2007-06-30 
23:48:47 UTC (rev 5881)
+++ grc/trunk/src/Graphics/VariableModificationWindow.py        2007-07-01 
16:49:49 UTC (rev 5882)
@@ -30,6 +30,7 @@
 
 class VariableModificationWindow(gtk.VBox):
        """A scrollable window to add/remove variables in the variable 
registry."""
+       
        def __init__(self, handle_states):
                """!
                VariableModificationWindow constructor.Create a scrolled 
window, and add buttons and lists.

Modified: grc/trunk/src/Graphics/__init__.py
===================================================================
--- grc/trunk/src/Graphics/__init__.py  2007-06-30 23:48:47 UTC (rev 5881)
+++ grc/trunk/src/Graphics/__init__.py  2007-07-01 16:49:49 UTC (rev 5882)
@@ -20,7 +20,7 @@
 #GTK based classes go into this package.
 address@hidden Josh Blum
 
-#      only import the modules that need external access #
+#only import the modules that need external access
 from MainWindow import MainWindow
 from FileDialogs import 
OpenFlowGraphFileDialog,SaveFlowGraphFileDialog,SaveImageFileDialog
 from Dialogs import 
PreferencesDialog,FlowGraphWindowSizeDialog,MessageDialogHelper,AboutDialog,DataTypesDialog,HotKeysDialog,MathExprDialog

Modified: grc/trunk/src/StateCache.py
===================================================================
--- grc/trunk/src/StateCache.py 2007-06-30 23:48:47 UTC (rev 5881)
+++ grc/trunk/src/StateCache.py 2007-07-01 16:49:49 UTC (rev 5882)
@@ -29,6 +29,7 @@
        States are recorded into the list in a circular fassion by using an 
index for the current state,
        and counters for the range where states are stored.
        """     
+       
        def __init__(self, initial_state):
                """!
                StateCache constructor.





reply via email to

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