[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r8919 - in trunk/gnue-common/src/datasources: . drivers/Base
From: |
reinhard |
Subject: |
[gnue] r8919 - in trunk/gnue-common/src/datasources: . drivers/Base |
Date: |
Tue, 24 Oct 2006 13:37:27 -0500 (CDT) |
Author: reinhard
Date: 2006-10-24 13:37:26 -0500 (Tue, 24 Oct 2006)
New Revision: 8919
Modified:
trunk/gnue-common/src/datasources/GDataSource.py
trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py
Log:
Send dsResultSetChanged to the front end after the requery, as several records
might have changed with the commit. Don't send dsCursorMoved in cases where a
dsResultSetChanged is sent anyway.
Modified: trunk/gnue-common/src/datasources/GDataSource.py
===================================================================
--- trunk/gnue-common/src/datasources/GDataSource.py 2006-10-24 16:52:48 UTC
(rev 8918)
+++ trunk/gnue-common/src/datasources/GDataSource.py 2006-10-24 18:37:26 UTC
(rev 8919)
@@ -775,6 +775,10 @@
self.__master.requeryAll (commit)
else:
self.__currentResultSet.requery (commit)
+ # Many records can have changed through backend triggers. The UI has to
+ # follow the changes.
+ self.__eventController.dispatchEvent ('dsResultSetChanged',
+ resultSet = self.__currentResultSet)
# ---------------------------------------------------------------------------
Modified: trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py 2006-10-24
16:52:48 UTC (rev 8918)
+++ trunk/gnue-common/src/datasources/drivers/Base/ResultSet.py 2006-10-24
18:37:26 UTC (rev 8919)
@@ -527,7 +527,7 @@
if record != self.__current_index or (self.__current_index >= 0 \
and self.current !=
self.__cached_records[self.__current_index]):
self.__current_index = record
- self.__sync()
+ self.__sync(True)
# -------------------------------------------------------------------------
@@ -591,7 +591,7 @@
record = self.__create_record(
defaultData = defaultData,
position = self.__current_index)
- self.__sync()
+ self.__sync(True)
return record
@@ -716,7 +716,7 @@
except:
# If any error happened on writing to the backend, move the UI to
# the record that caused the error
- self.__sync()
+ self.__sync(True)
raise
# Restore current record position
@@ -761,7 +761,7 @@
else:
index += 1
- self.__sync()
+ self.__sync(False)
# -------------------------------------------------------------------------
@@ -830,7 +830,7 @@
record = self.__create_record(initialData = row)
self.__record_count += 1
- self.__sync()
+ self.__sync(False)
# -------------------------------------------------------------------------
@@ -895,7 +895,7 @@
# and the user interface
# -------------------------------------------------------------------------
- def __sync(self):
+ def __sync(self, send_event):
old_current = self.current
if self.__current_index == -1:
@@ -914,7 +914,7 @@
self.__remove_record(index)
self.current._activate()
- if self.__eventController is not None:
+ if send_event and self.__eventController is not None:
self.__eventController.dispatchEvent('dsCursorMoved')
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r8919 - in trunk/gnue-common/src/datasources: . drivers/Base,
reinhard <=