mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: adapt "Manage dives" to no cloud status
If we are in no cloud mode - allow adding dives via the menu - enabling / disabling automatic sync makes no sense. - if the user wants to manually sync the cloud, they need to first enter credentials. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
27fccbbe4e
commit
8946edfd92
1 changed files with 15 additions and 6 deletions
|
@ -134,7 +134,7 @@ Kirigami.ApplicationWindow {
|
||||||
*/
|
*/
|
||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
text: "Add dive manually"
|
text: "Add dive manually"
|
||||||
enabled: manager.credentialStatus === QMLManager.VALID || manager.credentialStatus === QMLManager.VALID_EMAIL
|
enabled: manager.credentialStatus === QMLManager.VALID || manager.credentialStatus === QMLManager.VALID_EMAIL || manager.credentialStatus === QMLManager.NOCLOUD
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
returnTopPage() // otherwise odd things happen with the page stack
|
returnTopPage() // otherwise odd things happen with the page stack
|
||||||
startAddDive()
|
startAddDive()
|
||||||
|
@ -142,16 +142,25 @@ Kirigami.ApplicationWindow {
|
||||||
}
|
}
|
||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
text: "Manual sync with cloud"
|
text: "Manual sync with cloud"
|
||||||
enabled: manager.credentialStatus === QMLManager.VALID || manager.credentialStatus === QMLManager.VALID_EMAIL
|
enabled: manager.credentialStatus === QMLManager.VALID || manager.credentialStatus === QMLManager.VALID_EMAIL || manager.credentialStatus === QMLManager.NOCLOUD
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
|
if (manager.credentialStatus === QMLManager.NOCLOUD) {
|
||||||
|
returnTopPage()
|
||||||
|
oldStatus = manager.credentialStatus
|
||||||
|
manager.startPageText = "Enter valid cloud storage credentials"
|
||||||
|
manager.credentialStatus = QMLManager.UNKNOWN
|
||||||
|
globalDrawer.close()
|
||||||
|
} else {
|
||||||
globalDrawer.close()
|
globalDrawer.close()
|
||||||
detailsWindow.endEditMode()
|
detailsWindow.endEditMode()
|
||||||
manager.saveChangesCloud(true);
|
manager.saveChangesCloud(true);
|
||||||
globalDrawer.close()
|
globalDrawer.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
text: syncToCloud ? "Offline mode" : "Enable auto cloud sync"
|
text: syncToCloud ? "Offline mode" : "Enable auto cloud sync"
|
||||||
|
enabled: manager.credentialStatus !== QMLManager.NOCLOUD
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
syncToCloud = !syncToCloud
|
syncToCloud = !syncToCloud
|
||||||
if (!syncToCloud) {
|
if (!syncToCloud) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue