commit-gnue
[Top][All Lists]
Advanced

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

gnue common/src/GDataObjects.py common/src/GDat...


From: Jason Cater
Subject: gnue common/src/GDataObjects.py common/src/GDat...
Date: Thu, 12 Dec 2002 19:55:13 -0500

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/12/12 19:55:13

Modified files:
        common/src     : GDataObjects.py GDataSource.py 
        common/src/cursing: ColorScheme.py 
        forms/doc      : Developers-Guide.sxw 
        forms/src/GFObjects: GFDataSource.py 

Log message:
        * Implemented block-level (per-record) Pre-Query and Post-Query
        * More updates on Dev Guide

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/GDataObjects.py.diff?tr1=1.61&tr2=1.62&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/GDataSource.py.diff?tr1=1.54&tr2=1.55&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/cursing/ColorScheme.py.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/doc/Developers-Guide.sxw.diff?tr1=1.24&tr2=1.25&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/src/GFObjects/GFDataSource.py.diff?tr1=1.17&tr2=1.18&r1=text&r2=text

Patches:
Index: gnue/common/src/GDataObjects.py
diff -c gnue/common/src/GDataObjects.py:1.61 
gnue/common/src/GDataObjects.py:1.62
*** gnue/common/src/GDataObjects.py:1.61        Thu Dec 12 12:57:53 2002
--- gnue/common/src/GDataObjects.py     Thu Dec 12 19:55:11 2002
***************
*** 269,280 ****
          GDebug.printMesg(10,"Adding criteria")
          criteria[string.strip(self._detailfields[i])] = \
              master.current.getField(string.strip(self._masterfields[i]))
!         
          #If all are set to None then this will prevent the details
          #from being queried.  This happens are startup with blank master
          #datasources.
          doQuery = doQuery or 
master.current.getField(string.strip(self._masterfields[i]))
!         
          GDebug.printMesg(10,master.current.getField(self._masterfields[i]))
        if doQuery:
          master.current.addDetailResultSet(self.createResultSet(\
--- 269,280 ----
          GDebug.printMesg(10,"Adding criteria")
          criteria[string.strip(self._detailfields[i])] = \
              master.current.getField(string.strip(self._masterfields[i]))
! 
          #If all are set to None then this will prevent the details
          #from being queried.  This happens are startup with blank master
          #datasources.
          doQuery = doQuery or 
master.current.getField(string.strip(self._masterfields[i]))
! 
          GDebug.printMesg(10,master.current.getField(self._masterfields[i]))
        if doQuery:
          master.current.addDetailResultSet(self.createResultSet(\
***************
*** 326,332 ****
    # Returns 1=At last record, 0=Not last record
    def isLastRecord(self):
      if self._currentRecord < len(self._cachedRecords) - 1 or \
!        self._loadNextRecord():
        return 0
      else:
        return 1
--- 326,332 ----
    # Returns 1=At last record, 0=Not last record
    def isLastRecord(self):
      if self._currentRecord < len(self._cachedRecords) - 1 or \
!        self._cacheNextRecord():
        return 0
      else:
        return 1
***************
*** 347,353 ****
  
    # Get a specific record (0=based)
    def getRecord(self, record):
!     while (record + 1 > len(self._cachedRecords)) and self._loadNextRecord():
        pass
  
      if record + 1 > len(self._cachedRecords):
--- 347,353 ----
  
    # Get a specific record (0=based)
    def getRecord(self, record):
!     while (record + 1 > len(self._cachedRecords)) and self._cacheNextRecord():
        pass
  
      if record + 1 > len(self._cachedRecords):
***************
*** 359,365 ****
    # move to record #, returns 1=New record loaded, 0=invalid #
    def setRecord(self, record):
  
!     while (record > len(self._cachedRecords) -1) and self._loadNextRecord():
        pass
  
      if record >= len(self._cachedRecords):
--- 359,365 ----
    # move to record #, returns 1=New record loaded, 0=invalid #
    def setRecord(self, record):
  
!     while (record > len(self._cachedRecords) -1) and self._cacheNextRecord():
        pass
  
      if record >= len(self._cachedRecords):
***************
*** 373,379 ****
    # returns 1=New record loaded, 0=No more records
    def nextRecord(self):
      if self._currentRecord + 1 == len(self._cachedRecords):
!       if not self._loadNextRecord():
          return 0
  
      self._currentRecord += 1
--- 373,379 ----
    # returns 1=New record loaded, 0=No more records
    def nextRecord(self):
      if self._currentRecord + 1 == len(self._cachedRecords):
!       if not self._cacheNextRecord():
          return 0
  
      self._currentRecord += 1
***************
*** 396,402 ****
    # returns 1=at first record, 0=No records loaded
    def firstRecord(self):
      if self._currentRecord < 0:
!       if not self._loadNextRecord():
          return 0
  
      self._currentRecord = 0
--- 396,402 ----
    # returns 1=at first record, 0=No records loaded
    def firstRecord(self):
      if self._currentRecord < 0:
!       if not self._cacheNextRecord():
          return 0
  
      self._currentRecord = 0
***************
*** 411,417 ****
      if self._currentRecord == -1:
        return 0
      else:
!       while self._loadNextRecord():
          pass
        self._currentRecord = len(self._cachedRecords) - 1
        self.current = self._cachedRecords[self._currentRecord]
--- 411,417 ----
      if self._currentRecord == -1:
        return 0
      else:
!       while self._cacheNextRecord():
          pass
        self._currentRecord = len(self._cachedRecords) - 1
        self.current = self._cachedRecords[self._currentRecord]
***************
*** 534,539 ****
--- 534,548 ----
        return 
self._dataObject._fieldReferences.has_key(string.lower(fieldName))
  
  
+   # Load cacheCount number of new records
+   def _cacheNextRecord(self):
+     rs = self._loadNextRecord()
+     if rs:
+       self._dataObject._dataSource._onRecordLoaded(self._cachedRecords[-1])
+     return rs
+ 
+ 
+ 
    ###
    ### Methods below should be overridden by Vendor Specific functions
    ### (_createEmptyRecord may not need to be overridden in all cases)
***************
*** 542,548 ****
    # Load cacheCount number of new records
    def _loadNextRecord(self):
      return 0
- 
  
    # Create an empty recordset
    def _createEmptyRecord(self):
--- 551,556 ----
Index: gnue/common/src/GDataSource.py
diff -c gnue/common/src/GDataSource.py:1.54 gnue/common/src/GDataSource.py:1.55
*** gnue/common/src/GDataSource.py:1.54 Tue Dec  3 22:05:28 2002
--- gnue/common/src/GDataSource.py      Thu Dec 12 19:55:11 2002
***************
*** 348,354 ****
    def _onModification(self, record):
      return 1
  
!   def _onNewRecordQueried(self, record):
      return 1
  
  
--- 348,354 ----
    def _onModification(self, record):
      return 1
  
!   def _onRecordLoaded(self, record):
      return 1
  
  
Index: gnue/common/src/cursing/ColorScheme.py
diff -c gnue/common/src/cursing/ColorScheme.py:1.3 
gnue/common/src/cursing/ColorScheme.py:1.4
*** gnue/common/src/cursing/ColorScheme.py:1.3  Thu Dec 12 15:35:08 2002
--- gnue/common/src/cursing/ColorScheme.py      Thu Dec 12 19:55:13 2002
***************
*** 143,148 ****
--- 143,150 ----
          'MENUBAR=BLACK,WHITE;'
          'MENUBAR_FOCUS=BLUE,WHITE;'
          'LABEL=BLACK,WHITE;'
+         'STATUSBAR=BLACK,WHITE;'
+         'STATUSBAR_FIELD=BLACK,WHITE;'
          'DIALOG=BLACK,WHITE;'
          'DIALOG_TITLE=BLACK,WHITE;'
          'BUTTON=BLUE,WHITE;'
***************
*** 152,159 ****
          'SCROLL_BACKGROUND=BLUE,WHITE;'
          'SCROLL_SLIDER=WHITE,BLUE;'
          'SCROLL_SLIDER_FOCUS=BLACK,CYAN;'
-         'STATUSBAR=BLACK,WHITE;'
-         'STATUSBAR_FIELD=BLUE,WHITE;'
          'DROPSHADOW=WHITE,BLACK' )
  
  
--- 154,159 ----
Index: gnue/forms/doc/Developers-Guide.sxw
Index: gnue/forms/src/GFObjects/GFDataSource.py
diff -c gnue/forms/src/GFObjects/GFDataSource.py:1.17 
gnue/forms/src/GFObjects/GFDataSource.py:1.18
*** gnue/forms/src/GFObjects/GFDataSource.py:1.17       Thu Oct 24 00:39:02 2002
--- gnue/forms/src/GFObjects/GFDataSource.py    Thu Dec 12 19:55:13 2002
***************
*** 49,73 ****
    #
  
    def _beforeCommitInsert(self, record):
!     self._form.dispatchEvent(events.Event('preInsert', record=record))
!     self._form.dispatchEvent(events.Event('preCommit', record=record))
  
    def _beforeCommitUpdate(self, record):
!     self._form.dispatchEvent(events.Event('preUpdate', record=record))
!     self._form.dispatchEvent(events.Event('preCommit', record=record))
  
    def _beforeCommitDelete(self, record):
!     self._form.dispatchEvent(events.Event('preDelete', record=record))
!     self._form.dispatchEvent(events.Event('preCommit', record=record))
  
    def _onModification(self, record):
      try:
        record.__firstModification
      except NameError:
        record.__firstModification = 1
!       self._form.dispatchEvent(events.Event('onRecordTouched', record))
  
!   def _onNewRecordQueried(self, record):
      return 1
  
  
--- 49,75 ----
    #
  
    def _beforeCommitInsert(self, record):
!     self._form.dispatchEvent('preInsert', record=record)
!     self._form.dispatchEvent('preCommit', record=record)
  
    def _beforeCommitUpdate(self, record):
!     self._form.dispatchEvent('preUpdate', record=record)
!     self._form.dispatchEvent('preCommit', record=record)
  
    def _beforeCommitDelete(self, record):
!     self._form.dispatchEvent('preDelete', record=record)
!     self._form.dispatchEvent('preCommit', record=record)
  
    def _onModification(self, record):
      try:
        record.__firstModification
      except NameError:
        record.__firstModification = 1
!       self._form.dispatchEvent('onRecordTouched', record=record)
!     return 1
  
!   def _onRecordLoaded(self, record):
!     self._form.dispatchEvent('onQueryNewRecord', record=record)
      return 1
  
  



reply via email to

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