summaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qmlmanager.cpp27
-rw-r--r--mobile-widgets/qmlmanager.h1
2 files changed, 28 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 24a51dfe9..3961cc5cf 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -222,6 +222,33 @@ void QMLManager::mergeLocalRepo()
process_dives(true, false);
}
+void QMLManager::cancelCredentialsPinSetup()
+{
+ /*
+ * The user selected <cancel> on the final stage of the
+ * cloud account generation (entering the emailed PIN).
+ *
+ * For now, just reset all the cloud data. This brings the app
+ * back to its initial state, and the user can startover again.
+ *
+ * Notice that this function is also used to switch to NOCLOUD
+ * mode. So the name is not perfect.
+ */
+ QSettings s;
+
+ setCloudUserName(NULL);
+ setCloudPassword(NULL);
+ setCredentialStatus(CS_UNKNOWN);
+ s.beginGroup("CloudStorage");
+ s.setValue("email", cloudUserName());
+ s.setValue("password", cloudPassword());
+ s.setValue("cloud_verification_status", credentialStatus());
+ s.sync();
+ setStartPageText(tr("Starting..."));
+
+ setShowPin(false);
+}
+
void QMLManager::finishSetup()
{
// Initialize cloud credentials.
diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h
index dec9e6502..87668d92e 100644
--- a/mobile-widgets/qmlmanager.h
+++ b/mobile-widgets/qmlmanager.h
@@ -167,6 +167,7 @@ public slots:
void populateGpsData();
void cancelDownloadDC();
void clearGpsData();
+ void cancelCredentialsPinSetup();
void finishSetup();
void openLocalThenRemote(QString url);
void mergeLocalRepo();