Better preference window behavior

Don't crash if session is timeout
This commit is contained in:
Cédric Krier committed 2008-03-05 15:40:18 +01:00
1 parent 91a0a2d3a0
commit 033148443e
2 files changed
+7 -2

No files matched your search

+3 -1
View File
@@ -20,7 +20,7 @@ class Preference(object):
gtk.STOCK_OK, gtk.RESPONSE_OK))
self.win.set_default_response(gtk.RESPONSE_OK)
self.win.vbox.pack_start(gtk.Label(_('Edit ressource preferences')),
self.win.vbox.pack_start(gtk.Label(_('Edit User Preferences')),
expand=False, fill=True)
self.win.vbox.pack_start(gtk.HSeparator())
self.win.set_icon(TRYTON_ICON)
@@ -34,6 +34,7 @@ class Preference(object):
res = user.get_preferences_fields_view(rpc.CONTEXT)
except Exception, exception:
rpc.process_exception(exception, parent)
self.win.destroy()
raise
arch = res['arch']
fields = res['fields']
@@ -45,6 +46,7 @@ class Preference(object):
preferences = user.get_preferences(False, rpc.CONTEXT)
except Exception, exception:
rpc.process_exception(exception, parent)
self.win.destroy()
raise
self.screen.current_model.set(preferences)
+4 -1
View File
@@ -89,7 +89,10 @@ def context_reload():
CONTEXT = {}
user = RPCProxy('res.user')
lang = RPCProxy('ir.lang')
context = user.get_preferences(True, {})
try:
context = user.get_preferences(True, {})
except:
return
for i in context:
value = context[i]
if value: