App.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /*!
  2. * Ext JS Library 4.0
  3. * Copyright(c) 2006-2011 Sencha Inc.
  4. * licensing@sencha.com
  5. * http://www.sencha.com/license
  6. */
  7. Ext.define('MyDesktop.App', {
  8. extend: 'Ext.ux.desktop.App',
  9. requires: [
  10. 'Ext.window.MessageBox',
  11. 'Ext.ux.desktop.ShortcutModel',
  12. 'MyDesktop.SystemStatus',
  13. 'MyDesktop.VideoWindow',
  14. 'MyDesktop.GridWindow',
  15. 'MyDesktop.TabWindow',
  16. 'MyDesktop.AccordionWindow',
  17. 'MyDesktop.Notepad',
  18. 'MyDesktop.BogusMenuModule',
  19. 'MyDesktop.BogusModule',
  20. // 'MyDesktop.Blockalanche',
  21. 'MyDesktop.Settings'
  22. ],
  23. init: function() {
  24. // custom logic before getXYZ methods get called...
  25. this.callParent();
  26. // now ready...
  27. },
  28. getModules : function(){
  29. return [
  30. new MyDesktop.VideoWindow(),
  31. //new MyDesktop.Blockalanche(),
  32. new MyDesktop.SystemStatus(),
  33. new MyDesktop.GridWindow(),
  34. new MyDesktop.TabWindow(),
  35. new MyDesktop.AccordionWindow(),
  36. new MyDesktop.Notepad(),
  37. new MyDesktop.BogusMenuModule(),
  38. new MyDesktop.BogusModule()
  39. ];
  40. },
  41. getDesktopConfig: function () {
  42. var me = this, ret = me.callParent();
  43. return Ext.apply(ret, {
  44. //cls: 'ux-desktop-black',
  45. contextMenuItems: [
  46. { text: 'Change Settings', handler: me.onSettings, scope: me }
  47. ],
  48. shortcuts: Ext.create('Ext.data.Store', {
  49. model: 'Ext.ux.desktop.ShortcutModel',
  50. data: [
  51. { name: 'Grid Window', iconCls: 'grid-shortcut', module: 'grid-win' },
  52. { name: 'Accordion Window', iconCls: 'accordion-shortcut', module: 'acc-win' },
  53. { name: 'Notepad', iconCls: 'notepad-shortcut', module: 'notepad' },
  54. { name: 'System Status', iconCls: 'cpu-shortcut', module: 'systemstatus'}
  55. ]
  56. }),
  57. wallpaper: 'wallpapers/Blue-Sencha.jpg',
  58. wallpaperStretch: false
  59. });
  60. },
  61. // config for the start menu
  62. getStartConfig : function() {
  63. var me = this, ret = me.callParent();
  64. return Ext.apply(ret, {
  65. title: 'Don Griffin',
  66. iconCls: 'user',
  67. height: 300,
  68. toolConfig: {
  69. width: 100,
  70. items: [
  71. {
  72. text:'Settings',
  73. iconCls:'settings',
  74. handler: me.onSettings,
  75. scope: me
  76. },
  77. '-',
  78. {
  79. text:'Logout',
  80. iconCls:'logout',
  81. handler: me.onLogout,
  82. scope: me
  83. }
  84. ]
  85. }
  86. });
  87. },
  88. getTaskbarConfig: function () {
  89. var ret = this.callParent();
  90. return Ext.apply(ret, {
  91. quickStart: [
  92. { name: 'Accordion Window', iconCls: 'accordion', module: 'acc-win' },
  93. { name: 'Grid Window', iconCls: 'icon-grid', module: 'grid-win' }
  94. ],
  95. trayItems: [
  96. { xtype: 'trayclock', flex: 1 }
  97. ]
  98. });
  99. },
  100. onLogout: function () {
  101. Ext.Msg.confirm('Logout', 'Are you sure you want to logout?');
  102. },
  103. onSettings: function () {
  104. var dlg = new MyDesktop.Settings({
  105. desktop: this.desktop
  106. });
  107. dlg.show();
  108. }
  109. });