quick_frontend(profile manager): fixed alert messages

This commit is contained in:
Goffi 2015-11-17 12:39:38 +01:00
commit 706b814e3f

View file

@ -114,13 +114,13 @@ class QuickProfileManager(object):
self._autoconnect = False # manual mode
msg = _("Trying to plug an unknown profile key ({})".format(profile_key))
log.warning(msg)
self.alert(_("Profile plugging in error"), msg)
self.showDialog(_("Profile plugging in error"), msg, 'error')
break
self.host.launchAction(C.AUTHENTICATE_PROFILE_ID, callback=authenticate_cb, profile=profile)
def getParamError(self, dummy):
self.alert(_(u"Error"), _("Can't get profile parameter"))
self.host.showDialog(_(u"Error"), _("Can't get profile parameter"), 'error')
## Helping methods ##
@ -153,12 +153,12 @@ class QuickProfileManager(object):
def _onConnectProfiles(self):
"""Connect the profiles and start the main widget"""
if self._autoconnect:
self.alert(_('Internal error'), _("You can't connect manually and automatically at the same time"))
self.host.showDialog(_('Internal error'), _("You can't connect manually and automatically at the same time"), 'error')
return
self.updateConnectionParams()
profiles = self.getProfiles()
if not profiles:
self.alert(_('No profile selected'), _('You need to create and select at least one profile before connecting'))
self.host.showDialog(_('No profile selected'), _('You need to create and select at least one profile before connecting'), 'error')
else:
# All profiles in the list are already validated, so we can plug them directly
self.host.plug_profiles(profiles)
@ -249,12 +249,4 @@ class QuickProfileManager(object):
# dialogs
def alert(self, title, message):
"""Show an alert message, must be implemented by frontends
@param title: title of the dialog/popup
@param message: error message
"""
raise NotImplementedError
# Note: a method which check profiles change must be implemented too