3 * Copyright(c) 2006-2010 Sencha Inc.
5 * http://www.sencha.com/license
7 Ext.app.App = function(cfg){
14 Ext.onReady(this.initApp, this);
17 Ext.extend(Ext.app.App, Ext.util.Observable, {
22 getStartConfig : function(){
27 this.startConfig = this.startConfig || this.getStartConfig();
29 this.desktop = new Ext.Desktop(this);
31 this.launcher = this.desktop.taskbar.startMenu;
33 this.modules = this.getModules();
35 this.initModules(this.modules);
40 Ext.EventManager.on(window, 'beforeunload', this.onUnload, this);
41 this.fireEvent('ready', this);
45 getModules : Ext.emptyFn,
48 initModules : function(ms){
49 for(var i = 0, len = ms.length; i < len; i++){
51 this.launcher.add(m.launcher);
56 getModule : function(name){
57 var ms = this.modules;
58 for(var i = 0, len = ms.length; i < len; i++){
59 if(ms[i].id == name || ms[i].appType == name){
66 onReady : function(fn, scope){
68 this.on('ready', fn, scope);
74 getDesktop : function(){
78 onUnload : function(e){
79 if(this.fireEvent('beforeunload', this) === false){