[IMP] Renamed Notification methods 'default' -> notify , 'alert' -> warn

bzr revid: fme@openerp.com-20110411083032-zc87gltpnw2z7s0r
This commit is contained in:
Fabien Meghazi 2011-04-11 10:30:32 +02:00
parent c05b34c409
commit bc82a989f2
4 changed files with 10 additions and 15 deletions

View File

@ -245,12 +245,7 @@ openerp.base.Notification = openerp.base.BasicController.extend({
text: text
});
},
// TODO remove to avoid default as attribute
'default': function(title, text) {
this.notify(title,text);
},
// TODO change into warn to avoid alert
alert: function(title, text) {
warn: function(title, text) {
this.$element.notify('create', 'oe_notification_alert', {
title: title,
text: text
@ -907,7 +902,7 @@ openerp.base.WebClient = openerp.base.Controller.extend({
this.header.start();
this.login.start();
this.menu.start();
this.notification['default']("OpenERP Client", "The openerp client has been initialized.");
this.notification.notify("OpenERP Client", "The openerp client has been initialized.");
},
on_logged: function() {
this.action = new openerp.base.ActionManager(this.session, "oe_app");

View File

@ -100,7 +100,7 @@ openerp.base.DataSet = openerp.base.Controller.extend( /** @lends openerp.base.
}, callback);
},
unlink: function(ids) {
this.notification['default']("Unlink", ids);
this.notification.notify("Unlink", ids);
},
call: function (method, ids, args, callback) {
ids = ids || [];

View File

@ -234,24 +234,24 @@ openerp.base.FormView = openerp.base.Controller.extend( /** @lends openerp.base
}
});
msg += "</ul>";
this.notification.alert("The following fields are invalid :", msg);
this.notification.warn("The following fields are invalid :", msg);
},
on_saved: function(r) {
if (!r.result) {
this.log("Record was not saved");
} else {
// Check response for exceptions, display error
this.notification['default']("Record saved", "The record #" + this.datarecord.id + " has been saved.");
this.notification.notify("Record saved", "The record #" + this.datarecord.id + " has been saved.");
}
},
do_search: function (domains, contexts, groupbys) {
this.notification['default']("Searching form");
this.notification.notify("Searching form");
},
on_action: function (action) {
this.notification['default']('Executing action ' + action);
this.notification.notify('Executing action ' + action);
},
do_cancel: function () {
this.notification['default']("Cancelling form");
this.notification.notify("Cancelling form");
}
});
@ -720,7 +720,7 @@ openerp.base.form.FieldOne2ManyDatasSet = openerp.base.DataSetStatic.extend({
this._super(id, data, callback);
},
unlink: function() {
this.notification['default']('Unlinking o2m ' + this.ids);
this.notification.notify('Unlinking o2m ' + this.ids);
}
});

View File

@ -215,7 +215,7 @@ openerp.base.SearchView = openerp.base.Controller.extend({
* @param {Array} errors a never-empty array of error objects
*/
on_invalid: function (errors) {
this.notification['default']("Invalid Search", "triggered from search view");
this.notification.notify("Invalid Search", "triggered from search view");
},
do_clear: function (e) {
if (e && e.preventDefault) { e.preventDefault(); }