commit eaca1b3b631fe4e25b015dcc0ff494a035fc9e00
parent 1517bc4add34de2ebddf8ada3a6aca7527acd421
Author: Felicitus <felicitus@felicitus.org>
Date: Sun, 25 Dec 2011 06:17:20 +0100
Moved some menu items to another menu
Diffstat:
1 file changed, 31 insertions(+), 12 deletions(-)
diff --git a/src/frontend/js/Components/MenuBar.js b/src/frontend/js/Components/MenuBar.js
@@ -5,7 +5,7 @@ Ext.define('PartKeepr.MenuBar', {
// @todo this is an ugly list of configurations. Refactor this in a cleaner way.
- this.menu = Ext.create('Ext.menu.Menu', {
+ this.editMenu = Ext.create('Ext.menu.Menu', {
items: [{
text: i18n('Projects'),
icon: 'resources/fugue-icons/icons/drill.png',
@@ -37,6 +37,14 @@ Ext.define('PartKeepr.MenuBar', {
handler: this.editPartUnits,
icon: "resources/fugue-icons/icons/ruler.png"
},{
+ text: i18n("Units"),
+ handler: this.editUnits,
+ icon: 'resources/icons/unit.png'
+ }]
+ });
+
+ this.viewMenu = Ext.create('Ext.menu.Menu', {
+ items: [{
text: i18n("Statistics"),
icon: 'resources/silkicons/chart_bar.png',
menu: [
@@ -49,15 +57,13 @@ Ext.define('PartKeepr.MenuBar', {
handler: this.showStatisticsChart,
icon: 'resources/silkicons/chart_bar.png'
}]
- },{
- text: i18n("Units"),
- handler: this.editUnits,
- icon: 'resources/icons/unit.png'
- },{
- text: i18n("System Information"),
- handler: this.showSystemInformation,
- icon: 'resources/fugue-icons/icons/system-monitor.png'
- }]
+ },
+ {
+ text: i18n("System Information"),
+ handler: this.showSystemInformation,
+ icon: 'resources/fugue-icons/icons/system-monitor.png'
+ }
+ ]
});
this.systemMenu = Ext.create('Ext.menu.Menu', {
@@ -78,8 +84,11 @@ Ext.define('PartKeepr.MenuBar', {
text: i18n("System"),
menu: this.systemMenu
},{
- text: i18n('Menu'),
- menu: this.menu
+ text: i18n('Edit'),
+ menu: this.editMenu
+ },{
+ text: i18n('View'),
+ menu: this.viewMenu
},
'->',
{
@@ -219,6 +228,16 @@ Ext.define('PartKeepr.MenuBar', {
PartKeepr.getApplication().addItem(j);
j.show();
+ },
+ displayComponent: function (component) {
+ var j = Ext.create(component.type, {
+ title: component.title,
+ iconCls: component.iconCls,
+ closable: component.closable
+ });
+
+ PartKeepr.getApplication().addItem(j);
+ j.show();
}
});
\ No newline at end of file