comparison frontends/src/primitivus/profile_manager.py @ 751:1def5b7edf9f

core, bridge: better GenericException handling
author Goffi <goffi@goffi.org>
date Tue, 17 Dec 2013 00:56:39 +0100
parents 49587e170f53
children bfabeedbf32e
comparison
equal deleted inserted replaced
750:c8b9f675ac17 751:1def5b7edf9f
75 self.host.removePopUp() 75 self.host.removePopUp()
76 self.host.redraw() 76 self.host.redraw()
77 77
78 def _profileCreationFailure(self, reason): 78 def _profileCreationFailure(self, reason):
79 self.host.removePopUp() 79 self.host.removePopUp()
80 if reason=="CONFLICT": 80 if reason=="ConflictError":
81 message=_("A profile with this name already exists") 81 message=_("A profile with this name already exists")
82 elif reason=="CANCELED": 82 elif reason=="CancelError":
83 message=_("Profile creation cancelled by backend") 83 message=_("Profile creation cancelled by backend")
84 elif reason=="DATABASE": 84 elif reason=="DATABASE": # FIXME: doesn't seem to exist !
85 message=_("Database error") 85 message=_("Database error")
86 else: 86 else:
87 message=_("Unknown reason (%s)") % reason 87 message=_("Unknown reason (%s)") % reason
88 popup = Alert(_("Can't create profile"), message, ok_cb=self.host.removePopUp) 88 popup = Alert(_("Can't create profile"), message, ok_cb=self.host.removePopUp)
89 self.host.showPopUp(popup) 89 self.host.showPopUp(popup)