[imp] renammed stop()

bzr revid: nicolas.vanhoren@openerp.com-20120221162912-zheko30qoh84hcoq
This commit is contained in:
niv-openerp 2012-02-21 17:29:12 +01:00
parent 4ee34acbbe
commit 75d39c7f6a
12 changed files with 54 additions and 54 deletions

View File

@ -148,7 +148,7 @@ openerp.web.Dialog = openerp.web.OldWidget.extend(/** @lends openerp.web.Dialog#
on_resized: function() {
//openerp.log("Dialog resized to %d x %d", this.$element.width(), this.$element.height());
},
stop: function () {
destroy: function () {
// Destroy widget
this.close();
this.$element.dialog('destroy');
@ -240,7 +240,7 @@ openerp.web.Loading = openerp.web.OldWidget.extend(/** @lends openerp.web.Loadin
this.session.on_rpc_request.add_first(this.request_call);
this.session.on_rpc_response.add_last(this.response_call);
},
stop: function() {
destroy: function() {
this.session.on_rpc_request.remove(this.request_call);
this.session.on_rpc_response.remove(this.response_call);
this.on_rpc_event(-this.count);
@ -318,7 +318,7 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab
self.hide();
});
},
stop: function () {
destroy: function () {
this.hide();
this.$option_id.empty();
@ -383,7 +383,7 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab
setTimeout(function () {
self.getParent().do_login(
info.db, admin.login, admin.password);
self.stop();
self.destroy();
self.unblockUI();
});
});
@ -799,7 +799,7 @@ openerp.web.Header = openerp.web.OldWidget.extend(/** @lends openerp.web.Header
var inner_viewmanager = action_manager.inner_viewmanager;
inner_viewmanager.views[inner_viewmanager.active_view].controller.do_save()
.then(function() {
self.dialog.stop();
self.dialog.destroy();
// needs to refresh interface in case language changed
window.location.reload();
});
@ -1101,7 +1101,7 @@ openerp.web.WebClient = openerp.web.OldWidget.extend(/** @lends openerp.web.WebC
self.header.do_update();
self.menu.do_reload();
if(self.action_manager)
self.action_manager.stop();
self.action_manager.destroy();
self.action_manager = new openerp.web.ActionManager(self);
self.action_manager.appendTo($("#oe_app"));
self.bind_hashchange();
@ -1153,7 +1153,7 @@ openerp.web.WebClient = openerp.web.OldWidget.extend(/** @lends openerp.web.WebC
},
destroy_content: function() {
_.each(_.clone(this.getChildren()), function(el) {
el.stop();
el.destroy();
});
this.$element.children().remove();
},

View File

@ -969,7 +969,7 @@ openerp.web.Connection = openerp.web.CallbackEnabled.extend( /** @lends openerp.
*
* And of course, when you don't need that widget anymore, just do:
*
* my_widget.stop();
* my_widget.destroy();
*
* That will kill the widget in a clean way and erase its content from the dom.
*/
@ -994,7 +994,7 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W
* @extends openerp.web.CallbackEnabled
*
* @param {openerp.web.Widget} parent Binds the current instance to the given Widget instance.
* When that widget is destroyed by calling stop(), the current instance will be
* When that widget is destroyed by calling destroy(), the current instance will be
* destroyed too. Can be null.
* @param {String} element_id Deprecated. Sets the element_id. Only useful when you want
* to bind the current Widget to an already existing part of the DOM, which is not compatible
@ -1035,9 +1035,9 @@ openerp.web.Widget = openerp.web.CallbackEnabled.extend(/** @lends openerp.web.W
/**
* Destroys the current widget, also destroys all its children before destroying itself.
*/
stop: function() {
destroy: function() {
_.each(_.clone(this.getChildren()), function(el) {
el.stop();
el.destroy();
});
if(this.$element != null) {
this.$element.remove();

View File

@ -66,11 +66,11 @@ openerp.web.DataImport = openerp.web.Dialog.extend({
this._super();
this.open({
buttons: [
{text: _t("Close"), click: function() { self.stop(); }},
{text: _t("Close"), click: function() { self.destroy(); }},
{text: _t("Import File"), click: function() { self.do_import(); }, 'class': 'oe-dialog-import-button'}
],
close: function(event, ui) {
self.stop();
self.destroy();
}
});
this.toggle_import_button(false);
@ -204,7 +204,7 @@ openerp.web.DataImport = openerp.web.Dialog.extend({
if (this.getParent().getParent().active_view == "list") {
this.getParent().reload_content();
}
this.stop();
this.destroy();
return;
}
@ -358,7 +358,7 @@ openerp.web.DataImport = openerp.web.Dialog.extend({
}
return true;
},
stop: function() {
destroy: function() {
this.$element.remove();
this._super();
}

View File

@ -552,7 +552,7 @@ openerp.web.search.Widget = openerp.web.OldWidget.extend( /** @lends openerp.web
* "Stops" the widgets. Called when the view destroys itself, this
* lets the widgets clean up after themselves.
*/
stop: function () {
destroy: function () {
delete this.view;
this._super();
},
@ -1159,7 +1159,7 @@ openerp.web.search.ExtendedSearchGroup = openerp.web.OldWidget.extend({
_this.add_prop();
});
this.$element.find('.searchview_extended_delete_group').click(function () {
_this.stop();
_this.destroy();
});
},
get_domain: function() {
@ -1172,7 +1172,7 @@ openerp.web.search.ExtendedSearchGroup = openerp.web.OldWidget.extend({
_.map(_.range(_.max([0,props.length - 1])), function() { return op; }),
props);
},
stop: function() {
destroy: function() {
var parent = this.getParent();
if (this.getParent().getChildren().length == 1)
this.getParent().hide();
@ -1210,16 +1210,16 @@ openerp.web.search.ExtendedSearchProposition = openerp.web.OldWidget.extend(/**
_this.changed();
});
this.$element.find('.searchview_extended_delete_prop').click(function () {
_this.stop();
_this.destroy();
});
},
stop: function() {
destroy: function() {
var parent;
if (this.getParent().getChildren().length == 1)
parent = this.getParent();
this._super();
if (parent)
parent.stop();
parent.destroy();
},
changed: function() {
var nval = this.$element.find(".searchview_extended_prop_field").val();
@ -1235,7 +1235,7 @@ openerp.web.search.ExtendedSearchProposition = openerp.web.OldWidget.extend(/**
select_field: function(field) {
var self = this;
if(this.attrs.selected != null) {
this.value.stop();
this.value.destroy();
this.value = null;
this.$element.find('.searchview_extended_prop_op').html('');
}

View File

@ -1002,10 +1002,10 @@ openerp.web.ViewEditor = openerp.web.OldWidget.extend({
$.when(action_manager.do_action(action)).then(function() {
var controller = action_manager.dialog_viewmanager.views['form'].controller;
controller.on_button_cancel.add_last(function(){
action_manager.stop()
action_manager.destroy()
});
controller.do_save.add_last(function(){
action_manager.stop();
action_manager.destroy();
var value =controller.fields.name.value;
self.add_node_dialog.$element.find('select[id=field_value]').append($("<option selected></option>").attr("value",value).text(value));
_.detect(self.add_widget,function(widget){

View File

@ -74,13 +74,13 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView#
}, this.on_loaded);
}
},
stop: function() {
destroy: function() {
if (this.sidebar) {
this.sidebar.attachments.stop();
this.sidebar.stop();
this.sidebar.attachments.destroy();
this.sidebar.destroy();
}
_.each(this.widgets, function(w) {
w.stop();
w.destroy();
});
this._super();
},
@ -923,7 +923,7 @@ openerp.web.form.Widget = openerp.web.OldWidget.extend(/** @lends openerp.web.fo
this.width = this.node.attrs.width;
},
stop: function() {
destroy: function() {
this._super.apply(this, arguments);
$.fn.tipsy.clear();
},
@ -2554,7 +2554,7 @@ openerp.web.form.FieldOne2Many = openerp.web.form.Field.extend({
this.previous_readonly = this.readonly;
if (this.viewmanager) {
this.is_loaded = this.is_loaded.pipe(function() {
self.viewmanager.stop();
self.viewmanager.destroy();
return $.when(self.load_views()).then(function() {
self.reload_current_view();
});
@ -2734,7 +2734,7 @@ openerp.web.form.FieldMany2Many = openerp.web.form.Field.extend({
this.previous_readonly = this.readonly;
if (this.list_view) {
this.is_loaded = this.is_loaded.pipe(function() {
self.list_view.stop();
self.list_view.destroy();
return $.when(self.load_view()).then(function() {
self.reload_content();
});
@ -2866,7 +2866,7 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope
setup_search_view: function(search_defaults) {
var self = this;
if (this.searchview) {
this.searchview.stop();
this.searchview.destroy();
}
this.searchview = new openerp.web.SearchView(this,
this.dataset, false, search_defaults);
@ -2896,7 +2896,7 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope
$buttons.prepend(QWeb.render("SelectCreatePopup.search.buttons"));
var $cbutton = $buttons.find(".oe_selectcreatepopup-search-close");
$cbutton.click(function() {
self.stop();
self.destroy();
});
var $sbutton = $buttons.find(".oe_selectcreatepopup-search-select");
if(self.options.disable_multiple_selection) {
@ -2904,7 +2904,7 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope
}
$sbutton.click(function() {
self.on_select_elements(self.selected_ids);
self.stop();
self.destroy();
});
});
});
@ -2988,7 +2988,7 @@ openerp.web.form.SelectCreatePopup = openerp.web.OldWidget.extend(/** @lends ope
if (this.created_elements.length > 0) {
this.on_select_elements(this.created_elements);
}
this.stop();
this.destroy();
},
on_default_get: function(res) {}
});
@ -2999,7 +2999,7 @@ openerp.web.form.SelectCreateListView = openerp.web.ListView.extend({
},
select_record: function(index) {
this.popup.on_select_elements([this.dataset.ids[index]]);
this.popup.stop();
this.popup.destroy();
},
do_select: function(ids, records) {
this._super(ids, records);
@ -3075,12 +3075,12 @@ openerp.web.form.FormOpenPopup = openerp.web.OldWidget.extend(/** @lends openerp
var $nbutton = $buttons.find(".oe_formopenpopup-form-save");
$nbutton.click(function() {
self.view_form.do_save().then(function() {
self.stop();
self.destroy();
});
});
var $cbutton = $buttons.find(".oe_formopenpopup-form-close");
$cbutton.click(function() {
self.stop();
self.destroy();
});
if (self.options.readonly) {
$nbutton.hide();

View File

@ -139,7 +139,7 @@ openerp.web.list_editable = function (openerp) {
}
cancelled.then(function () {
self.view.unpad_columns();
self.edition_form.stop();
self.edition_form.destroy();
self.edition_form.$element.remove();
delete self.edition_form;
delete self.edition_id;

View File

@ -30,19 +30,19 @@ session.web.ActionManager = session.web.OldWidget.extend({
},
dialog_stop: function () {
if (this.dialog) {
this.dialog_viewmanager.stop();
this.dialog_viewmanager.destroy();
this.dialog_viewmanager = null;
this.dialog.stop();
this.dialog.destroy();
this.dialog = null;
}
},
content_stop: function () {
if (this.inner_viewmanager) {
this.inner_viewmanager.stop();
this.inner_viewmanager.destroy();
this.inner_viewmanager = null;
}
if (this.client_widget) {
this.client_widget.stop();
this.client_widget.destroy();
this.client_widget = null;
}
},
@ -142,7 +142,7 @@ session.web.ActionManager = session.web.OldWidget.extend({
if(on_close)
this.dialog.on_close.add(on_close);
} else {
this.dialog_viewmanager.stop();
this.dialog_viewmanager.destroy();
}
this.dialog.dialog_title = action.name;
this.dialog_viewmanager = new session.web.ViewManagerAction(this, action);
@ -385,7 +385,7 @@ session.web.ViewManager = session.web.OldWidget.extend(/** @lends session.web.V
setup_search_view: function(view_id, search_defaults) {
var self = this;
if (this.searchview) {
this.searchview.stop();
this.searchview.destroy();
}
this.searchview = new session.web.SearchView(
this, this.dataset,

View File

@ -42,7 +42,7 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({
this._super();
return this.rpc("/web/view/load", {"model": this.model, "view_id": this.view_id, "view_type":"calendar", 'toolbar': true}, this.on_loaded);
},
stop: function() {
destroy: function() {
scheduler.clearAll();
this._super();
},

View File

@ -240,7 +240,7 @@ openerp.web.form.DashBoard = openerp.web.form.Widget.extend({
do_reload: function() {
var view_manager = this.view.getParent(),
action_manager = view_manager.getParent();
this.view.stop();
this.view.destroy();
action_manager.do_action(view_manager.action);
}
});
@ -463,8 +463,8 @@ openerp.web_dashboard.ApplicationInstaller = openerp.web.OldWidget.extend({
});
return r;
},
stop: function() {
this.action_manager.stop();
destroy: function() {
this.action_manager.destroy();
return this._super();
}
});

View File

@ -33,7 +33,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
this.renderer = null;
},
stop: function () {
destroy: function () {
if (this.renderer) {
clearTimeout(this.renderer);
}

View File

@ -176,7 +176,7 @@ openerp.web_kanban.KanbanView = openerp.web.View.extend({
},
do_clear_groups: function() {
_.each(this.groups, function(group) {
group.stop();
group.destroy();
});
this.groups = [];
this.$element.find('.oe_kanban_groups_headers, .oe_kanban_groups_records').empty();
@ -327,7 +327,7 @@ openerp.web_kanban.KanbanGroup = openerp.web.OldWidget.extend({
this.$has_been_started.resolve();
return def;
},
stop: function() {
destroy: function() {
this._super();
if (this.$records) {
this.$records.remove();
@ -469,7 +469,7 @@ openerp.web_kanban.KanbanRecord = openerp.web.OldWidget.extend({
if (confirm(_t("Are you sure you want to delete this record ?"))) {
return $.when(this.view.dataset.unlink([this.id])).then(function() {
self.group.remove_record(self.id);
self.stop();
self.destroy();
});
}
},
@ -520,7 +520,7 @@ openerp.web_kanban.KanbanRecord = openerp.web.OldWidget.extend({
self.set_record(records[0]);
self.do_render();
} else {
self.stop();
self.destroy();
}
});
},