commit-gnue
[Top][All Lists]
Advanced

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

gnue/designer BUGS TODO src/GFDesigner.py src/I...


From: Jason Cater
Subject: gnue/designer BUGS TODO src/GFDesigner.py src/I...
Date: Sat, 10 Nov 2001 17:01:09 -0500

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    01/11/10 17:01:09

Modified files:
        designer       : BUGS TODO 
        designer/src   : GFDesigner.py Instance.py MenuBar.py 

Log message:
        polished designer's menus; added checks to closing/exiting to prompt 
user if form is not saved; added save all

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/BUGS.diff?cvsroot=OldCVS&tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/TODO.diff?cvsroot=OldCVS&tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/GFDesigner.py.diff?cvsroot=OldCVS&tr1=1.21&tr2=1.22&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/Instance.py.diff?cvsroot=OldCVS&tr1=1.25&tr2=1.26&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/MenuBar.py.diff?cvsroot=OldCVS&tr1=1.11&tr2=1.12&r1=text&r2=text

Patches:
Index: gnue/designer/BUGS
diff -u gnue/designer/BUGS:1.8 gnue/designer/BUGS:1.9
--- gnue/designer/BUGS:1.8      Mon Nov  5 17:45:15 2001
+++ gnue/designer/BUGS  Sat Nov 10 17:01:08 2001
@@ -5,27 +5,27 @@
 Include as much detail about your computer setup as
 possible. If you can reliably reproduce the bug,
 please include each step involved. Does the problem
-only occur when working on a single form (but not
-other similar forms?)
+only occur when working on a particular form (but
+not other similar forms?)
 ****************************************************
 
 These are known issues with Designer 0.1.0
 
 * Designer occasionally seg faults when clicking on the Tree View. I cannot
   find any pattern to the segfaulting and it usually only happens to me once
-  every day, so if anyone can reliably repeat this bug, PLEASE let me know
-  what you are doing (email: address@hidden)
+  in a while; so if anyone can reliably repeat this bug, PLEASE let us know
+  what you are doing.
 
 * On the Property Editor: You cannot change a value and then click to another
   window/frame without first pressing enter. The value will revert back to
-  the original because one of wxPython's focus listeners isn't being called.
+  the original because one of wxPython's focus listener isn't being called.
   Not sure if this is a limitation of the way we implemented the Grid editor
-  or a limitation of wxGTK.
+  or a limitation of wxPython.
 
 * If you are viewing a page and then, using the Tree View, select an object
   on another page, the Layout Editor does not switch to the other page.  You
   have to first select the other page in the Tree View first, then select the
-  object to modify.
+  object to modify. Sometimes doing this will produce a segmentation fault.
 
 * The Events tab on the "Property Editor" window is not functional.
   It currently displays the same information as on the "Properties"
@@ -34,16 +34,20 @@
 
 * Designer currently redraws the entire layout screen whenever a property
   is modified and whenever an object is deleted or modified. This may
-  make designer run slowly on slower computers.
+  make designer run noticably slow on older computers.
 
-* Wizards *should* be cross-platform, but our testers were experiencing 
-  problems on Windows 98 and Solaris. 
+* Designer loses custom xml encoding= attribute and defaults back to utf-8.
+  If you manually specify in your GFD file, for example:
+      <?xml version="1.0" encoding="iso-1859-2"?>
+  then save it, the form will be written as:
+      <?xml version="1.0"?>
+  This will affect our international customers.
 
 
 The following aren't technically bugs, but may bite none-the-less:
 
-* If you hand-edit a form definition and comment out sections, then
-  open this form definition in designer and save, you will lose your
-  commented sections.  This is due to the fact that designer's XML
-  parser does not save XML comments between sessions.
+* If you hand-edit a form definition and comment out sections using
+  <!-- -->, then open this form definition in designer and save, you
+  will lose your commented sections.  This is due to designer's XML
+  parser which does not save XML comments.
 
Index: gnue/designer/TODO
diff -u gnue/designer/TODO:1.4 gnue/designer/TODO:1.5
--- gnue/designer/TODO:1.4      Mon Nov  5 21:29:50 2001
+++ gnue/designer/TODO  Sat Nov 10 17:01:08 2001
@@ -4,6 +4,13 @@
 
  * Implement the EVENT tab support
 
+ * Implement the Edit menu option. (Clipboard)
+
+ * Implement Designer Preferences/Settings
+
+ * Implement clipboard support (copying, cutting, pasting form elements
+   both within the current form and between forms)
+
  * Implement a better code/text editing system (preferably by adding
    support for BOA Constructor, a really nifty python based development
    environment.
Index: gnue/designer/src/GFDesigner.py
diff -u gnue/designer/src/GFDesigner.py:1.21 
gnue/designer/src/GFDesigner.py:1.22
--- gnue/designer/src/GFDesigner.py:1.21        Fri Nov  9 16:31:23 2001
+++ gnue/designer/src/GFDesigner.py     Sat Nov 10 17:01:08 2001
@@ -74,6 +74,15 @@
         self._instances.pop(i)
         break
 
+  # Do we have unsaved files?
+  def isDirty(self):
+    isdirty = 0
+    for instance in self._instances:
+      if instance.isDirty():
+        isdirty = 1
+        break
+    return isdirty
+
 
   def OnNew(self, event):
     GFDInstance(self, None)
@@ -121,9 +130,24 @@
 
 
   def OnExit(self, event):
+    if self.isDirty():
+      dlg = wxMessageDialog(NULL,
+              "There are open documents with unsaved changes.\n"
+              "Exit anyway?",
+              "Unsaved Changes", style=wxYES_NO|wxICON_WARNING)
+      save = dlg.ShowModal()
+      dlg.Destroy()
+      if save == wxID_NO:
+        return
+
     for instance in self._instances:
       instance.Destroy()
 
+
+  def OnSaveAll(self, event):
+    for instance in self._instances:
+      if instance.isDirty():
+        instance.OnSave(event)
 
   def OnAbout(self, event):
     dlg = wxMessageDialog(NULL, self.NAME + "\n"
Index: gnue/designer/src/Instance.py
diff -u gnue/designer/src/Instance.py:1.25 gnue/designer/src/Instance.py:1.26
--- gnue/designer/src/Instance.py:1.25  Sun Nov  4 22:21:11 2001
+++ gnue/designer/src/Instance.py       Sat Nov 10 17:01:09 2001
@@ -212,6 +212,9 @@
   def uiEventTrap(self, event):
     pass
 
+  # Do we need to be saved?
+  def isDirty(self):
+    return self._isdirty
 
   # Mark our form as "dirty" (unsaved changes)
   def makeDirty(self):
@@ -256,7 +259,7 @@
 
   def onCreateObject (self, object, handler):
     self.inventoryLoadedItems(object)
-    for listener in self.objectListeners: 
+    for listener in self.objectListeners:
       listener.onCreateObject(object, handler)
     self.makeDirty()
 
@@ -268,13 +271,13 @@
   def onDeleteObject (self, object, handler):
 
     # Notify all listeners
-    for listener in self.objectListeners: 
+    for listener in self.objectListeners:
       listener.onDeleteObject(object, handler)
 
     # Delete the actual object from its parent
     i = 0
     while i < len(object._parent._children) and \
-       object._parent._children[i] != object: 
+       object._parent._children[i] != object:
       i = i + 1
     if object._parent._children[i] == object: 
       object._parent._children.pop(i)
@@ -282,7 +285,7 @@
     self.makeDirty()
 
 
-  def getNextGenericName (self, type): 
+  def getNextGenericName (self, type):
     while 1:
       if self._lastGenericNameSeq.has_key(string.lower(type)): 
         self._lastGenericNameSeq[string.lower(type)] = \
@@ -291,26 +294,26 @@
         self._lastGenericNameSeq[string.lower(type)] = 1
       name = "%s%s_%s" % (string.upper(type[0]), \
           string.lower(type[1:]), self._lastGenericNameSeq[string.lower(type)])
-      if not self.nameMappings.has_key(name): 
+      if not self.nameMappings.has_key(name):
         break
 
     return name
-  
+
   def saveForm(self): 
     location = self._path
     fileHandle = None
     fileHandle2 = None
     if self._makeBackup:
-      try: 
+      try:
         fileHandle = open(location,'r')
         fileHandle2 = open(location + "~",'w')
         fileHandle2.writelines(fileHandle.readlines())
       except:
         pass
-      else: 
-        if fileHandle != None: 
+      else:
+        if fileHandle != None:
           fileHandle.close()
-        if fileHandle2 != None: 
+        if fileHandle2 != None:
           fileHandle2.close()
 
     self._makeBackup = 0
@@ -322,14 +325,14 @@
     pages = []
     other = []
 
-    for child in self._form._children: 
-      if isinstance(child, GFObjects.GFOptions): 
+    for child in self._form._children:
+      if isinstance(child, GFObjects.GFOptions):
         options.append(child)
       elif isinstance(child, GFLibrary.GFImport):
         imports.append(child)
       elif isinstance(child, GFObjects.GFDataSource) or \
-        (isinstance(child, GFLibrary.GFImportItem) and 
-         child._type == 'GFimport-datasource'): 
+        (isinstance(child, GFLibrary.GFImportItem) and
+         child._type == 'GFimport-datasource'):
         datasources.append(child)
       elif isinstance(child, GFTrigger.GFTrigger) or \
         (isinstance(child, GFLibrary.GFImportItem) and 
@@ -369,12 +372,12 @@
     self.makeClean()
 
   def OnSave(self, event):
-    if not len(self._path): 
+    if not len(self._path):
       self.OnSaveAs(event)
-    else: 
+    else:
       self.saveForm()
- 
-  def OnSaveAs(self, event): 
+
+  def OnSaveAs(self, event):
     dlg = wxFileDialog(NULL, "Save GNUe Form As...", defaultDir=os.getcwd(),
                            wildcard = "GNUe Form Definitions (*.gfd)|*.gfd|" +\
                                       "GNUe Form Libraries (*.gfl)|*.gfl",
@@ -392,6 +395,16 @@
 
 
   def OnClose(self, event):
+    if self.isDirty():
+      dlg = wxMessageDialog(NULL,
+              "This document has unsaved changes.\n"
+              "Save changes before closing?",
+              "Unsaved Changes", style=wxYES_NO|wxICON_WARNING)
+      save = dlg.ShowModal()
+      dlg.Destroy()
+      if save == wxID_YES:
+        self.OnSave(event)
+
     RuntimeSettings.saveRuntimeSettings(self)
     self._app.removeInstance(self)
     self.Destroy()
Index: gnue/designer/src/MenuBar.py
diff -u gnue/designer/src/MenuBar.py:1.11 gnue/designer/src/MenuBar.py:1.12
--- gnue/designer/src/MenuBar.py:1.11   Thu Jul 12 18:51:08 2001
+++ gnue/designer/src/MenuBar.py        Sat Nov 10 17:01:09 2001
@@ -31,49 +31,102 @@
 from gnue.forms import GFForm, GFInstance, GFParser, GFObjects, GFTrigger, 
GFLibrary, UIwxpython
 import Incubator
 
+# File menu
 ID_NEW = wxNewId()
-ID_NEWWZD = wxNewId()
 ID_OPEN = wxNewId()
+ID_OPEN_RECENT = wxNewId()
 ID_SAVE = wxNewId()
 ID_SAVE_AS = wxNewId()
+ID_SAVE_ALL = wxNewId()
 ID_CLOSE = wxNewId()
+ID_RELOAD = wxNewId()
 ID_EXIT = wxNewId()
-ID_ABOUT = wxNewId()
+
+# FileNew menu
+ID_NEW_FORM = wxNewId()
+ID_NEW_REPORT = wxNewId()
+ID_NEW_WIZARD = wxNewId()
+
+# Edit menu
+ID_CUT = wxNewId()
+ID_COPY = wxNewId()
+ID_PASTE = wxNewId()
+ID_PASTE_SPECIAL = wxNewId()
+ID_DELETE = wxNewId()
+
+# Debug menu
 ID_RUN = wxNewId()
 
+# Help menu
+ID_ABOUT = wxNewId()
 
 #
 #
 #
-class MainMenuBar(wxMenuBar): 
-  def __init__(self, frame): 
+class MainMenuBar(wxMenuBar):
+  def __init__(self, frame):
      wxMenuBar.__init__(self)
 
      self._frame = frame
 
      self._file = wxMenu()
-     self._file.Append(ID_NEW, "&New Form", "Create a new form")
-     self._file.Append(ID_NEWWZD, "&New Form from Wizard", "Create a new form 
from a wizard")
-     self._file.Append(ID_OPEN, "&Open...", "Open an existing form")
-     self._file.Append(ID_SAVE, "&Save", "Save the current form")
-     self._file.Append(ID_SAVE_AS, "Save &As...", "Save the current form under 
a new name")
+     self._fileNew = wxMenu()
+     self._fileRecent = wxMenu()
+     self._file.AppendMenu(ID_NEW, "&New", self._fileNew,"Create a new object")
+     self._file.Append(ID_OPEN, "&Open...", "Open an existing object")
+     self._file.AppendMenu(ID_OPEN_RECENT, "Open &Recent", self._fileRecent, \
+                           "Open an existing object")
      self._file.AppendSeparator()
-     self._file.Append(ID_CLOSE, "&Close", "Close the current form") 
+     self._file.Append(ID_SAVE, "&Save", "Save the current object")
+     self._file.Append(ID_SAVE_AS, "Save &As...", \
+                       "Save the current form under a new name")
+     self._file.Append(ID_SAVE_ALL, "Save A&ll", \
+                       "Save all open objects")
      self._file.AppendSeparator()
-     self._file.Append(ID_EXIT, "E&xit", "Exit GNUe Forms Designer")
-     EVT_MENU (frame, ID_NEW, frame._app.OnNew)
-     EVT_MENU (frame, ID_NEWWZD, frame._app.OnWizard)
+     self._file.Append(ID_RELOAD, "Reload", \
+        "Reload the current object as of its last save (abandoning any 
changes)")
+     self._file.AppendSeparator()
+     self._file.Append(ID_CLOSE, "&Close", "Close the current object")
+     self._file.AppendSeparator()
+     self._file.Append(ID_EXIT, "E&xit", "Exit GNUe Designer")
+
+     EVT_MENU (frame, ID_NEW_FORM, frame._app.OnNew)
+     EVT_MENU (frame, ID_NEW_WIZARD, frame._app.OnWizard)
      EVT_MENU (frame, ID_OPEN, frame._app.OnOpen)
      EVT_MENU (frame, ID_SAVE, frame.OnSave)
      EVT_MENU (frame, ID_SAVE_AS, frame.OnSaveAs)
+     EVT_MENU (frame, ID_SAVE_ALL, frame._app.OnSaveAll)
      EVT_MENU (frame, ID_CLOSE, frame.OnClose)
      EVT_MENU (frame, ID_EXIT, frame._app.OnExit)
 
+     self._fileNew.Append(ID_NEW_FORM,'&Form', "Create a new form")
+     self._fileNew.Append(ID_NEW_REPORT,'&Report', "Create a new report")
+     self._fileNew.AppendSeparator()
+     self._fileNew.Append(ID_NEW_WIZARD,'from &Wizard...', \
+                          "Create a new object from a wizard")
+
+     self._fileNew.Enable(ID_NEW_REPORT,0)
+     self._file.Enable(ID_RELOAD,0)
+
      self._help = wxMenu()
      self._help.Append(ID_ABOUT, "&About...", "More information about GNUe 
Forms Designer")
      EVT_MENU (frame, ID_ABOUT, frame._app.OnAbout)
 
      self._edit = wxMenu()
+     self._edit.Append(ID_CUT, "C&ut", "Cut the current object and move to the 
clipboard")
+     self._edit.Append(ID_COPY, "&Copy", "Copy the current object to the 
clipboard")
+     self._edit.Append(ID_PASTE, "&Paste", "Paste the current object on the 
clipboard")
+     self._edit.Append(ID_PASTE_SPECIAL, "Paste &Special...", "Paste the 
current object on the clipboard with special attributes")
+     self._edit.AppendSeparator()
+     self._edit.Append(ID_DELETE, "&Delete", "Delete the current object")
+
+     # TODO: Implement clipboard
+     self._edit.Enable(ID_CUT,0)
+     self._edit.Enable(ID_COPY,0)
+     self._edit.Enable(ID_PASTE,0)
+     self._edit.Enable(ID_PASTE_SPECIAL,0)
+     self._edit.Enable(ID_DELETE,0)
+
      self._window = wxMenu()
 
      self._debug = wxMenu()
@@ -85,16 +138,17 @@
      self.Append(self._debug, '&Debug')
      self.Append(self._window, '&Window')
      self.Append(self._help, '&Help')
-    
 
-  def addTool(self, toolFrame, title): 
-    
+
+  def addTool(self, toolFrame, title):
+
     toolFrame._wxMenuID = wxNewId()
-    toolFrame._menu = wxMenuItem(self._window, toolFrame._wxMenuID, 
+    toolFrame._menu = wxMenuItem(self._window, toolFrame._wxMenuID,
           '&%s' % title, "Show or hide the %s" % title, 1)
     self._window.AppendItem(toolFrame._menu)
     EVT_MENU(self._frame, toolFrame._wxMenuID, toolFrame.OnMenuSelected)
 
-  def lastToolAdded(self): 
+  def lastToolAdded(self):
    self._window.AppendSeparator()
+
 



reply via email to

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