Mercurial > libervia-backend
diff frontends/src/primitivus/primitivus @ 812:084b52afdceb
frontends: fixed /me usage + renamed a couple of "type" parameters to type_
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 04 Feb 2014 18:51:16 +0100 |
parents | 1fe00f0c9a91 |
children | 30fd34309949 |
line wrap: on
line diff
--- a/frontends/src/primitivus/primitivus Tue Feb 04 18:32:49 2014 +0100 +++ b/frontends/src/primitivus/primitivus Tue Feb 04 18:51:16 2014 +0100 @@ -406,18 +406,18 @@ answer_cb(False, *answer_data) - def showDialog(self, message, title="", type="info", answer_cb = None, answer_data = None): - if type == 'info': + def showDialog(self, message, title="", type_="info", answer_cb = None, answer_data = None): + if type_ == 'info': popup = sat_widgets.Alert(unicode(title), unicode(message), ok_cb=answer_cb or self.removePopUp) #FIXME: remove unicode here when DBus Bridge will no return dbus.String anymore - elif type == 'error': + elif type_ == 'error': popup = sat_widgets.Alert(unicode(title), unicode(message), ok_cb=answer_cb or self.removePopUp) #FIXME: remove unicode here when DBus Bridge will no return dbus.String anymore - elif type == 'yes/no': + elif type_ == 'yes/no': popup = sat_widgets.ConfirmDialog(unicode(message), yes_cb=self._dialogOkCb, yes_value = (answer_cb, answer_data), no_cb=self._dialogCancelCb, no_value = (answer_cb, answer_data)) else: popup = sat_widgets.Alert(unicode(title), unicode(message), ok_cb=answer_cb or self.removePopUp) #FIXME: remove unicode here when DBus Bridge will no return dbus.String anymore - error(_('unmanaged dialog type: %s'), type) + error(_('unmanaged dialog type: %s'), type_) self.showPopUp(popup) def onNotification(self, notBar): @@ -493,7 +493,7 @@ pop_up_widget = sat_widgets.ConfirmDialog(data["message"], no_cb=refuse_cb, yes_cb=accept_cb) self.showPopUp(pop_up_widget) - def actionResult(self, type, id, data, profile): + def actionResult(self, type_, id, data, profile): # FIXME: to be removed if not self.check_profile(profile): return @@ -501,9 +501,9 @@ if not id in self.current_action_ids: debug (_('unknown id, ignoring')) return - if type == "SUPPRESS": + if type_ == "SUPPRESS": self.current_action_ids.remove(id) - elif type == "XMLUI": + elif type_ == "XMLUI": self.current_action_ids.remove(id) debug (_("XML user interface received")) misc = {} @@ -518,23 +518,23 @@ ui.show('popup') else: ui.show('window') - elif type == "ERROR": + elif type_ == "ERROR": self.current_action_ids.remove(id) self.showPopUp(sat_widgets.Alert(_("Error"), unicode(data["message"]), ok_cb=self.removePopUp)) #FIXME: remove unicode here when DBus Bridge will no return dbus.String anymore - elif type == "RESULT": + elif type_ == "RESULT": self.current_action_ids.remove(id) if self.current_action_ids_cb.has_key(id): callback = self.current_action_ids_cb[id] del self.current_action_ids_cb[id] callback(data) - elif type == "DICT_DICT": + elif type_ == "DICT_DICT": self.current_action_ids.remove(id) if self.current_action_ids_cb.has_key(id): callback = self.current_action_ids_cb[id] del self.current_action_ids_cb[id] callback(data) else: - error (_("FIXME FIXME FIXME: type [%s] not implemented") % type) + error (_("FIXME FIXME FIXME: type [%s] not implemented") % type_) raise NotImplementedError ##DIALOGS CALLBACKS##