aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pref.h2
-rw-r--r--qt-ui/preferences.cpp16
2 files changed, 18 insertions, 0 deletions
diff --git a/pref.h b/pref.h
index 3320e39e5..d400562b4 100644
--- a/pref.h
+++ b/pref.h
@@ -91,6 +91,8 @@ struct preferences {
bool use_default_file;
facebook_prefs_t facebook;
char *passphrase;
+ char *remote_storage_email;
+ bool save_PIN_local;
};
enum unit_system_values {
METRIC,
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp
index db454c6d8..da3a45715 100644
--- a/qt-ui/preferences.cpp
+++ b/qt-ui/preferences.cpp
@@ -204,6 +204,12 @@ void PreferencesDialog::setUiFromPrefs()
ui.proxyPassword->setText(prefs.proxy_pass);
ui.proxyType->setCurrentIndex(ui.proxyType->findData(prefs.proxy_type));
ui.btnUseDefaultFile->setChecked(prefs.use_default_file);
+
+ s.beginGroup("RemoteStorage");
+ ui.remote_storage_email->setText(prefs.remote_storage_email);
+ ui.remote_storage_pin->setText(prefs.passphrase);
+ ui.save_PIN_local->setChecked(prefs.save_PIN_local);
+ s.endGroup();
}
void PreferencesDialog::restorePrefs()
@@ -355,6 +361,14 @@ void PreferencesDialog::syncSettings()
s.setValue("proxy_pass", ui.proxyPassword->text());
s.endGroup();
+ s.beginGroup("RemoteStorage");
+ SAVE_OR_REMOVE("remote_storage_email", default_prefs.remote_storage_email, ui.remote_storage_email->text());
+ SAVE_OR_REMOVE("save_PIN_local", default_prefs.save_PIN_local, ui.save_PIN_local->isChecked());
+ if (ui.save_PIN_local->isChecked())
+ SAVE_OR_REMOVE("passphrase", default_prefs.passphrase, ui.remote_storage_pin->text());
+ else
+ s.remove("passphrase");
+ s.endGroup();
loadSettings();
emit settingsChanged();
}
@@ -468,6 +482,8 @@ void PreferencesDialog::loadSettings()
s.beginGroup("RemoteStorage");
GET_TXT("passphrase", passphrase);
+ GET_TXT("remote_storage_email", remote_storage_email);
+ GET_BOOL("save_PIN_local", save_PIN_local);
s.endGroup();
}