commit-gnue
[Top][All Lists]
Advanced

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

gnue/designer/src GFDesigner.py Instance.py Run...


From: Jason Cater
Subject: gnue/designer/src GFDesigner.py Instance.py Run...
Date: Fri, 11 Jan 2002 10:49:09 -0500

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/01/11 10:49:09

Modified files:
        designer/src   : GFDesigner.py Instance.py RuntimeSettings.py 
        designer/src/forms: Instance.py __init__.py 

Log message:
        fix to designer's breakage; made Object Tree it's own window; made 
Layout Editor the default main window component

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/GFDesigner.py.diff?tr1=1.26&tr2=1.27&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/Instance.py.diff?tr1=1.36&tr2=1.37&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/RuntimeSettings.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/forms/Instance.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/forms/__init__.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: gnue/designer/src/GFDesigner.py
diff -c gnue/designer/src/GFDesigner.py:1.26 
gnue/designer/src/GFDesigner.py:1.27
*** gnue/designer/src/GFDesigner.py:1.26        Fri Jan 11 02:35:55 2002
--- gnue/designer/src/GFDesigner.py     Fri Jan 11 10:49:09 2002
***************
*** 35,41 ****
  
  # TODO: Must go!!
  from gnue.forms import UIwxpython, GFForm
! from gnue.designer.forms import Instance as GFDInstance
  
  
  class GFDesigner(GClientApp, wxApp):
--- 35,41 ----
  
  # TODO: Must go!!
  from gnue.forms import UIwxpython, GFForm
! from gnue.designer.forms.Instance import Instance as GFDInstance
  
  
  class GFDesigner(GClientApp, wxApp):
***************
*** 119,125 ****
  
      instance.Close()
  
!   def isFileOpened(self, location): 
      # TODO: Check to see if a file is already opened
      return 0
  
--- 119,125 ----
  
      instance.Close()
  
!   def isFileOpened(self, location):
      # TODO: Check to see if a file is already opened
      return 0
  
***************
*** 131,139 ****
                                        "All Files (*.*)|*.*",
                             style=wxOPEN)
      if dlg.ShowModal() == wxID_OK:
!       if self.isFileOpened(dlg.GetPath()): 
          # TODO: Um, something better than this!!!
!         print "File is already opened!" 
        else:
          GFDInstance(self, dlg.GetPath())
      dlg.Destroy()
--- 131,139 ----
                                        "All Files (*.*)|*.*",
                             style=wxOPEN)
      if dlg.ShowModal() == wxID_OK:
!       if self.isFileOpened(dlg.GetPath()):
          # TODO: Um, something better than this!!!
!         print "File is already opened!"
        else:
          GFDInstance(self, dlg.GetPath())
      dlg.Destroy()
***************
*** 142,148 ****
    def OnOpenRecent(self, event):
  
      location = self.mru.mruMenuMap[event.GetId()]
!     if not self.isFileOpened(location): 
        GFDInstance( self, location )
  
  
--- 142,148 ----
    def OnOpenRecent(self, event):
  
      location = self.mru.mruMenuMap[event.GetId()]
!     if not self.isFileOpened(location):
        GFDInstance( self, location )
  
  
***************
*** 170,176 ****
      dlg = wxMessageDialog(NULL, self.NAME + "\n"
                                  "GNUe Rapid Application Development.\n\n"
                                  "Version  " + self.VERSION + "\n\n"
!                                 "Copyright 2001 Free Software Foundation\n\n "
                                  "For help, email address@hidden",
                                  "About " + self.NAME, 
style=wxOK|wxICON_INFORMATION)
      dlg.ShowModal()
--- 170,176 ----
      dlg = wxMessageDialog(NULL, self.NAME + "\n"
                                  "GNUe Rapid Application Development.\n\n"
                                  "Version  " + self.VERSION + "\n\n"
!                                 "Copyright 2001-2002 Free Software 
Foundation\n\n "
                                  "For help, email address@hidden",
                                  "About " + self.NAME, 
style=wxOK|wxICON_INFORMATION)
      dlg.ShowModal()
Index: gnue/designer/src/Instance.py
diff -c gnue/designer/src/Instance.py:1.36 gnue/designer/src/Instance.py:1.37
*** gnue/designer/src/Instance.py:1.36  Fri Jan 11 02:35:55 2002
--- gnue/designer/src/Instance.py       Fri Jan 11 10:49:09 2002
***************
*** 117,143 ****
      self.Show(true)
  
      # Split Plane
!     vsplitter = wxSplitterWindow (self, -1, style=wxSP_3D|wxNO_3D)
!     vsplitter.SetMinimumPaneSize (100)
  
      self._form.walk(self.inventoryLoadedItems)
  
      # Create our tools
      self.objectListeners = ()
  
!     self.tree = TreeView(self, self._form, vsplitter)
  
!     self.layoutEditorWindow = ToolFrame(self, "Layout Editor")
      self.layoutEditorWindow.default_visible = 1
      self.layoutEditorWindow.default_width = 450
      self.layoutEditorWindow.default_height = 400
      self.layoutEditor = LayoutEditor(self, self.layoutEditorWindow)
!     self.layoutEditorWindow.finalize()
  
! #    self.triggerEditorWindow = ToolFrame(self, "Event Editor")
!     self.triggerEditorWindow = vsplitter
      self.triggerEditor = TriggerEditor(self.triggerEditorWindow, self, 
self._form)
! #    self.triggerEditorWindow.finalize()
  
      self.propertyEditorWindow = PropertyToolFrame(self, "Property Inspector")
      self.propertyEditor = self.propertyEditorWindow.propertyEditor
--- 117,148 ----
      self.Show(true)
  
      # Split Plane
! #    vsplitter = wxSplitterWindow (self, -1, style=wxSP_3D|wxNO_3D)
! #    vsplitter.SetMinimumPaneSize (100)
  
      self._form.walk(self.inventoryLoadedItems)
  
      # Create our tools
      self.objectListeners = ()
  
! #    self.tree = TreeView(self, self._form, vsplitter)
  
! #    self.layoutEditorWindow = ToolFrame(self, "Layout Editor")
!     self.layoutEditorWindow = self
      self.layoutEditorWindow.default_visible = 1
      self.layoutEditorWindow.default_width = 450
      self.layoutEditorWindow.default_height = 400
      self.layoutEditor = LayoutEditor(self, self.layoutEditorWindow)
! #    self.layoutEditorWindow.finalize()
  
!     self.treeEditorWindow = ToolFrame(self, "Object Navigator")
!     self.treeEditor = TreeView(self, self._form, self.treeEditorWindow)
!     self.treeEditorWindow.finalize()
!     self.tree = self.treeEditor # TODO: This needs to be removed
! 
!     self.triggerEditorWindow = ToolFrame(self, "Event Editor")
      self.triggerEditor = TriggerEditor(self.triggerEditorWindow, self, 
self._form)
!     self.triggerEditorWindow.finalize()
  
      self.propertyEditorWindow = PropertyToolFrame(self, "Property Inspector")
      self.propertyEditor = self.propertyEditorWindow.propertyEditor
***************
*** 155,164 ****
  
      self._currentPage = self._pages[0]
  #    vsplitter.SplitVertically(self.tree, self.layoutEditor)
!     vsplitter.SplitVertically(self.tree, self.triggerEditor)
!     vsplitter.SetSashPosition (
!         RuntimeSettings.getint(self.runtime_section, 'vsash', 170), true)
!     self.vsplitter = vsplitter
      self.tree.Expand(self._form._treeItem)
  
      self._menubar.lastToolAdded()
--- 160,169 ----
  
      self._currentPage = self._pages[0]
  #    vsplitter.SplitVertically(self.tree, self.layoutEditor)
! #    vsplitter.SplitVertically(self.tree, self.triggerEditor)
! #    vsplitter.SetSashPosition (
! #        RuntimeSettings.getint(self.runtime_section, 'vsash', 170), true)
! #    self.vsplitter = vsplitter
      self.tree.Expand(self._form._treeItem)
  
      self._menubar.lastToolAdded()
***************
*** 166,172 ****
      self._app.addInstance(self)
  
      # Fit the widgets to the screen
!     vsplitter.Fit()
      self.layoutEditor.Fit()
      self.Fit()
  
--- 171,177 ----
      self._app.addInstance(self)
  
      # Fit the widgets to the screen
! #    vsplitter.Fit()
      self.layoutEditor.Fit()
      self.Fit()
  
***************
*** 223,230 ****
               { 'x': abs(x),
                 'y': abs(y),
                 'height': height,
!                'width': width,
!                'vsash': self.vsplitter.GetSashPosition()  } )
  
    # Hack having to do with UIwxpython import
    def uiEventTrap(self, event):
--- 228,234 ----
               { 'x': abs(x),
                 'y': abs(y),
                 'height': height,
!                'width': width  } )
  
    # Hack having to do with UIwxpython import
    def uiEventTrap(self, event):
***************
*** 353,366 ****
           child._type == 'GFimport-datasource'):
          datasources.append(child)
        elif isinstance(child, GFTrigger.GFTrigger) or \
!         (isinstance(child, GFLibrary.GFImportItem) and 
!          child._type == 'GFimport-trigger'): 
          triggers.append(child)
        elif isinstance(child, GFObjects.GFPage) or \
          (isinstance(child, GFLibrary.GFImportItem) and
!          child._type == 'GFimport-page'): 
          pages.append(child)
!       else: 
          other.append(child)
  
  
--- 357,370 ----
           child._type == 'GFimport-datasource'):
          datasources.append(child)
        elif isinstance(child, GFTrigger.GFTrigger) or \
!         (isinstance(child, GFLibrary.GFImportItem) and
!          child._type == 'GFimport-trigger'):
          triggers.append(child)
        elif isinstance(child, GFObjects.GFPage) or \
          (isinstance(child, GFLibrary.GFImportItem) and
!          child._type == 'GFimport-page'):
          pages.append(child)
!       else:
          other.append(child)
  
  
***************
*** 374,380 ****
        self._form._children.append(child)
      for child in triggers:
        self._form._children.append(child)
!     for child in pages: 
        self._form._children.append(child)
      for child in other:
        self._form._children.append(child)
--- 378,384 ----
        self._form._children.append(child)
      for child in triggers:
        self._form._children.append(child)
!     for child in pages:
        self._form._children.append(child)
      for child in other:
        self._form._children.append(child)
***************
*** 382,388 ****
      fileHandle = open(location,'w')
      if sys.getdefaultencoding() == 'ascii':
        fileHandle.write('<?xml version="1.0"?>\n\n')
!     else: 
        fileHandle.write('<?xml version="1.0" encoding="%s"?>\n\n' % \
             (sys.getdefaultencoding()))
  
--- 386,392 ----
      fileHandle = open(location,'w')
      if sys.getdefaultencoding() == 'ascii':
        fileHandle.write('<?xml version="1.0"?>\n\n')
!     else:
        fileHandle.write('<?xml version="1.0" encoding="%s"?>\n\n' % \
             (sys.getdefaultencoding()))
  
Index: gnue/designer/src/RuntimeSettings.py
diff -c gnue/designer/src/RuntimeSettings.py:1.6 
gnue/designer/src/RuntimeSettings.py:1.7
*** gnue/designer/src/RuntimeSettings.py:1.6    Mon Nov 26 12:40:32 2001
--- gnue/designer/src/RuntimeSettings.py        Fri Jan 11 10:49:09 2002
***************
*** 31,66 ****
  
  
  if os.environ.has_key('HOME'):
!   try: 
      os.makedirs(os.environ['HOME']+'/.gnue')
    except:
      pass
    location = os.environ['HOME']+'/.gnue/gnue-des.ini'
! elif sys.platform[:3] in ('win','mac'): 
    location = 
os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])),'gnue-des.ini')
! else: 
    location = 'gnue-des.ini'
  
! try: 
    config = ConfigParser.ConfigParser()
    config.read(location)
! except: 
    config = None
  
  
! def registerInstance(instance): 
    instance._runtimes = []
  
  
! def get(section, setting, default): 
!   try: 
      return config.get(section, setting)
    except:
      return default
  
  
! def getint(section, setting, default): 
!   try: 
      return config.getint(section, setting)
    except:
      return default
--- 31,66 ----
  
  
  if os.environ.has_key('HOME'):
!   try:
      os.makedirs(os.environ['HOME']+'/.gnue')
    except:
      pass
    location = os.environ['HOME']+'/.gnue/gnue-des.ini'
! elif sys.platform[:3] in ('win','mac'):
    location = 
os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])),'gnue-des.ini')
! else:
    location = 'gnue-des.ini'
  
! try:
    config = ConfigParser.ConfigParser()
    config.read(location)
! except:
    config = None
  
  
! def registerInstance(instance):
    instance._runtimes = []
  
  
! def get(section, setting, default):
!   try:
      return config.get(section, setting)
    except:
      return default
  
  
! def getint(section, setting, default):
!   try:
      return config.getint(section, setting)
    except:
      return default
***************
*** 68,95 ****
  
  #
  # Save the runtime settings
! # 
! def saveRuntimeSettings(instance): 
    if location:
      try:
        fh = open(location,'w')
        try:
!         for h in instance._runtimes: 
            section, hash = h.saveRuntimeSettings()
  
!           if len(hash.keys()): 
              fh.write ("\n[%s]\n" % section)
!             for key in hash.keys(): 
                fh.write ("%s=%s\n" % (key, hash[key]))
  
!         fh.write("\n") 
!       except: 
          print "\nWarning: Unable to save session data to %s\n" % location
        fh.close()
!     except: 
        print "\nWarning: Unable to save session data to %s\n" % location
  #
! # Any object (class) that has settings it wants saved should 
  # register with this method.  The object should define a
  # getRuntimeSettings() method.
  #
--- 68,97 ----
  
  #
  # Save the runtime settings
! #
! def saveRuntimeSettings(instance):
    if location:
      try:
        fh = open(location,'w')
        try:
!         for h in instance._runtimes:
            section, hash = h.saveRuntimeSettings()
  
!           if len(hash.keys()):
              fh.write ("\n[%s]\n" % section)
!             for key in hash.keys():
                fh.write ("%s=%s\n" % (key, hash[key]))
  
!         fh.write("\n")
!       except:
          print "\nWarning: Unable to save session data to %s\n" % location
+         ##raise
        fh.close()
!     except:
        print "\nWarning: Unable to save session data to %s\n" % location
+       ##raise
  #
! # Any object (class) that has settings it wants saved should
  # register with this method.  The object should define a
  # getRuntimeSettings() method.
  #
Index: gnue/designer/src/forms/Instance.py
diff -c gnue/designer/src/forms/Instance.py:1.1 
gnue/designer/src/forms/Instance.py:1.2
*** gnue/designer/src/forms/Instance.py:1.1     Fri Jan 11 10:32:44 2002
--- gnue/designer/src/forms/Instance.py Fri Jan 11 10:49:09 2002
***************
*** 27,39 ****
  # NOTES:
  #
  
! from gnue.designer import Instance
  from gnue.designer.forms import properties
  
  from gnue.forms import GFInstance
  
  
! class Instance(Instance.BaseInstance, GFInstance.GFInstance):
  
    def __init__(self, app, *args, **params):
  
--- 27,39 ----
  # NOTES:
  #
  
! from gnue.designer.Instance import BaseInstance
  from gnue.designer.forms import properties
  
  from gnue.forms import GFInstance
  
  
! class Instance(BaseInstance, GFInstance.GFInstance):
  
    def __init__(self, app, *args, **params):
  
***************
*** 47,53 ****
                                     app.connections,
                                     None, disableSplash=1)
  
!     Instance.BaseInstance.__init__(self, app, *args, **params)
  
  
  
--- 47,53 ----
                                     app.connections,
                                     None, disableSplash=1)
  
!     BaseInstance.__init__(self, app, *args, **params)
  
  
  
Index: gnue/designer/src/forms/__init__.py
diff -c gnue/designer/src/forms/__init__.py:1.2 
gnue/designer/src/forms/__init__.py:1.3
*** gnue/designer/src/forms/__init__.py:1.2     Fri Jan 11 02:35:55 2002
--- gnue/designer/src/forms/__init__.py Fri Jan 11 10:49:09 2002
***************
*** 29,38 ****
  # the Instance class plus a properties object.
  #
  
! print "I beeze here!"
! #from Instance import Instance
  
! class FormToolProperties(Instance.FormProperties):
  
    application = 'GNUe Forms'
    nickname = 'Form'
--- 29,37 ----
  # the Instance class plus a properties object.
  #
  
! from gnue.designer import Instance
  
! class FormToolProperties(Instance.ToolProperties):
  
    application = 'GNUe Forms'
    nickname = 'Form'
***************
*** 45,47 ****
--- 44,48 ----
    defaultFileExtension = 'gfd'
  
  properties = FormToolProperties()
+ 
+ import Instance
\ No newline at end of file



reply via email to

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