[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: geda_manager.git: branch: master updated (809d6f20259582f970e57cb521a2706d26c187a5)



The branch, master has been updated
       via  809d6f20259582f970e57cb521a2706d26c187a5 (commit)
      from  f066a7885aad1554ee3d237ecd6254a43cd6a7ef (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 INSTALL                     |    2 +-
 images/bitmaps/nglogo.jpg   |  Bin 0 -> 917 bytes
 src/gui/MainWindow.py       |    7 +-
 src/gui/NewProject.py       |   10 +-
 src/gui/Preferences.py      |   31 +++---
 src/utils/Callbacks.py      |  252 +++++++++++++++++-------------------------
 src/utils/DependencyLoop.py |   25 +++--
 src/utils/Helpers.py        |   91 ++++++++--------
 src/utils/Icons.py          |   16 ++-
 src/utils/Project.py        |    2 +-
 src/utils/Settings.py       |   29 +++--
 11 files changed, 215 insertions(+), 250 deletions(-)
 create mode 100644 images/bitmaps/nglogo.jpg


=================
 Commit Messages
=================

commit 809d6f20259582f970e57cb521a2706d26c187a5
Author: Newell Jensen <jensen@xxxxxxxxxxxxxxxx>
Date:   Thu Dec 25 02:03:45 2008 -0800

    Cleaing up code, bugs, and added new functionality to
    the Preferences class.  Added a new icon for ngspice.

:100644 100644 b77cef4... 7ef44aa... M	INSTALL
:000000 100644 0000000... ee61a67... A	images/bitmaps/nglogo.jpg
:100644 100644 7c12263... 45e7f09... M	src/gui/MainWindow.py
:100644 100644 6cd9bea... 454c48a... M	src/gui/NewProject.py
:100644 100644 4682e8d... 1140ff5... M	src/gui/Preferences.py
:100644 100644 99445a3... 290d610... M	src/utils/Callbacks.py
:100644 100644 f2485e9... 5b1af6c... M	src/utils/DependencyLoop.py
:100644 100644 c8a0b57... 984fdd0... M	src/utils/Helpers.py
:100644 100644 b361747... 24e8751... M	src/utils/Icons.py
:100644 100644 818a413... 65f69c7... M	src/utils/Project.py
:100644 100644 5b6818c... 1eae840... M	src/utils/Settings.py

=========
 Changes
=========

commit 809d6f20259582f970e57cb521a2706d26c187a5
Author: Newell Jensen <jensen@xxxxxxxxxxxxxxxx>
Date:   Thu Dec 25 02:03:45 2008 -0800

    Cleaing up code, bugs, and added new functionality to
    the Preferences class.  Added a new icon for ngspice.

diff --git a/INSTALL b/INSTALL
index b77cef4..7ef44aa 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,6 +1,6 @@
 Currently there is no special installation but there will be with
 the first official release.
 
-For now, simply run src/gedamanager.py
+For now, simply run ./gedamanager
 
 
diff --git a/images/bitmaps/nglogo.jpg b/images/bitmaps/nglogo.jpg
new file mode 100644
index 0000000..ee61a67
Binary files /dev/null and b/images/bitmaps/nglogo.jpg differ
diff --git a/src/gui/MainWindow.py b/src/gui/MainWindow.py
index 7c12263..45e7f09 100644
--- a/src/gui/MainWindow.py
+++ b/src/gui/MainWindow.py
@@ -18,7 +18,7 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 """
 
-import vte
+from vte import Terminal
 from src.utils.Callbacks import *
 from src.utils.Helpers import set_menu_defaults, set_sources_tree_to_project,\
      set_dependencies_tree_to_project
@@ -216,6 +216,7 @@ class MainWindow(gtk.Window):
         column = gtk.TreeViewColumn(None, sources_cell, text=1)
         column.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE)
         self.sources_tree.append_column(column)
+        self.sources_tree.set_property('headers-visible', True)
         
         # Processes Tree View
         self.processes_tree = gtk.TreeView(self.processes)
@@ -260,7 +261,7 @@ class MainWindow(gtk.Window):
 
         # Allow drag and drop reordering of rows
         self.dependencies_tree.set_reorderable(True)
-
+        
         # set tooltip columns
         self.sources_tree.set_tooltip_column(2)
         self.dependencies_tree.set_tooltip_column(1)
@@ -287,7 +288,7 @@ class MainWindow(gtk.Window):
             os.chdir(self.project.directory)
         except:
             pass
-        self.terminal = vte.Terminal()
+        self.terminal = Terminal()
         self.terminal.connect('child-exited', lambda term: cb_vte(self))
         self.terminal.fork_command()
         self.terminal.show()
diff --git a/src/gui/NewProject.py b/src/gui/NewProject.py
index 6cd9bea..454c48a 100644
--- a/src/gui/NewProject.py
+++ b/src/gui/NewProject.py
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #New Project window for the gEDA Manager
 #@author Newell Jensen
 
-import os, sys, gtk
+import os, sys, gtk, shutil
 
 class NewProject:
     """
@@ -260,14 +260,14 @@ class NewProject:
     def cb_close(self, assistant):
         """!
         Method is called when the NewProject object is closed.
-        @param assistant gtk.Assistant object
+        @param assistant gtk.Assistant object used in wizard.
         """
         self.assistant.destroy()
 
     def cb_cancel(self, assistant):
         """!
         Method is called when the the user chooses 'cancel'.
-        @param assistant gtk.Assistant object
+        @param assistant gtk.Assistant object used in wizard.        
         """
         self.assistant.destroy()
 
@@ -275,7 +275,7 @@ class NewProject:
         """!
         Method is called when the user chooses 'apply' to create
         the new project.
-        @param assistant gtk.Assistant object
+        @param assistant gtk.Assistant object used in wizard.        
         """
         try:
             # Set new project attributes
@@ -289,7 +289,7 @@ class NewProject:
 
             os.mkdir(self.mw.project.directory)
             self.mw.project.create()
-            self.mw.dependencyloop.switch_projects()
+            self.mw.dependencyloop.update_watch()
         except IOError, (errno, strerror):
             md = gtk.MessageDialog(self.assistant,
                                    (gtk.DIALOG_MODAL |
diff --git a/src/gui/Preferences.py b/src/gui/Preferences.py
index 4682e8d..1140ff5 100644
--- a/src/gui/Preferences.py
+++ b/src/gui/Preferences.py
@@ -1,4 +1,3 @@
-#! /usr/bin/env python
 """
 gEDA Manager
 Copyright (C) 2008 Newell Jensen
@@ -23,7 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #Preferences Window
 #@author Newell Jensen
 
-import gtk, os
+import gtk
 from subprocess import Popen, PIPE
 
 
@@ -35,20 +34,21 @@ class Preferences(gtk.Dialog):
     def __init__(self, mw):
         """ Preferences Constructor. """
         self.mw = mw
-        self.tools = ['gschem','gnetlist','pcb','gerbv','gsymcheck','gattrib','ghdl','iverilog','vvp','gspiceui','gtkwave']
+        self.tools = ['gschem','gnetlist','pcb','gerbv','gsymcheck','gattrib','ghdl','iverilog','vvp','gspiceui','gtkwave','grenum','refdes_renum','gsch2pcb','ngspice','gnucap']
         
         gtk.Dialog.__init__(self,
                             'gEDA Manager Preferences',
                             self.mw,
                             gtk.DIALOG_MODAL,
-                            (gtk.STOCK_APPLY, gtk.RESPONSE_APPLY,
-                             gtk.STOCK_OK, gtk.RESPONSE_OK,
+                            (gtk.STOCK_OK, gtk.RESPONSE_OK,
                              gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
         self.add_button('Restore Default', 19) #19 - my favorite prime
         settings = gtk.settings_get_default()
         settings.set_property('gtk-alternative-button-order', True)
-        self.set_alternative_button_order([19, gtk.RESPONSE_APPLY, gtk.RESPONSE_OK, gtk.RESPONSE_CANCEL])
+        self.set_alternative_button_order([19, gtk.RESPONSE_OK, gtk.RESPONSE_CANCEL])
         self.set_title('Preferences')
+        self.set_size_request(550,300)
+
         
         ## Some initial setup
         self.editor_entry = gtk.Entry()
@@ -62,7 +62,7 @@ class Preferences(gtk.Dialog):
         self.textview.show()
         self.current_tool = None
         if self.mw.settings.flags == None:
-            self.mw.settings.flags = self.mw.settings.default_flags
+            self.mw.settings.flags = self.mw.settings.default_flags.copy()
         
         # Nested callbacks
         def cb_response(dialog, response):
@@ -71,11 +71,6 @@ class Preferences(gtk.Dialog):
             elif response == gtk.RESPONSE_OK:
                 self.save_tool_state(self.current_tool)
                 self.destroy()
-            elif response == gtk.RESPONSE_APPLY:
-                current_tool = self.get_current_tool()
-                if current_tool != None:
-                    self.save_tool_state(current_tool)
-                    self.mw.settings.flags[current_tool] = self.flags_entry.get_text()
             elif response == 19: # Restore Default
                 current_tool = self.get_current_tool()
                 if current_tool != None:
@@ -103,10 +98,6 @@ class Preferences(gtk.Dialog):
         #####################################################
         hbox = gtk.HBox()
         hbox.show()
-        ## if self.mw.settings.editor != None:
-        ##     old_editor = self.mw.settings.editor
-        ## else:
-        ##     old_editor = None
         if self.mw.settings.editor != None:
             self.editor_entry.set_text(self.mw.settings.editor)
         filebutton = gtk.FileChooserButton('Text Editor')
@@ -150,6 +141,9 @@ class Preferences(gtk.Dialog):
         #####################################################
         ## gEDA Tool Flags
         #####################################################
+        label = gtk.Label('The flags listed here will be used when running the respective programs.\nPrograms with multiple uses will be listed in a dictionary ({ }).')
+        label.show()
+        self.vbox.pack_start(label)
         hbox = gtk.HBox()
         hbox.show()
         self.current_tool = self.get_current_tool()
@@ -216,9 +210,12 @@ class Preferences(gtk.Dialog):
         """
         if current_tool != None:
             self.flags_entry.set_text(self.mw.settings.flags[current_tool])
-            if current_tool in ['gschem','gnetlist','gsymcheck','gattrib','ghdl','gspiceui','gtkwave']:
+            if current_tool in ['gschem','gnetlist','gsymcheck','gattrib','ghdl','gspiceui','gtkwave','grenum','gsch2pcb','ngspice','gnucap']:
                 subproc = Popen([current_tool,'-h'], stdout=PIPE)
                 output = subproc.communicate()[0]
+            elif current_tool == 'refdes_renum':
+                subproc = Popen([current_tool,'--help'], stdout=PIPE)
+                output = subproc.communicate()[0]
             else:
                 subproc = Popen([current_tool,'-h'], stderr=PIPE)
                 output = subproc.communicate()[1]
diff --git a/src/utils/Callbacks.py b/src/utils/Callbacks.py
index 99445a3..290d610 100644
--- a/src/utils/Callbacks.py
+++ b/src/utils/Callbacks.py
@@ -152,6 +152,8 @@ def cb_project_opened(widget, event, mw):
     set_menu_defaults(mw)
     set_sources_tree_to_project(mw)
     set_dependencies_tree_to_project(mw)
+    # Change to the new directory
+    mw.terminal.feed_child('cd ' + mw.project.directory + '\n')
 
 
 def cb_project_created(widget, event, mw):
@@ -164,7 +166,9 @@ def cb_project_created(widget, event, mw):
     set_menu_defaults(mw)
     set_sources_tree_to_project(mw)
     set_dependencies_tree_to_new_project(mw)
-
+    # Change to the new directory
+    mw.terminal.feed_child('cd ' + mw.project.directory + '\n')
+    
 
 def cb_cursor_changed(widget, mw):
     """!
@@ -286,63 +290,69 @@ def get_processes_tree(mw, selected_node=None, ext=None, folder=None, clear=None
         return
 
     if ext == 'sch':
+        verify = mw.processes.append(None, ['Verify', None, None])
+        modify_attributes = mw.processes.append(None, ['Modify Attributes', None, None])
+        create_netlist = mw.processes.append(None, ['Create Netlist', None, None])        
         simulation = mw.processes.append(None, ['Simulate', None, None])
         create_pcb = mw.processes.append(None, ['Create PCB', None, None])
-        create_netlist = mw.processes.append(None, ['Create Netlist', None, None])
-        modify_attributes = mw.processes.append(None, ['Modify Attributes', None, None])
-        image = icon.load_icon(mw.icons.icon_lut['gspiceui'], 22, 0) 
-        mw.processes.append(simulation, ['gspiceui', image, None])
-        image = icon.load_icon(mw.icons.icon_lut['g2p'], 22, 0)
-        mw.processes.append(create_pcb, ['gsch2pcb workflow', image, None])
-        image = icon.load_icon(mw.icons.icon_lut['net'], 22, 0)
-        gnetlist = mw.processes.append(create_netlist, ['gnetlist', image, None])
-        for netlist in sorted(netlists):
-            mw.processes.append(gnetlist, [netlist, None, None])
 
-        image = icon.load_icon(mw.icons.icon_lut['other'], 22, 0) #refdes -- TODO
+        image = icon.load_icon(mw.icons.icon_lut['gnetlist'], 22, 0)
+        mw.processes.append(verify, ['gnetlist-drc2', image, None])
+        image = icon.load_icon(mw.icons.icon_lut['other'], 22, 0) 
         mw.processes.append(modify_attributes, ['refdes_renum', None, None])
-        image = icon.load_icon(mw.icons.icon_lut['other'], 22, 0) #grenum -- TODO
+        image = icon.load_icon(mw.icons.icon_lut['other'], 22, 0) 
         mw.processes.append(modify_attributes, ['grenum', None, None])
         image = icon.load_icon(mw.icons.icon_lut['gattrib'], 22, 0) 
         mw.processes.append(modify_attributes, ['gattrib', image, None])
+        image = icon.load_icon(mw.icons.icon_lut['net'], 22, 0)
+        gnetlist = mw.processes.append(create_netlist, ['gnetlist', image, None])
+        for netlist in sorted(netlists):
+            mw.processes.append(gnetlist, [netlist, None, None])
+        image = icon.load_icon(mw.icons.icon_lut['gspiceui'], 22, 0) 
+        mw.processes.append(simulation, ['gspiceui', image, None])
+        image = icon.load_icon(mw.icons.icon_lut['g2p'], 22, 0)
+        mw.processes.append(create_pcb, ['gsch2pcb wizard', image, None])
     elif ext == 'pcb':
         # TODO -- status image commented out until dependency issues
         # are taken care of
         ## status_image = get_status_image(mw, selected_node)
         ## export = mw.processes.append(None, ['Update PCB (gsch2pcb)', None, status_image])
-        export = mw.processes.append(None, ['Update PCB (gsch2pcb)', None, None])
+        update = mw.processes.append(None, ['Update', None, None])
+        _pprint = mw.processes.append(None, ['Print', None, None])        
         export = mw.processes.append(None, ['Export', None, None])
-        gerber = mw.processes.append(export, ['RS-274X (Gerber) file(s)', None, None])
-        # May need to add for bom1 and bom2
-        bom = mw.processes.append(export, ['Bill of Materials (BOM) file(s)', None, None])
-        nelma = mw.processes.append(export, ['Numerical analysis (Nelma) file(s)', None, None])
-        png = mw.processes.append(export, ['GIF/JPEG/PNG file(s)', None, None])
-        ps = mw.processes.append(export, ['Postscript file(s)', None, None])
-        eps = mw.processes.append(export, ['Encapsulated Postscript file(s)', None, None])
-        _print = mw.processes.append(None, ['Print (lpr)', None, None])
-
-    elif ext == 'gbr':
-        pass # TODO --> any process for this?
+
+        image = icon.load_icon(mw.icons.icon_lut['gsch2pcb'], 22, 0)            
+        up_date = mw.processes.append(update, ['update-gsch2pcb', image, None])
+        image = icon.load_icon(mw.icons.icon_lut['pcb'], 22, 0)            
+        _print = mw.processes.append(_pprint, ['lpr', image, None])        
+        bom = mw.processes.append(export, ['bom', image, None])
+        gerber = mw.processes.append(export, ['gerber', image, None])        
+        nelma = mw.processes.append(export, ['nelma', image, None])
+        png = mw.processes.append(export, ['png', image, None])
+        ps = mw.processes.append(export, ['ps', image, None])
+        eps = mw.processes.append(export, ['eps', image, None])
     elif ext == 'sym':
         check_symbols = mw.processes.append(None, ['Check Symbols', None, None])
         image = icon.load_icon(mw.icons.icon_lut['sym'], 22, 0) 
         mw.processes.append(check_symbols, ['gsymcheck', image, None])
-    elif ext == 'v':
+    elif ext == 'v' or ext == 'vl':
         compile_source = mw.processes.append(None, ['Compile Verilog', None, None])
+        translate_source = mw.processes.append(None, ['Translate to VHDL', None, None])
         ## comsim_source = mw.processes.append(None, ['Compile and Simulate Verilog', None, None])
         image = icon.load_icon(mw.icons.icon_lut['iverilog'], 22, 0)
-        mw.processes.append(compile_source, ['icarus-compile', image, None])
+        mw.processes.append(compile_source, ['iverilog-compile', image, None])
+        mw.processes.append(translate_source, ['iverilog-translate', image, None])
         ## mw.processes.append(comsim_source, ['icarus-compile->gtkwave-simulate', image, None])
     elif ext == 'vvp':
         simulate = mw.processes.append(None, ['Simulate', None, None])
         image = icon.load_icon(mw.icons.icon_lut['iverilog'], 22, 0) 
         mw.processes.append(simulate, ['iverilog', image, None])
     elif ext == 'vhd' or ext == 'vhdl':
-        compile_source = mw.processes.append(None, ['Compile VHDL', None, None])
-        comsim_source = mw.processes.append(None, ['Compile and Simulate VHDL', None, None])
+        compile_source = mw.processes.append(None, ['Analyze VHDL', None, None])
+#        comsim_source = mw.processes.append(None, ['Elaborate VHDL', None, None])
         image = icon.load_icon(mw.icons.icon_lut['ghdl'], 22, 0) 
-        mw.processes.append(compile_source, ['ghdl-compile', image, None])
-        mw.processes.append(comsim_source, ['ghdl-compile->gtkwave-simulate', image, None])
+        mw.processes.append(compile_source, ['ghdl-analyze', image, None])
+#        mw.processes.append(comsim_source, ['ghdl-elaborate', image, None])
     elif ext == 'net':
         simulation = mw.processes.append(None, ['Simulate', None, None])
         image = icon.load_icon(mw.icons.icon_lut['gspiceui'], 22, 0) 
@@ -395,99 +405,55 @@ def cb_processes_row_activated(widget, path, view_column, mw):
             mw.project.dependency_status[highlighted_source] = True
             mw.project.dependency_list[highlighted_source] = []
         run_command(mw, selected_node, highlighted_source)
+    else:
+        dialog = gtk.MessageDialog(mw,
+                                   (gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT),
+                                   gtk.MESSAGE_ERROR,
+                                   gtk.BUTTONS_OK)
+        dialog.set_markup('<b>In order to run a process a source must be highlighted:</b>')
+        dialog.show()
+        dialog.run()
+        dialog.destroy()
 
 
 def cb_preferences(menuitem, mw):
     """!
     Event occurs when the user opens up the preferences menu.
     @param menuitem menuitem that threw the event
-    @param data optional user data to pass in
+    @param mw current MainWindow instance
     """
     Preferences(mw)
-    ## if mw.settings.editor != None:
-    ##     old_editor = mw.settings.editor
-    ## else:
-    ##     old_editor = None
-
-    ## def response_to_dialog(entry, dialog, response):
-    ##     dialog.response(response)
-
-    ## entry = gtk.Entry()
-    ## if mw.settings.editor != None:
-    ##     entry.set_text(mw.settings.editor)
-    ## entry.show()
-
-    ## def cb_filebutton_selection_changed(filechooser, entry):
-    ##     mw.settings.editor = filebutton.get_filename()
-    ##     entry.delete_text(0,-1)
-    ##     entry.set_text(mw.settings.editor)
-
-    ## dialog = gtk.MessageDialog(mw,
-    ##                            (gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT),
-    ##                            gtk.MESSAGE_OTHER,
-    ##                            gtk.BUTTONS_OK_CANCEL,
-    ##                            gtk.STOCK_DIRECTORY)
-    ## dialog.set_markup('<b>Preference settings:</b>')
-    ## dialog.set_title('Preferences')
-    ## hbox = gtk.HBox()
-    ## hbox.show()
-
-    ## filebutton = gtk.FileChooserButton('Text Editor')
-    ## filebutton.show()
-    ## filebutton.connect('selection-changed',
-    ##                         cb_filebutton_selection_changed, entry)
-    ## filebutton.set_local_only(True)
-    ## filebutton.set_action(gtk.FILE_CHOOSER_ACTION_OPEN)
-    ## hbox.pack_end(filebutton)
-
-    ## entry.connect('activate', response_to_dialog, dialog, gtk.RESPONSE_OK)
-    ## hbox.pack_end(entry)
-    ## label = gtk.Label('Text Editor:')
-    ## label.show()
-    ## hbox.pack_end(label)
-
-    ## dialog.vbox.pack_end(hbox, True, True, 0)
-    ## dialog.show()
-    ## dialog.run()
-    ## if old_editor != mw.settings.editor: # A change was made
-    ##     new_text = mw.settings.editor
-    ## else:
-    ##     new_text = entry.get_text()
-    ## dialog.destroy()
-
-    ## if new_text:
-    ##     mw.settings.editor = new_text
-
-
-def update_file_list(mw, index=None, filepath=None):
-    """!
-    Method to update the gEDA Manager's project file list any time
-    the 'Sources' tree view is changed.
-    @param mw Mw object
-    @param index index -- (0 = add copy source, 1 = delete source,
-    2 = delete folder, 3 = add a new source, 4 = remove source,
-    5 = remove folder)
-    @param filepath filepath of the source to copy
-    """
-    selection = mw.sources_tree.get_selection()
-    model, selection_iter = selection.get_selected()
-    if isinstance(selection_iter, gtk.TreeIter):
-        selected_node = mw.sources.get_value(selection_iter, 2)
-    else:
-        return
-    if filepath != None:
-        filename = get_filename_from_filepath(filepath) # Files
-    else:
-        filename = get_filename_from_filepath(selected_node) # Folders
-    icon = gtk.IconTheme()
-    image = icon.load_icon(load_image(filename), 22, 0)
-    path = selected_node + '/' + filename
 
 
-    # Expand the 'Sources' tree view
-    mw.sources_tree.expand_all()
-    # Now save the project since the new update file_list is made        
-    mw.project.save()
+## def update_file_list(mw, index=None, filepath=None):
+##     """!
+##     Method to update the gEDA Manager's project file list any time
+##     the 'Sources' tree view is changed.
+##     @param mw Mw object
+##     @param index index -- (0 = add copy source, 1 = delete source,
+##     2 = delete folder, 3 = add a new source, 4 = remove source,
+##     5 = remove folder)
+##     @param filepath filepath of the source to copy
+##     """
+##     selection = mw.sources_tree.get_selection()
+##     model, selection_iter = selection.get_selected()
+##     if isinstance(selection_iter, gtk.TreeIter):
+##         selected_node = mw.sources.get_value(selection_iter, 2)
+##     else:
+##         return
+##     if filepath != None:
+##         filename = get_filename_from_filepath(filepath) # Files
+##     else:
+##         filename = get_filename_from_filepath(selected_node) # Folders
+##     icon = gtk.IconTheme()
+##     image = icon.load_icon(load_image(filename), 22, 0)
+##     path = selected_node + '/' + filename
+
+
+##     # Expand the 'Sources' tree view
+##     mw.sources_tree.expand_all()
+##     # Now save the project since the new update file_list is made        
+##     mw.project.save()
 
 
 def cb_delete(menuitem, mw):
@@ -645,35 +611,30 @@ def cb_add_copy_source(menuitem, mw):
                                     gtk.STOCK_OPEN, gtk.RESPONSE_OK))
 
     dialog.set_default_response(gtk.RESPONSE_OK)
-    file_filters(dialog)
+    file_filters(mw, dialog)
     response = dialog.run()
     if response == gtk.RESPONSE_OK:
         filepath = dialog.get_filename()
-        # TODO -- patch up
-        ## selection = spd.sources_tree.get_selection()
-        ## model, selection_iter = selection.get_selected()
-        ## if isinstance(selection_iter, gtk.TreeIter):
-        ##     selected_node = mw.sources.get_value(selection_iter, 2)
-        ## else:
-        ##     return
-        ## if filepath != None:
-        ##     filename = get_filename_from_filepath(filepath)
-        ## else:
-        ##     filename = get_filename_from_filepath(selected_node)
-        ## icon = gtk.IconTheme()
-        ## image = icon.load_icon(load_image(filename), 22, 0)
-        ## path = selected_node + '/' + filename
-
-        ## files = os.listdir(selected_node)
-        ## if filename not in files:
-        ##     os.system('cp ' + filepath + ' ' + selected_node)
+        selection = mw.sources_tree.get_selection()
+        model, selection_iter = selection.get_selected()
+        if isinstance(selection_iter, gtk.TreeIter):
+            selected_node = mw.sources.get_value(selection_iter, 2)
+        else:
+            return
+        if filepath != None:
+            filename = get_filename_from_filepath(filepath)
+        else:
+            filename = get_filename_from_filepath(selected_node)
+
+        files = os.listdir(selected_node)
+        if filename not in files:
+            os.system('cp ' + filepath + ' ' + selected_node)
         ##     mw.output_textbuffer.insert(mw.output_textiter, get_time() + ':\n' + 'Added copy of source:' + filepath + ' to ' + selected_node + '.\n')
         ## elif filepath == selected_node + '/' + filename:
         ##     mw.output_textbuffer.insert(mw.output_textiter, get_time() + ':\n' + 'Added copy of source:' + filepath + ' to project.\n')
         ## else:
         ##     mw.output_textbuffer.insert(mw.output_textiter, get_time() + ':\n' + filename + ' is already present in the directory: ' + selected_node + '.\n')
 
-
     dialog.destroy()
 
 
@@ -715,15 +676,8 @@ def cb_new_folder(action, mw):
         text = entry.get_text()        
         if response == gtk.RESPONSE_OK and text.strip() != '':
             filepath = selected_node + '/' + text
-            ## def delete_dependency_list_entry(arg, dirname, filenames):
-            ##     """ function to delete the filenames from the dependency_list """
-            ##     for f in filenames:
-            ##         if f in mw.project.dependency_list and list(flatten(project.file_list)).count(f) == 1:
-            ##             del mw.project.dependency_list[f]
-
             # See if this directory already exists
             if os.path.exists(filepath): # delete directory recursively
-                ## os.path.walk(filepath, delete_dependency_list_entry, None)
                 shutil.rmtree(filepath)
             os.mkdir(filepath)
             mw.project.save() # Saving the project takes
@@ -795,21 +749,19 @@ def cb_rename_folder(action, mw):
 
         if '.' not in new_text:
             ## We are going to handle the project folder in cb_rename_folder
-            if old_path == project.directory:
+            if old_path == mw.project.directory:
                 # Project Folder
                 os.rename(old_path, new_path)
-                project_file = new_path + '/' + project.name + '.gm'
+                project_file = new_path + '/' + mw.project.name + '.gm'
                 os.remove(project_file)
-                project.directory = new_path
-                project.name = new_text
-                ## project.file_list[0] = new_text
-                ## project.file_list[1][0] = new_text + '.gm'
-                project.save()
-                output_textbuffer.insert(output_textiter, 'Project changed from ' + old_path + ' to ' + new_path + '.\n')
+                mw.project.directory = new_path
+                mw.project.name = new_text
+                mw.project.save()
+                mw.output_textbuffer.insert(mw.output_textiter, 'Project changed from ' + old_path + ' to ' + new_path + '.\n')
             else:
                 # Regular folder
                 if os.path.exists(new_path):
-                    output_textbuffer.insert(output_textiter, 'Folder already exists with this name.  Cannot rename.\n')
+                    mw.output_textbuffer.insert(mw.output_textiter, 'Folder already exists with this name.  Cannot rename.\n')
                     return
                 os.rename(old_path, new_path)
 
diff --git a/src/utils/DependencyLoop.py b/src/utils/DependencyLoop.py
index f2485e9..5b1af6c 100644
--- a/src/utils/DependencyLoop.py
+++ b/src/utils/DependencyLoop.py
@@ -51,24 +51,25 @@ class DependencyLoop:
             self.wdd = self.watch_manager.add_watch(self.mw.project.directory, self.mask, rec=True)
 
 
-    def switch_projects(self):
-        """
-        Method to switch which directory is being watched for events.
-        This method will be called when projects are changed, etc.
-        """
-        # Takes care of subdirectories
-        if self.wdd != None:
-            self.watch_manager.rm_watch(self.wdd.values()) 
-        # Now add a new watch to the new project
-        if self.mw.project.directory != None:
-            self.wdd = self.watch_manager.add_watch(self.mw.project.directory, self.mask, rec=True)
+    ## def switch_projects(self):
+    ##     """
+    ##     Method to switch which directory is being watched for events.
+    ##     This method will be called when projects are changed, etc.
+    ##     """
+    ##     # Takes care of subdirectories
+    ##     if self.wdd != None:
+    ##         self.watch_manager.rm_watch(self.wdd.values()) 
+    ##     # Now add a new watch to the new project
+    ##     if self.mw.project.directory != None:
+    ##         self.wdd = self.watch_manager.add_watch(self.mw.project.directory, self.mask, rec=True)
 
 
     def update_watch(self):
         """
         Method to update the directory that is already under watch.
         """
-        self.wdd = self.watch_manager.add_watch(self.mw.project.directory, self.mask, rec=True)
+        if self.mw.project.directory != None:
+            self.wdd = self.watch_manager.add_watch(self.mw.project.directory, self.mask, rec=True)
         
 
     def kill_thread(self):
diff --git a/src/utils/Helpers.py b/src/utils/Helpers.py
index c8a0b57..984fdd0 100644
--- a/src/utils/Helpers.py
+++ b/src/utils/Helpers.py
@@ -18,11 +18,11 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 """
 
-##@package src.utils.Utils
-#Utility class for the gEDA Manager
+##@package src.utils.Helpers
+#Helpers class for the gEDA Manager
 #@author Newell Jensen
 
-import gtk, pygtk, os, time, signal
+import os, sys, gtk, pygtk, time, signal
 pygtk.require('2.0')
 from subprocess import *
 from src.gui.Gsch2pcb import Gsch2pcb
@@ -84,7 +84,6 @@ def set_no_project_default(mw):
     """
     # File Menu
     mw.project.name = mw.no_project_name
-    mw.sources_tree.set_property('headers-visible', True)
     column = mw.sources_tree.get_column(0)
     column.set_title(mw.project.name)
     save_project_as_menuitem = mw.menu_uimanager.get_widget('/MenuBar/Project/Save Project As...')
@@ -97,13 +96,12 @@ def set_project_default(mw):
     Method to set the default sensitivity when a project is loaded.
     """
     # File Menu
-    mw.sources_tree.set_property('headers-visible', False)        
     save_project_as_menuitem = mw.menu_uimanager.get_widget('/MenuBar/Project/Save Project As...')
     close_project_menuitem = mw.menu_uimanager.get_widget('/MenuBar/Project/Close Project')
     close_project_menuitem.set_sensitive(True)
 
 
-def set_project(mw, path):
+def set_project(path, mw):
     """!
     Method to set current project to the one on path.
     @param path path for project to open.
@@ -112,17 +110,25 @@ def set_project(mw, path):
     if not mw.project.clean:
         mw.project.save()
     mw.project.open(path)
-    mw.output_textbuffer.insert(mw.output_textiter, get_time() + ':\n' + 'Project set to ' + mw.project.name + '\n')
-    mw.dependencyloop.switch_projects()
+    mw.dependencyloop.update_watch()
 
 
+def set_project_header(mw):
+    """ Method to set the project header. """
+    column = mw.sources_tree.get_column(0)
+    if mw.project.name != None:
+        column.set_title('Project: ' + mw.project.name)
+        mw.output_textbuffer.insert(mw.output_textiter, get_time() + ':\n' + 'Project set to ' + mw.project.name + '\n')
+    
+
 def set_sources_tree_to_project(mw):
     """ Method to set the tree to current project object. """
+    set_project_header(mw)
     mw.sources.clear()
     if mw.project.name != None:
         load_sources_tree(mw)
     mw.sources_tree.expand_all()
-
+    
 
 def set_dependencies_tree_to_project(mw):
     """ Method to set the tree to current project object. """
@@ -134,7 +140,6 @@ def set_dependencies_tree_to_project(mw):
 
 def set_dependencies_tree_to_new_project(mw):
     """ Method to set the tree to newly created project object. """
-    #mw.dependencyloop.switch_projects()
     mw.dependencies.clear()
     # Parent Folder
     project_path = mw.project.directory + '/' + mw.project.name        
@@ -181,7 +186,8 @@ def load_sources_tree(mw):
 
 def load_dependencies_tree(mw):
     """!
-    Method to the load the dependencies tree
+    Method to the load the dependencies tree.
+    @param mw current MainWindow instance
     """
     # Need to add checking for whether or not the filesystem still
     # has the files before appending them to mw.dependencies
@@ -209,6 +215,12 @@ def load_dependencies_tree(mw):
 
 
 def update_dependency(mw, pathname, recurse=False):
+    """!
+    Method to update a dependency's status.
+    @param mw current MainWindow instance
+    @param pathname filepath for the dependency
+    @param recurse boolean used for recursion
+    """
     # First, make sure that the file is already in the dependencies
     if mw.project.dependency_status != None:
         try:
@@ -228,7 +240,11 @@ def update_dependency(mw, pathname, recurse=False):
 
 
 def add_dependency(mw, pathname):
-    print 'in add_dependency'
+    """!
+    Method to add a dependency.
+    @param mw current MainWindow instance
+    @param pathname filepath for the dependency
+    """
     try:
         if mw.project.dependency_list != None:
             mw.project.dependency_list[pathname] = []
@@ -242,6 +258,9 @@ def add_dependency(mw, pathname):
 
 
 def remove_dependency(mw, pathname, recurse=False):
+    """!
+    Method to remove
+    """
     # First, make sure that the file is already in the dependencies
     if mw.project.dependency_status != None:
         if pathname in mw.project.dependency_status:
@@ -267,6 +286,7 @@ def remove_dependency(mw, pathname, recurse=False):
 def get_processes_selected_node(mw):
     """!
     Method to get the selected node in the 'Processes' treeview.
+    @param mw current MainWindow instance    
     @return path of the selected node
     """
     selection = mw.processes_tree.get_selection()
@@ -281,6 +301,7 @@ def file_filters(mw, dialog):
     """!
     Method to abstract some redundant code that is used in the message
     dialog boxes.
+    @param mw current MainWindow instance
     @param dialog gtk.FileChooserDialog object
     """
     file_filter = gtk.FileFilter()
@@ -334,21 +355,6 @@ def file_filters(mw, dialog):
     dialog.add_filter(file_filter)
 
 
-def set_project(path, mw):
-    """!
-    Method to set current project to the one on path.
-    @param path path for project to open.
-    """
-    # Save current project
-    if not mw.project.clean:
-        print 'mw: set_project is implemented'
-        mw.project.save()
-    mw.project.open(path)
-    mw.sources_tree.set_property('headers-visible', True)
-    column = mw.sources_tree.get_column(0)
-    column.set_title('Project: ' + mw.project.name)
-    mw.output_textbuffer.insert(mw.output_textiter, get_time() + ':\n' + 'Project set to ' + mw.project.name + '\n')
-    mw.dependencyloop.switch_projects()
 
         
 def save_settings(mw):
@@ -452,7 +458,7 @@ def run_command(mw, filepath, highlighted_source=None, ext=None):
     is being used for the current process
     @param ext extension of the selected file
     """
-    files = ['net','log','bom','bom1','bom2','v','vhd','gm','txt','cmd']
+    files = ['net','log','bom','bom1','bom2','v','vl','vvp','vhd','vhdl','gm','txt','cmd']
     # Sources
     if ext != None:
         os.chdir(filepath.rpartition('/')[0])
@@ -473,7 +479,7 @@ def run_command(mw, filepath, highlighted_source=None, ext=None):
                 pass
         elif (ext in files or ext in configfiles):
             if mw.settings.editor == None:
-                dialog = gtk.MessageDialog(mw.window,
+                dialog = gtk.MessageDialog(mw,
                                            (gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT),
                                            gtk.MESSAGE_INFO,
                                            gtk.BUTTONS_OK,
@@ -486,30 +492,29 @@ def run_command(mw, filepath, highlighted_source=None, ext=None):
                 Popen([mw.settings.editor, filepath])
                     
     else: # Processes
-        print 'highlighted_source:',highlighted_source
         os.chdir(highlighted_source.rpartition('/')[0])
         program = filepath
-        print 'program:',program
+
         # Netlists
         if program in netlists: # use gnetlist
             subproc = Popen(['gnetlist', '-v', '-g', program, highlighted_source], stdout=PIPE)
             mw.output_textbuffer.insert(mw.output_textiter, get_time() + ' and output from ' + program + ':\n' + subproc.communicate()[0] + '\n')
+        elif program == 'gnetlist':
+            print 'GNETLIST'
+        elif program == 'gnetlist-drc2':
+            print 'gnetlist-drc2'
         elif program == 'gspiceui':
-            print 'in'
             subproc = Popen([program, highlighted_source], stdout=PIPE)
-        elif program == 'ghdl-compile':
-            # TODO
+        elif program == 'ghdl-analyze':
+            not_implemented(mw)
+        elif program == 'ghdl-eloborate':
             not_implemented(mw)
-        elif program == 'ghdl-compile->gtkwave-simulate':
-            # TODO
+        elif program == 'ghdl-run':
             not_implemented(mw)                
-            pass
-        elif program == 'icarus-compile':
+        elif program == 'iverilog-compile':
             subproc = Popen(['iverilog', '-v', '-o', get_filename_from_filepath(highlighted_source).rsplit('.')[0] + '.vvp', highlighted_source], stdout=PIPE)
-        elif program == 'icarus-compile->gtkwave-simulate':
-            # TODO
+        elif program == 'vvp-simulate':
             not_implemented(mw)                
-            pass
         elif program == 'gattrib':
             if tools['gattrib'] == None or tools['gattrib'].poll() == 0:
                 tools['gattrib'] = Popen([program, highlighted_source], stdout=PIPE)
@@ -520,9 +525,9 @@ def run_command(mw, filepath, highlighted_source=None, ext=None):
             arg = '-v ' + highlighted_source
             subproc = Popen([program, arg], stdout=PIPE)
             mw.output_textbuffer.insert(mw.output_textiter, get_time() + ' and output from ' + program + ':\n' + subproc.communicate()[0] + '.\n')
-        elif program == 'gsch2pcb workflow':
+        elif program == 'gsch2pcb wizard':
             gsch2pcb = Gsch2pcb(mw, highlighted_source)
-        elif program == 'Update PCB (gsch2pcb)':
+        elif program == 'update-gsch2pcb':
             not_implemented(mw)
             # The stuff below is commented out until the dependency issues
             # are solved
diff --git a/src/utils/Icons.py b/src/utils/Icons.py
index b361747..24e8751 100644
--- a/src/utils/Icons.py
+++ b/src/utils/Icons.py
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 """
 
 ##@package src.utils.Icons
-#Utility class for the gEDA Manager
+#Icon class for the gEDA Manager
 #@author Newell Jensen
 
 import os, pygtk, gtk
@@ -53,11 +53,11 @@ class Icons:
         image = gtk.gdk.pixbuf_new_from_file('images/bitmaps/page_white.png')
         gtk.icon_theme_add_builtin_icon('log', 22, image)        
         image = gtk.gdk.pixbuf_new_from_file('images/bitmaps/verilog-module.bmp')
-        gtk.icon_theme_add_builtin_icon('v', 22, image)                
+        gtk.icon_theme_add_builtin_icon('v', 22, image)
+        gtk.icon_theme_add_builtin_icon('vl', 22, image)    
         image = gtk.gdk.pixbuf_new_from_file('images/bitmaps/vhdl-module.bmp')
-        gtk.icon_theme_add_builtin_icon('vhd', 22, image)                
-        image = gtk.gdk.pixbuf_new_from_file('images/bitmaps/vhdl-module.bmp')
-        gtk.icon_theme_add_builtin_icon('vhdl', 22, image)                
+        gtk.icon_theme_add_builtin_icon('vhd', 22, image)
+        gtk.icon_theme_add_builtin_icon('vhdl', 22, image)            
         image = gtk.gdk.pixbuf_new_from_file('images/bitmaps/page_white_text.png')
         gtk.icon_theme_add_builtin_icon('other', 22, image)        
         image = gtk.gdk.pixbuf_new_from_file('images/bitmaps/chart_curve.png')
@@ -98,9 +98,12 @@ class Icons:
         gtk.icon_theme_add_builtin_icon('pdf', 22, image)
         image = gtk.gdk.pixbuf_new_from_file('images/bitmaps/GTKWave_logo.png')
         gtk.icon_theme_add_builtin_icon('gtkwave', 22, image)
+        image = gtk.gdk.pixbuf_new_from_file('images/bitmaps/nglogo.jpg')
+        gtk.icon_theme_add_builtin_icon('ngspice', 22, image)
         
 
-        self.icon_lut = {'gtkwave': 'gtkwave',
+        self.icon_lut = {'ngspice': 'ngspice',
+                         'gtkwave': 'gtkwave',
                          'pdf': 'pdf',
                          'vvp': 'vvp',
                          'out': 'out',
@@ -128,6 +131,7 @@ class Icons:
                          'vhd': 'vhd',
                          'vhdl': 'vhdl',
                          'v': 'v',
+                         'vl': 'vl',
                          'log': 'log',
                          'gm': 'gm',
                          'project': 'project',
diff --git a/src/utils/Project.py b/src/utils/Project.py
index 818a413..65f69c7 100644
--- a/src/utils/Project.py
+++ b/src/utils/Project.py
@@ -100,7 +100,7 @@ class Project(gobject.GObject):
         Method to save the project and then emit the
         'created' signal.
         """
-        self.save(True)
+        self.save()
         self.emit('created', True)
 
 
diff --git a/src/utils/Settings.py b/src/utils/Settings.py
index 5b6818c..1eae840 100644
--- a/src/utils/Settings.py
+++ b/src/utils/Settings.py
@@ -39,18 +39,23 @@ class Settings:
         self.project = None
         self.editor = None
         self.flags = None
-        self.default_flags = {'gschem': '-v',
-                      'gnetlist': '-v',
-                      'gattrib': '-v',                      
-                      'gerbv': '',
-                      'gsymcheck': '-v',
-                      'ghdl': "{'compile': '-a', 'elaborate': '-e', 'run': '-r'}",
-                      'iverilog': '-v',
-                      'vvp': '-v',
-                      'gspiceui': '',
-                      'gtkwave': '',
-                      'gwave': '-v',
-                      'pcb': "{'gui': '--verbose', 'lpr': '-p', 'bom': '-x bom', 'gerber': '-x gerber', 'nelma': '-x nelma', 'png': '-x png', 'ps': '-x ps', 'eps': '-x eps'}"
+        self.default_flags = {'gnucap': '-b',
+                              'ngspice': '-b',
+                              'refdes_renum': '--verbose',
+                              'grenum': '-v',
+                              'gsch2pcb': '-v',
+                              'gschem': '-v',
+                              'gnetlist': "{'gnetlist': '-v', 'backends': '-v -g `backend choosen`'}",
+                              'gattrib': '-v',                      
+                              'gerbv': '',
+                              'gsymcheck': '-v',
+                              'ghdl': "{'analyze': '-a', 'elaborate': '-e', 'run': '-r'}",
+                              'iverilog': "{'compile': '-v', 'translate': '-tvhdl -o your_verilog_filename.vhd'}",
+                              'vvp': '-v',
+                              'gspiceui': '',
+                              'gtkwave': '',
+                              'gwave': '-v',
+                              'pcb': "{'gui': '--verbose', 'lpr': '-p', 'bom': '-x bom', 'gerber': '-x gerber', 'nelma': '-x nelma', 'png': '-x png', 'ps': '-x ps', 'eps': '-x eps'}"
                       }
         self.path = os.path.expanduser('~') + '/.gmrc'        
         try:




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs