Ext.define('Ext.ux.importManager.Window', {
	extend: 'Ext.window.Window',
	alias: ['widget.importManagerWindow'],
	requires: [
	'Ext.ux.importManager.Panel'
	],    
	layout: 'fit',
	modal: true,
	autoScroll: true,
	height: 410,
	width: 680,
	initComponent: function() {
		var me = this;

		me.title = me.mainOwner.getI18N('doImport') + ': ' + me.record.data.title;

		me.panel = Ext.create('Ext.ux.importManager.Panel', {
			mainOwner: me.mainOwner,
			record: me.record
		});

		me.items = me.panel;

		me.buttons = [{
			text: me.mainOwner.getI18N('doImport'),
			handler: function() {
				me.panel.confirmImport({
					success: function(data) {
						if (Ext.isFunction(me.success)) {
							me.success.call(me, data);
						}
						me.close();
					}
				});
			}
		},{
			text: me.mainOwner.getI18N('close'),
			handler: function() {
				me.close();
			}
		}];           

		me.callParent();
	}
});
