update main menu

This commit is contained in:
rlx 2016-01-13 12:14:00 +05:30
parent 09a3dda9b7
commit b90111570c

View file

@ -5,7 +5,6 @@ oml.ui.mainMenu = function() {
var ui = oml.user.ui, var ui = oml.user.ui,
findState = oml.getFindState(ui.find), findState = oml.getFindState(ui.find),
fromMenu = false, fromMenu = false,
appItems = Ox.getObjectById(oml.config.pages, 'app').parts,
that = Ox.MainMenu({ that = Ox.MainMenu({
extras: [ extras: [
@ -19,15 +18,31 @@ oml.ui.mainMenu = function() {
id: 'appMenu', id: 'appMenu',
title: '<img src="/static/png/oml.png" style="width: 14px; height: 14px">', title: '<img src="/static/png/oml.png" style="width: 14px; height: 14px">',
items: [ items: [
appItems.slice(0, 1), {
{} id: 'about',
].concat( title: Ox._('About Open Media Library')
appItems.slice(1) },
).concat([ {},
{
id: 'faq',
title: Ox._('Frequently Asked Questions')
},
{
id: 'terms',
title: Ox._('Terms and Conditions')
},
{
id: 'development',
title: Ox._('Software Development')
},
{
id: 'contact',
title: Ox._('Send Feedback')
},
{}, {},
{ {
id: 'update', id: 'update',
title: 'Software Update...' title: Ox._('Software Update...')
}, },
{}, {},
{ {
@ -35,7 +50,7 @@ oml.ui.mainMenu = function() {
title: Ox._('Quit Open Media Library'), title: Ox._('Quit Open Media Library'),
keyboard: 'control q' keyboard: 'control q'
} }
]) ]
}, },
{ {
id: 'userMenu', id: 'userMenu',
@ -48,12 +63,12 @@ oml.ui.mainMenu = function() {
}, },
{}, {},
{ {
id: 'users', id: 'peers',
title: Ox._('Users...') title: Ox._('Peers...')
}, },
{ {
id: 'devices', id: 'transfers',
title: Ox._('Devices...') title: Ox._('Transfers...')
} }
] ]
}, },
@ -164,19 +179,6 @@ oml.ui.mainMenu = function() {
title: Ox._((ui.showBrowser ? 'Hide': 'Show') + ' Browser'), title: Ox._((ui.showBrowser ? 'Hide': 'Show') + ' Browser'),
keyboard: 'shift b', keyboard: 'shift b',
disabled: !ui.item disabled: !ui.item
},
{},
{
id: 'notifications',
title: Ox._('Notifications...')
},
{
id: 'transfers',
title: Ox._('Transfers...')
},
{
id: 'activity',
title: Ox._('Activity...')
} }
] ]
}, },
@ -348,16 +350,17 @@ oml.ui.mainMenu = function() {
if (Ox.contains([ if (Ox.contains([
'about', 'faq', 'terms', 'development', 'contact' 'about', 'faq', 'terms', 'development', 'contact'
], id)) { ], id)) {
oml.UI.set({'part.app': id}); oml.UI.set({page: id});
oml.UI.set({page: 'app'});
} else if (id == 'update') { } else if (id == 'update') {
oml.$ui.updateDialog = oml.ui.updateDialog().open(); oml.$ui.updateDialog = oml.ui.updateDialog().open();
} else if (id == 'quit') { } else if (id == 'quit') {
oml.api.quit(); oml.api.quit();
} else if (id == 'preferences') { } else if (id == 'preferences') {
oml.UI.set({page: 'preferences'}); oml.UI.set({page: 'preferences'});
} else if (id == 'users') { } else if (id == 'peers') {
oml.UI.set({page: 'users'}); oml.UI.set({page: 'peers'});
} else if (id == 'transfers') {
oml.UI.set({page: 'transfers'});
} else if (id == 'alllibraries') { } else if (id == 'alllibraries') {
if (!ui._list) { if (!ui._list) {
oml.UI.set({item: ''}); oml.UI.set({item: ''});
@ -460,8 +463,6 @@ oml.ui.mainMenu = function() {
oml.UI.set({showFilters: !ui.showFilters}); oml.UI.set({showFilters: !ui.showFilters});
} else if (id == 'showbrowser') { } else if (id == 'showbrowser') {
oml.UI.set({showBrowser: !ui.showBrowser}); oml.UI.set({showBrowser: !ui.showBrowser});
} else if (id == 'transfers') {
oml.UI.set({page: 'transfers'});
} else if (id == 'debugmode') { } else if (id == 'debugmode') {
if (oml.localStorage('enableDebugMode')) { if (oml.localStorage('enableDebugMode')) {
oml.localStorage['delete']('enableDebugMode'); oml.localStorage['delete']('enableDebugMode');