112 |
'commit':{'function':self.commit}, |
'commit':{'function':self.commit}, |
113 |
'postChanges':{'function':self.postChanges}, |
'postChanges':{'function':self.postChanges}, |
114 |
'reset':{'function':self.reset}, |
'reset':{'function':self.reset}, |
115 |
'clear':{'function':self.clear}, |
'clear':{'function':self.clear}, |
116 |
'commitConnection':{'function':self.commitConnection}, |
'commitConnection':{'function':self.commitConnection}, |
117 |
'rollbackConnection':{'function':self.rollbackConnection}, |
'rollbackConnection':{'function':self.rollbackConnection}, |
118 |
'setParameter':{'function':self.setParameter}, |
'setParameter':{'function':self.setParameter}, |
119 |
'getParameter':{'function':self.getParameter, |
'getParameter':{'function':self.getParameter, |
120 |
'global': 1, |
'global': 1, |
121 |
}, |
}, |
206 |
self._currentPage = object |
self._currentPage = object |
207 |
|
|
208 |
elif object._type in TabStops and self._currentEntry == None and \ |
elif object._type in TabStops and self._currentEntry == None and \ |
209 |
not object.hidden and not object.readonly: |
not object.hidden: |
210 |
self._currentEntry = object |
self._currentEntry = object |
211 |
|
|
212 |
def getParameter(self, parameter): |
def getParameter(self, parameter): |
238 |
entry = None |
entry = None |
239 |
|
|
240 |
if isinstance(object, GFObj): |
if isinstance(object, GFObj): |
241 |
if (object._type in TabStops and |
if (object._type in TabStops and (not object.hidden)): |
|
(not object.hidden) and ((not object.readonly) or |
|
|
(self._currentBlock.mode=='query' and object._queryable))): |
|
242 |
return object |
return object |
243 |
else: |
else: |
244 |
for child in object._children: |
for child in object._children: |
335 |
if pageChange: |
if pageChange: |
336 |
self._currentPage.processTrigger('Post-FocusIn') |
self._currentPage.processTrigger('Post-FocusIn') |
337 |
|
|
338 |
|
event = GFEvent('beginEDITMODE', None) |
339 |
|
self.dispatchEvent(event) |
340 |
|
if event.__error__: |
341 |
|
return 1 |
342 |
except TriggerError, t: |
except TriggerError, t: |
343 |
GDebug.printMesg(1, "Trigger Error!") |
GDebug.printMesg(1, "Trigger Error!") |
344 |
message = _("Trigger Exception :\n") + t.msg |
message = _("Trigger Exception :\n") + t.msg |
484 |
|
|
485 |
def rollbackConnection(self): |
def rollbackConnection(self): |
486 |
self._currentBlock._dataSourceLink._dataObject.rollback() |
self._currentBlock._dataSourceLink._dataObject.rollback() |
487 |
|
|
488 |
def commit(self, onlyThisBlock=None): |
def commit(self, onlyThisBlock=None): |
489 |
self._app.dispatchEvent(GFEvent('beginWAIT',None)); |
self._app.dispatchEvent(GFEvent('beginWAIT',None)); |
490 |
|
|
505 |
blockList.append(onlyThisBlock) |
blockList.append(onlyThisBlock) |
506 |
else: |
else: |
507 |
blockList = self._blockList |
blockList = self._blockList |
508 |
|
|
509 |
for block in blockList: |
for block in blockList: |
510 |
GDebug.printMesg(1, "Saving %s"%block.name) |
GDebug.printMesg(1, "Saving %s"%block.name) |
511 |
try: |
try: |
568 |
blockList.append(onlyThisBlock) |
blockList.append(onlyThisBlock) |
569 |
else: |
else: |
570 |
blockList = self._blockList |
blockList = self._blockList |
571 |
|
|
572 |
for block in blockList: |
for block in blockList: |
573 |
GDebug.printMesg(1, "Saving %s"%block.name) |
GDebug.printMesg(1, "Saving %s"%block.name) |
574 |
try: |
try: |
629 |
|
|
630 |
def clear(self): |
def clear(self): |
631 |
self.rollback() |
self.rollback() |
632 |
|
|
633 |
def rollback(self, recover=0): |
def rollback(self, recover=0): |
634 |
#commited = 0 |
#commited = 0 |
635 |
self.endEditing() |
self.endEditing() |
698 |
keepNext = 0 |
keepNext = 0 |
699 |
|
|
700 |
entryList= self._getFocusableEntries (self._currentPage._children) |
entryList= self._getFocusableEntries (self._currentPage._children) |
701 |
|
# print entryList |
702 |
|
# print TabStops |
703 |
for object in entryList: |
for object in entryList: |
704 |
# Put the first field as the next to rollover |
# Put the first field as the next to rollover |
705 |
if (object._type in TabStops and |
if ( |
706 |
(not object.hidden) and ((not object.readonly) or |
object._type in TabStops and |
707 |
(self._currentBlock.mode=='query' and object._queryable))): |
(not object.hidden) |
708 |
|
): |
709 |
if nextEntry == None: |
if nextEntry == None: |
710 |
nextEntry = object |
nextEntry = object |
711 |
firstEntry = object |
firstEntry = object |
718 |
nextEntry = object |
nextEntry = object |
719 |
break |
break |
720 |
|
|
721 |
if nextEntry == firstEntry and self._currentBlock.transparentBlock: |
self.changeFocus(nextEntry) |
|
# Jump to the next block if block is tagged as transparent |
|
|
self.nextBlock() |
|
|
else: |
|
|
self.changeFocus(nextEntry) |
|
722 |
|
|
723 |
|
|
724 |
# |
# |
734 |
|
|
735 |
entryList= self._getFocusableEntries (self._currentPage._children) |
entryList= self._getFocusableEntries (self._currentPage._children) |
736 |
for object in entryList: |
for object in entryList: |
737 |
if (object._type in TabStops and |
if (object._type in TabStops and (not object.hidden)): |
|
(not object.hidden) and ((not object.readonly) or |
|
|
(self._currentBlock.mode=='query' and object._queryable))): |
|
738 |
nextEntry = object |
nextEntry = object |
739 |
lastEntry = object |
lastEntry = object |
740 |
|
|
741 |
keepNext = 0 |
keepNext = 0 |
742 |
for object in entryList: |
for object in entryList: |
743 |
# Put the first field as the next to rollover |
# Put the first field as the next to rollover |
744 |
if (object._type in TabStops and |
if (object._type in TabStops and (not object.hidden)): |
|
(not object.hidden) and ((not object.readonly) or |
|
|
(self._currentBlock.mode=='query' and object._queryable))): |
|
745 |
if object == self._currentEntry: |
if object == self._currentEntry: |
746 |
break |
break |
747 |
|
|
751 |
prevBlock = self.findPreviousBlock() |
prevBlock = self.findPreviousBlock() |
752 |
# Move to the new last record of the new current block |
# Move to the new last record of the new current block |
753 |
for object in prevBlock._children: |
for object in prevBlock._children: |
754 |
if object._type in TabStops and \ |
if object._type in TabStops and not object.hidden: |
|
not object.hidden and (not object.readonly or self._currentBlock.mode=='query'): |
|
755 |
nextEntry = object |
nextEntry = object |
756 |
|
|
757 |
self.findAndChangeFocus(nextEntry) |
self.findAndChangeFocus(nextEntry) |