[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r7185 - trunk/gnue-common/src/datasources/drivers/Base
From: |
reinhard |
Subject: |
[gnue] r7185 - trunk/gnue-common/src/datasources/drivers/Base |
Date: |
Sat, 12 Mar 2005 05:12:44 -0600 (CST) |
Author: reinhard
Date: 2005-03-12 05:12:42 -0600 (Sat, 12 Mar 2005)
New Revision: 7185
Modified:
trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py
Log:
Sync current record number, details, and user interface correctly after posting
a record.
Modified: trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py 2005-03-12
00:08:14 UTC (rev 7184)
+++ trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py 2005-03-12
11:12:42 UTC (rev 7185)
@@ -124,6 +124,17 @@
return self._cachedRecords[record]
+ # Sync self.current with self._currentRecord and adjust detail resultsets and
+ # the user interface
+ def __sync (self):
+ if self._currentRecord == -1:
+ self.current = None
+ else:
+ self.current = self._cachedRecords [self._currentRecord]
+ self.notifyDetailObjects ()
+ self.__notifyListeners ()
+
+
# Move to a record number already in cache
# -1 sets the current record to None
def __move (self, record):
@@ -131,12 +142,7 @@
or (self._currentRecord >= 0 \
and self.current != self._cachedRecords [self._currentRecord]):
self._currentRecord = record
- if record == -1:
- self.current = None
- else:
- self.current = self._cachedRecords [self._currentRecord]
- self.notifyDetailObjects ()
- self.__notifyListeners ()
+ self.__sync ()
# move to record #, returns record or None if record number out of range
@@ -401,10 +407,10 @@
self._currentRecord = 0
else:
self._currentRecord = -1
-# TODO: I don't think we need this anymore
-# if self._currentRecord >= self._recordCount:
-# self._currentRecord = self._recordCount - 1
+ # Now bring everything else up to date again
+ self.__sync ()
+
def notifyDetailObjects(self):
gDebug (8,'Master record changed; Notifying Detail Objects')
for detail in self._dataObject._detailObjects:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r7185 - trunk/gnue-common/src/datasources/drivers/Base,
reinhard <=