QML UI: different functions for saving Preferences and Cloud Credentials

Tapping Save on those two pages should only update the data that are actually
available on those pages.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-12-03 14:30:30 -08:00
parent 7a94360a6d
commit a0b83dc2f1
3 changed files with 8 additions and 3 deletions

View file

@ -72,7 +72,7 @@ Item {
manager.cloudUserName = login.text
manager.cloudPassword = password.text
manager.saveCloudPassword = savePassword.checked
manager.savePreferences()
manager.saveCloudCredentials()
stackView.pop()
}
}

View file

@ -42,13 +42,17 @@ QMLManager::~QMLManager()
void QMLManager::savePreferences()
{
QSettings s;
bool cloudCredentialsChanged = false;
s.beginGroup("LocationService");
s.setValue("time_threshold", timeThreshold() * 60);
prefs.time_threshold = timeThreshold() * 60;
s.setValue("distance_threshold", distanceThreshold());
prefs.distance_threshold = distanceThreshold();
s.endGroup();
}
void QMLManager::saveCloudCredentials()
{
QSettings s;
bool cloudCredentialsChanged = false;
s.beginGroup("CloudStorage");
s.setValue("email", cloudUserName());
s.setValue("save_password_local", saveCloudPassword());

View file

@ -50,6 +50,7 @@ public:
public slots:
void savePreferences();
void saveCloudCredentials();
void loadDives();
void commitChanges(QString diveId, QString suit, QString buddy, QString diveMaster, QString notes);
void saveChanges();