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

gEDA-cvs: branch: master updated (V1_0-20-g7bfe058)



The branch, master has been updated
       via  7bfe05871a8275323babc9c4dba4243a5abe98fc (commit)
      from  ad29e9d04c75f54a04a407c4e8428e190d02cfcb (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
=========

 lib/xgsch2pcb/gui.py |   46 ++++++++++++++++++++++++----------------------
 1 files changed, 24 insertions(+), 22 deletions(-)


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

commit 7bfe05871a8275323babc9c4dba4243a5abe98fc
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Sep 12 15:41:00 2007 +0100

    Open multiple pages using the same copy of gschem or gattrib
    
    Cherry-pick from commit a28b300333b64297476df106a596f9c770729277
    
    Applied patch by Peter B to open multiple pages using the same copy of
    gschem or gattrib.

:100644 100644 5e2b93a... 12042d7... M	lib/xgsch2pcb/gui.py

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

commit 7bfe05871a8275323babc9c4dba4243a5abe98fc
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Sep 12 15:41:00 2007 +0100

    Open multiple pages using the same copy of gschem or gattrib
    
    Cherry-pick from commit a28b300333b64297476df106a596f9c770729277
    
    Applied patch by Peter B to open multiple pages using the same copy of
    gschem or gattrib.

diff --git a/lib/xgsch2pcb/gui.py b/lib/xgsch2pcb/gui.py
index 5e2b93a..12042d7 100644
--- a/lib/xgsch2pcb/gui.py
+++ b/lib/xgsch2pcb/gui.py
@@ -382,28 +382,30 @@ class MonitorWindow(gtk.Window):
 
     def event_schematic_button_clicked(self, button, tool):
         
-        def runtool_func(model, path, iter):
-            page = model.get_value(iter, 0)
-
-            toolpath = find_tool_path(tool)
-            if toolpath == None:
-                md = gtk.MessageDialog(self,
-                                       (gtk.DIALOG_MODAL |
-                                        gtk.DIALOG_DESTROY_WITH_PARENT),
-                                       gtk.MESSAGE_ERROR,
-                                       gtk.BUTTONS_OK,
-                                       _('Could not locate tool: %s') % tool)
-                md.show_all()
-                md.run()
-                md.hide_all()
-                return
-
-            Popen([toolpath, page])
-
-        # Call the private helper function defined above for each
-        # selected schematic page.
-        self.pagelist.get_selection().selected_foreach(runtool_func)
-
+        # Call a private helper function defined above for each
+        # selected schematic page in order to build a list of pages.
+        pages = []
+        def buildpagelist_func(model, path, iter):
+            pages.append(model.get_value(iter, 0))
+        self.pagelist.get_selection().selected_foreach(buildpagelist_func)
+
+        # Launch the requested tool
+        # FIXME does this work for gattrib?
+        toolpath = find_tool_path(tool)
+        if toolpath == None:
+            md = gtk.MessageDialog(self,
+                                   (gtk.DIALOG_MODAL |
+                                    gtk.DIALOG_DESTROY_WITH_PARENT),
+                                   gtk.MESSAGE_ERROR,
+                                   gtk.BUTTONS_OK,
+                                   _('Could not locate tool: %s') % tool)
+            md.show_all()
+            md.run()
+            md.hide_all()
+            return
+        
+        Popen([toolpath] + pages)
+            
     def event_editpcb_button_clicked(self, button):
         
         # Check if the layout might need updating




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