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

gEDA-cvs: branch: master updated (V1_0-18-g55187b9)



The branch, master has been updated
       via  55187b907d954c2423f074aa450f0d73168e3a9e (commit)
       via  09bda9504c1c42c8398beb81ddf35bf9869fe18f (commit)
      from  721e7ff131cc10c3885e9faf9cb825f82e6348ec (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/gsch2pcbproject.py |    5 ++-
 lib/xgsch2pcb/gui.py             |   66 ++++++++++++++++++++++++++++++++++---
 2 files changed, 64 insertions(+), 7 deletions(-)


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

commit 55187b907d954c2423f074aa450f0d73168e3a9e
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Sep 12 11:10:26 2007 +0100

    Added error popups for failures createing a new project or schematic
    
    Some other possible IOError locations remain, such as when writing to
    a project file. These should be addressed more fully, perhaps offering
    the user a chance to save in a different location.

:100644 100644 8d917d6... 203221a... M	lib/xgsch2pcb/gui.py

commit 09bda9504c1c42c8398beb81ddf35bf9869fe18f
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Sep 12 11:05:57 2007 +0100

    Fix for opening a project with no schematics
    
    (Issue introduced when fixing the whitespace in schematics problem)

:100644 100644 96f72ec... 24bba3a... M	lib/xgsch2pcb/gsch2pcbproject.py

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

commit 55187b907d954c2423f074aa450f0d73168e3a9e
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Sep 12 11:10:26 2007 +0100

    Added error popups for failures createing a new project or schematic
    
    Some other possible IOError locations remain, such as when writing to
    a project file. These should be addressed more fully, perhaps offering
    the user a chance to save in a different location.

diff --git a/lib/xgsch2pcb/gui.py b/lib/xgsch2pcb/gui.py
index 8d917d6..203221a 100644
--- a/lib/xgsch2pcb/gui.py
+++ b/lib/xgsch2pcb/gui.py
@@ -333,7 +333,34 @@ class MonitorWindow(gtk.Window):
 
             if not os.path.exists(filename):
                 # Create a new zero-length file in place
-                open(filename, 'w').close()
+                try:
+                    open(filename, 'w').close()
+                except IOError, (errno, strerror):
+                    md = gtk.MessageDialog(self,
+                                           (gtk.DIALOG_MODAL |
+                                            gtk.DIALOG_DESTROY_WITH_PARENT),
+                                           gtk.MESSAGE_ERROR,
+                                           gtk.BUTTONS_OK )
+
+                    md.set_markup( _('<span weight="bold" size="larger">Could not create schematic</span>\n\nError %i: %s') % (errno, strerror) )
+                    md.show_all()
+                    md.run()
+                    md.hide_all()
+                    continue
+                except:
+                    #TODO: Provide a GUI Dialog for this
+                    md = gtk.MessageDialog(self,
+                                           (gtk.DIALOG_MODAL |
+                                            gtk.DIALOG_DESTROY_WITH_PARENT),
+                                           gtk.MESSAGE_ERROR,
+                                           gtk.BUTTONS_OK )
+
+                    md.set_markup( _('<span weight="bold" size="larger">Could not create schematic</span>') )
+                    md.show_all()
+                    md.run()
+                    md.hide_all()
+                    continue
+
             self.project.add_page(filename)
             break
 
@@ -445,13 +472,40 @@ class MonitorWindow(gtk.Window):
         if r != gtk.RESPONSE_OK:
             return
 
-        path = d.get_filename()
-        if not path.endswith('.gsch2pcb'):
-            path += '.gsch2pcb'
+        filename = d.get_filename()
+        if not filename.endswith('.gsch2pcb'):
+            filename += '.gsch2pcb'
 
-       	self.set_project(path)
-        self.project.save()
+        # Create a new zero-length file
+        try:
+            open(filename, 'w').close()
+        except IOError, (errno, strerror):
+            md = gtk.MessageDialog(self,
+                                   (gtk.DIALOG_MODAL |
+                                    gtk.DIALOG_DESTROY_WITH_PARENT),
+                                   gtk.MESSAGE_ERROR,
+                                   gtk.BUTTONS_OK )
+
+            md.set_markup( _('<span weight="bold" size="larger">Could not create project</span>\n\nError %i: %s') % (errno, strerror) )
+            md.show_all()
+            md.run()
+            md.hide_all()
+            return
+        except:
+            #TODO: Provide a GUI Dialog for this
+            md = gtk.MessageDialog(self,
+                                   (gtk.DIALOG_MODAL |
+                                    gtk.DIALOG_DESTROY_WITH_PARENT),
+                                   gtk.MESSAGE_ERROR,
+                                   gtk.BUTTONS_OK )
+
+            md.set_markup( _('<span weight="bold" size="larger">Could not create project</span>') )
+            md.show_all()
+            md.run()
+            md.hide_all()
+            return
 
+        self.set_project(filename)
 
     def event_open_button_clicked( self, button ):
        

commit 09bda9504c1c42c8398beb81ddf35bf9869fe18f
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Sep 12 11:05:57 2007 +0100

    Fix for opening a project with no schematics
    
    (Issue introduced when fixing the whitespace in schematics problem)

diff --git a/lib/xgsch2pcb/gsch2pcbproject.py b/lib/xgsch2pcb/gsch2pcbproject.py
index 96f72ec..24bba3a 100644
--- a/lib/xgsch2pcb/gsch2pcbproject.py
+++ b/lib/xgsch2pcb/gsch2pcbproject.py
@@ -71,7 +71,10 @@ class Gsch2PCBProject(gobject.GObject):
             parts = line.strip().split(None, 1)
             opt = parts[0]
             if opt == 'schematics':
-                self.pages = parts[1].split()
+                if len(parts) > 1:
+                    self.pages = parts[1].split()
+                else:
+                    self.pages = []
             elif opt == 'output-name':
                 self.output_name = parts[1]
             else:




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