SF.net SVN: fclient:[700] trunk/fclient/src/fclient/lib/qt4ex/ dlgpreferences.py
Status: Pre-Alpha
Brought to you by:
jurner
|
From: <jU...@us...> - 2008-07-21 10:16:28
|
Revision: 700
http://fclient.svn.sourceforge.net/fclient/?rev=700&view=rev
Author: jUrner
Date: 2008-07-21 10:15:50 +0000 (Mon, 21 Jul 2008)
Log Message:
-----------
combed over restoreState()
Modified Paths:
--------------
trunk/fclient/src/fclient/lib/qt4ex/dlgpreferences.py
Modified: trunk/fclient/src/fclient/lib/qt4ex/dlgpreferences.py
===================================================================
--- trunk/fclient/src/fclient/lib/qt4ex/dlgpreferences.py 2008-07-20 19:59:12 UTC (rev 699)
+++ trunk/fclient/src/fclient/lib/qt4ex/dlgpreferences.py 2008-07-21 10:15:50 UTC (rev 700)
@@ -658,26 +658,31 @@
def restoreState(self, state):
"""Restors the state of the dialog
- @param state: (str) state to restore
+ @param state: (str, QString) state to restore
+ @return: (bool) True if the state could be restored, False otherwise
"""
+ if isinstance(state, QtCore.QString):
+ state = str(state)
try:
state = cPickle.loads(state)
assert isinstance(state, dict)
except Exception, d:
- pass
+ print Exception, d
+ return False
else:
try:
self.restoreGeometry(state.get('geometry', None))
except Exception, d:
- pass
+ print 2
+ return False
try:
self.controlById(self.IdSplitter).restoreState(state.get('splitter', None))
except Exception, d:
- pass
+ return False
try:
self.selectPage(state.get('currentPage', None))
except Exception, d:
- pass
+ return False
try:
expandedPages = state.get('expandedPages', None)
tree = self.controlById(self.IdTreePages)
@@ -685,7 +690,9 @@
uuid = str( item.data(0, QtCore.Qt.UserRole).toString() )
if uuid in expandedPages:
item.setExpanded(True)
- except: pass
+ except Exception, d:
+ return False
+ return True
def setWindowTitle(self, title):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|