commit-gnue
[Top][All Lists]
Advanced

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

gnue/gnuef TODO client/gfclient src/GFForm.py s...


From: James Thompson
Subject: gnue/gnuef TODO client/gfclient src/GFForm.py s...
Date: Sat, 04 Nov 2000 20:14:52 -0800

CVSROOT:        /cvs
Module name:    gnue
Changes by:     James Thompson <address@hidden> 00/11/04 20:14:52

Modified files:
        gnuef          : TODO 
        gnuef/client   : gfclient 
        gnuef/src      : GFForm.py GFObjects.py UIwxpython.py 

Log message:
        status bar speedups
        added support for checking that data is saved prior to query/exit
        (moved exit approval from UI to GFForm)
        start of a GUI login box (currently visible via help->about)

CVSWeb URLs:
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/TODO.diff?r1=1.18&r2=1.19
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/client/gfclient.diff?r1=1.1&r2=1.2
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/src/GFForm.py.diff?r1=1.33&r2=1.34
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/src/GFObjects.py.diff?r1=1.30&r2=1.31
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/src/UIwxpython.py.diff?r1=1.25&r2=1.26

Patches:
Index: gnue/gnuef/TODO
diff -u gnue/gnuef/TODO:1.18 gnue/gnuef/TODO:1.19
--- gnue/gnuef/TODO:1.18        Thu Nov  2 21:18:48 2000
+++ gnue/gnuef/TODO     Sat Nov  4 20:14:51 2000
@@ -2,28 +2,30 @@
 name in []
 
 **MUST HAVES for 0.1.0
-**  Create UI/Form event interactions for login
-**  debug master/detail
-**  Make GFDataSource verify that all records in memory are saved
-       prior to clearing and new queries
+**  Create UI/Form event interactions for login[jamest]
 **  windows support (ODBC?)
+**  debug master/detail[jamest]
 **  make packages (RPM and deb) [jade]
 **  curses support up to date [arno]
 **  cvs cleanup[jamest]
 
-the x/y width units problem
+  fill in todo list (easy as there is a lot of DOs to TO) [everyone]
+
+  the x/y width units problem
+
+  mouse click out of field then F8 results in block error
 
-status bar speed is slow
+  status bar speed is slow
 
-current detail/masta code bombs if masta doesn't have an entry widget
-defined for that field.
+  current detail/masta code bombs if masta doesn't have an entry widget
+  defined for that field.
 
   creating a new record and marking for delete prior to any commit
     still causes record to commit
 
-  status bar not updating as soon as I'd like
-
-  fill in todo list (easy as there is a lot of DOs to TO) [everyone]
+  update status only on record switch induced bug:
+    status bar record status not updating as soon as I'd like
+    it's possible to exit/query w/o saving current record
 
   clean up code  [everyone working on the code]
     provide better seperation of Objects in the Data system
@@ -34,14 +36,10 @@
 
   Add toolbar support
 
-  Add order by support to datasource
+  Add layout manager support[perlpoet]
 
-  Add layout manager support
-
   need to add default attrib values support
   
-  Create GNUE Forms: Designer the screen painter
-
   Autocreate a datasource for block that don't specify one
 
   Make modification of data lock the record in the backend
@@ -60,21 +58,23 @@
   named triggers
 
   Move things like database init in GFForm out of __init__ and 
-  into a initialize routine that is called via some type of 
-  uiINITIALIZED event so that a UI windows can prompt for things
-  like name/password.  
+    into a initialize routine that is called via some type of 
+    uiINITIALIZED event so that a UI windows can prompt for things
+    like name/password.  
 
   move initialize function into the base object and have them
-  call the initializes of their children so we can get rid of 
-  more of the self.walk nonsense
+    call the initializes of their children so we can get rid of 
+    more of the self.walk nonsense
  
   Moving the focus from entry in one block to a different block does
-  not result in the currentBlock switching to the new block
+    not result in the currentBlock switching to the new block
  
   rewrite the whole friggen braindead focus system to accomidate
     mouse navigation to different blocks
 
   taborder support
+
+  Create GNUE Forms: Designer the screen painter
 
   Tweaks:
     certain attributes should only apply when in normal mode
Index: gnue/gnuef/client/gfclient
diff -u gnue/gnuef/client/gfclient:1.1 gnue/gnuef/client/gfclient:1.2
--- gnue/gnuef/client/gfclient:1.1      Fri Oct 27 12:59:26 2000
+++ gnue/gnuef/client/gfclient  Sat Nov  4 20:14:52 2000
@@ -12,6 +12,8 @@
 # HISTORY:
 # Copyright (c) 2000 James Thompson
 #
+import profile
+import pstats
 import os
 import sys
 import urllib
@@ -78,8 +80,9 @@
     ui.mainLoop()
       
 if __name__ == '__main__':
-  GFClient().run()
-  
+  profile.run("GFClient().run()","runstats")
+  p = pstats.Stats('runstats')
+  p.sort_stats('cumulative').print_stats(50)
     
 
 
Index: gnue/gnuef/src/GFForm.py
diff -u gnue/gnuef/src/GFForm.py:1.33 gnue/gnuef/src/GFForm.py:1.34
--- gnue/gnuef/src/GFForm.py:1.33       Thu Nov  2 21:18:48 2000
+++ gnue/gnuef/src/GFForm.py    Sat Nov  4 20:14:52 2000
@@ -52,6 +52,7 @@
                            'requestQUERY'      : self.requestQuery,
                            'executeQUERY'      : self.executeQuery,
                            'requestCOMMIT'     : self.executeCommit,
+                           'requestEXIT'       : self.executeExit,
 
                            'recordSWITCHED'    : self.recordSwitched,
                            'notifyMASTERSWITCH': self.notifyDetailBlocks,
@@ -218,7 +219,7 @@
     self.dispatchEvent(GFEvent('gotoENTRY',self.currentEntry));
     self.updateRecordCounter()
     self.updateRecordStatus()
-    self.updateTip()
+#    self.updateTip()
 
   def prevRecord(self, event):
     self.dispatchEvent(GFEvent('uiPREVRECORD',self.currentEntry))
@@ -226,16 +227,13 @@
     self.dispatchEvent(GFEvent('gotoENTRY',self.currentEntry));
     self.updateRecordCounter()
     self.updateRecordStatus()
-    self.updateTip()
+#    self.updateTip()
 
   def newRecord(self, event):
     if not hasattr(self,'readonly'):
       self.dispatchEvent(GFEvent('newRECORD',self.currentBlock))
       self.updateRecordStatus()
       self.updateRecordCounter()
-#      self.updateTip()
-
-        
     else:
       self.dispatchEvent(GFEvent('formALERT','Form is readonly'))
 
@@ -246,8 +244,20 @@
     else:
       self.dispatchEvent(GFEvent('formALERT','Form is readonly'))
       
+  def executeExit(self, event):
+    for block in self.blockList:
+      if not block.isSaved():
+        self.dispatchEvent(GFEvent('formALERT','Current data not saved'))
+        return
+    else:
+      self.dispatchEvent(GFEvent('exitApplication','Current data is saved'))
 
   def requestQuery(self, event):
+    for block in self.blockList:
+      if not block.isSaved():
+        self.dispatchEvent(GFEvent('formALERT','Current data not saved'))
+        return
+                      
     self.dispatchEvent(GFEvent('initQUERY',self.currentBlock))
     self.updateStatus()
     
@@ -266,8 +276,6 @@
                                
   def recordSwitched(self, event):
     self.dispatchEvent(GFEvent('updateENTRY',event.data))
-    self.updateRecordStatus()
-    self.updateTip()
 
   def notifyDetailBlocks(self, event):
     self.dispatchEvent(GFEvent('updateDETAILBLOCK',event.data))
Index: gnue/gnuef/src/GFObjects.py
diff -u gnue/gnuef/src/GFObjects.py:1.30 gnue/gnuef/src/GFObjects.py:1.31
--- gnue/gnuef/src/GFObjects.py:1.30    Thu Nov  2 21:18:48 2000
+++ gnue/gnuef/src/GFObjects.py Sat Nov  4 20:14:52 2000
@@ -210,6 +210,12 @@
     self.recordCount = 
self.form.datasourceDictionary[self.datasource].getLastRecordNumber()
 #    GFObj.initialize()
 
+
+
+  def isSaved(self):
+    return self.dataSourceLink.isSaved()
+    
+    
   def buildEntryList(self, object):
     if object.getObjectType() == 'GFEntry':
        self.entryList.append(object)
@@ -508,6 +514,14 @@
 
   def getLastRecordNumber(self):
     return len(self.resultSet)-1
+
+  def isSaved(self):
+    value = 1
+    for count in range(len(self.resultSetStatus)):
+      if self.resultSetStatus[count] != 'saved':
+        value = 0
+        break
+    return value
   
   def query(self):
     if GFOptions.DEBUG:
Index: gnue/gnuef/src/UIwxpython.py
diff -u gnue/gnuef/src/UIwxpython.py:1.25 gnue/gnuef/src/UIwxpython.py:1.26
--- gnue/gnuef/src/UIwxpython.py:1.25   Wed Nov  1 18:57:30 2000
+++ gnue/gnuef/src/UIwxpython.py        Sat Nov  4 20:14:52 2000
@@ -65,7 +65,8 @@
                            'requireLOGIN' : self.getLogin,
                            'uiNEXTRECORD' : self.adjustMultiView,
                            'uiPREVRECORD' : self.adjustMultiView,
-                           'uiUPDATESTATUS': self.updateStatus
+                           'uiUPDATESTATUS': self.updateStatus,
+                           'exitApplication': self.exitApplication
                           }
 
     # Create the UI from the GFForm passed in
@@ -434,7 +435,8 @@
     
     helpMenu = wxMenu()
     print "About: ", helpMenu.Append( 300, "&About...", "Display info about 
gnuef" )
-    EVT_MENU(self, 300, self.OnAbout)
+#    EVT_MENU(self, 300, self.OnAbout)
+    EVT_MENU(self, 300, self.OnLogin)
 
 
     menuBar = wxMenuBar()
@@ -451,8 +453,21 @@
 
     self.currentWidget = [self.frame.panel]
     self.SetTopWindow(self.frame)
+
+    EVT_CLOSE(self.frame,self.closeTrap)
+    
     return self.frame
 
+  def closeTrap(self,event):
+    # hack for swig shortcomming
+    eo = event.GetEventObject()
+    object = wxPyTypeCast(eo, 'wxFrame')
+    if event.CanVeto():
+      print "It can be stoped", object
+      self.dispatchEvent(GFEvent('requestEXIT'))
+    else:
+      object.Destroy()
+      
   def OnAbout(self, event):
     dlg = wxMessageDialog(self.frame, "GNUE Forms : UIwxpython Driver\n"
                           "Version 0.0.1"
@@ -467,6 +482,28 @@
     dlg.ShowModal()
     dlg.Destroy()
 
+  def OnLogin(self, event):
+    dlg = wxDialog(self.frame, -1, "Login 
Required",wxPoint(-1,-1),wxSize(300,100))
+    dlg.SetBackgroundColour(wxWHITE)
+    dlg.SetAutoLayout(true)
+
+    entryBox = wxBoxSizer(wxVERTICAL)
+    entryBox.Add(wxStaticText(dlg, 1010, "Username"), 0)
+    entryBox.Add(wxTextCtrl(dlg, 1020),0)
+    entryBox.Add(wxStaticText(dlg, 1010, "Password"), 0)
+    entryBox.Add(wxTextCtrl(dlg, 1030,"", 
wxPoint(-1,-1),wxSize(-1,-1),wxTE_PASSWORD),0)
+
+    bmp = wxImage('../src/gnue.bmp', wxBITMAP_TYPE_BMP).ConvertToBitmap()
+
+
+    mainBox = wxBoxSizer(wxHORIZONTAL)
+    mainBox.Add(wxStaticBitmap(dlg,-1, bmp, wxPoint(-1, 
-1),wxSize(bmp.GetWidth(), bmp.GetHeight())),0)
+    mainBox.Add(entryBox,0)
+    
+    dlg.SetSizer( mainBox )
+    dlg.ShowModal()
+    dlg.Destroy()
+
   def getLogin(self,event):
     print "trying to get it now dude"
     dlg = wxDialog(self.frame, -1, "Login Required")
@@ -487,8 +524,10 @@
                                       
 
   def TimeToQuit(self, event):
-    self.frame.Close(true)
+    self.frame.Close()
 
+  def exitApplication(self,event):
+    self.frame.Close(true)
               
   def entryHandler(self):
     object    = self.currentObject[0]



reply via email to

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