Ext.define("Portfolio.settings.language.controller.Main", {
	extend: "Ext.app.ViewController",

	alias: "controller.portfolio-settings-language-main",

	onAfterRender: function() {

		var i_controller = this;
		var i_view = i_controller.getView();

		var i_grid = i_view.getGrid();

		i_grid.events.itemdblclick.clearListeners();

		var i_actionBar = i_grid.getEntityToolBar();
		var i_filterBar = i_grid.getFilterBar();

		var i_rowMenu = i_grid.getRowMenu();

		var a_items = i_rowMenu.items.getRange();

		Ext.Array.each(a_items, function(i_item) {
			if (i_item.itemId != "itmDelete") {
				i_item.setHidden(true);
			}
		});

		if (i_actionBar) {
			i_actionBar.hide();
		}

		if (i_filterBar) {
			i_filterBar.hide();
		}
	},

	onAdd: function() {

		var i_controller = this;

		var i_window = Ext.widget("portfolio-settings-language-window", {
			width: 400,
			height: 150,
			modal: true
		});

		i_window.show();
	}
});
