implement new menu structure

This patch creates the following menu structure in the application menu
as discussed on irc:

Cloud credentials
Preferences
Manage dives
	Download from computer
	Add dive manually
	Refresh dives
	Upload to cloud
GPS
	Add GPS tags to dives
	Upload GPS data
	Clear GPS cache
Advanced (hidden by default)
	App log
	Theme Information

"Save" moves out of the context menu, since it's a global thing (syncs
to server).

Signed-off-by: Sebastian Kügler <sebas@kde.org>
This commit is contained in:
Sebastian Kügler 2015-12-08 02:33:11 +01:00
parent bfcc4aaf05
commit 36e3c5485e
2 changed files with 48 additions and 55 deletions

View file

@ -44,15 +44,6 @@ MobileComponents.Page {
] ]
contextualActions: [ contextualActions: [
Action {
text: "Save"
enabled: diveDetailsWindow.state == "edit"
iconName: "document-save"
onTriggered: {
manager.saveChanges();
contextDrawer.close();
}
},
Action { Action {
text: checked ? "View" : "Edit" text: checked ? "View" : "Edit"
checkable: true checkable: true

View file

@ -25,6 +25,12 @@ MobileComponents.ApplicationWindow {
bannerImageSource: "dive.jpg" bannerImageSource: "dive.jpg"
actions: [ actions: [
Action {
text: "Cloud credentials"
onTriggered: {
stackView.push(cloudCredWindow)
}
},
Action { Action {
text: "Preferences" text: "Preferences"
onTriggered: { onTriggered: {
@ -32,80 +38,76 @@ MobileComponents.ApplicationWindow {
} }
}, },
Action { MobileComponents.ActionGroup {
text: "Cloud login credentials" text: "Manage dives"
onTriggered: { Action {
stackView.push(cloudCredWindow) text: "Download from computer"
onTriggered: {
stackView.push(downloadDivesWindow)
}
} }
}, Action {
text: "Add dive manually"
Action { onTriggered: {
text: "Load Dives" manager.addDive();
onTriggered: { stackView.push(detailsWindow)
manager.loadDives(); }
} }
}, Action {
text: "Refresh"
Action { onTriggered: {
text: "Download Dives" manager.loadDives();
onTriggered: { }
stackView.push(downloadDivesWindow)
} }
}, Action {
text: "Upload to cloud"
Action { onTriggered: {
text: "Add Dive" manager.saveChanges();
onTriggered: { }
manager.addDive();
stackView.push(detailsWindow)
} }
}, },
MobileComponents.ActionGroup { MobileComponents.ActionGroup {
text: "GPS" text: "GPS"
Action { Action {
text: "Run location service" text: "GPS-tag dives"
checkable: true
checked: manager.locationServiceEnabled
onToggled: {
manager.locationServiceEnabled = checked;
}
}
Action {
text: "Apply GPS data to dives"
onTriggered: { onTriggered: {
manager.applyGpsData(); manager.applyGpsData();
} }
} }
Action { Action {
text: "Send GPS data to server" text: "Upload GPS data"
onTriggered: { onTriggered: {
manager.sendGpsData(); manager.sendGpsData();
} }
} }
Action { Action {
text: "Clear stored GPS data" text: "Clear GPS cache"
onTriggered: { onTriggered: {
manager.clearGpsData(); manager.clearGpsData();
} }
} }
}, },
Action { MobileComponents.ActionGroup {
text: "View Log" text: "Developer"
onTriggered: { Action {
stackView.push(logWindow) text: "App log"
onTriggered: {
stackView.push(logWindow)
}
} }
},
Action { Action {
text: "Theme Information" text: "Theme information"
onTriggered: { onTriggered: {
stackView.push(themetest) stackView.push(themetest)
}
} }
} }
] // end actions ] // end actions
MouseArea { MouseArea {