diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-06-12 11:48:56 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-06-12 11:48:56 -0700 |
commit | 492369b3125b2c1c91f134c360110440b03d33b6 (patch) | |
tree | 4434e38a493f80a4fd5418350a4a1f002270fd87 /qt-ui | |
parent | 3a0ffb70a0549b5c717e256cf602aadf2ea782a8 (diff) | |
download | subsurface-492369b3125b2c1c91f134c360110440b03d33b6.tar.gz |
Cloud storage: Add preference option whether to sync in the background
This defaults to on as that's the most useful setting for the average
user.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/preferences.cpp | 4 | ||||
-rw-r--r-- | qt-ui/preferences.ui | 27 |
2 files changed, 21 insertions, 10 deletions
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp index c6e1e2bd5..426944da0 100644 --- a/qt-ui/preferences.cpp +++ b/qt-ui/preferences.cpp @@ -219,6 +219,7 @@ void PreferencesDialog::setUiFromPrefs() ui.save_password_local->setChecked(prefs.save_password_local); ui.cloud_storage_pin->setVisible(prefs.show_cloud_pin); ui.cloud_storage_pin_label->setVisible(prefs.show_cloud_pin); + ui.cloud_background_sync->setChecked(prefs.cloud_background_sync); } void PreferencesDialog::restorePrefs() @@ -404,6 +405,8 @@ void PreferencesDialog::syncSettings() prefs.cloud_storage_password = strdup(qPrintable(password)); } SAVE_OR_REMOVE("show_cloud_pin", default_prefs.show_cloud_pin, prefs.show_cloud_pin); + SAVE_OR_REMOVE("cloud_background_sync", default_prefs.cloud_background_sync, ui.cloud_background_sync->isChecked()); + s.endGroup(); loadSettings(); emit settingsChanged(); @@ -523,6 +526,7 @@ void PreferencesDialog::loadSettings() GET_TXT("password", cloud_storage_password); } GET_BOOL("show_cloud_pin", show_cloud_pin); + GET_BOOL("cloud_background_sync", cloud_background_sync); s.endGroup(); } diff --git a/qt-ui/preferences.ui b/qt-ui/preferences.ui index 54ffb41d0..0f5e94fe4 100644 --- a/qt-ui/preferences.ui +++ b/qt-ui/preferences.ui @@ -413,7 +413,7 @@ <height>83</height> </rect> </property> - <layout class="QGridLayout" name="gridLayout_3" rowstretch="1,1,1" columnstretch="1,1"> + <layout class="QGridLayout" name="gridLayout_3" rowstretch="1,1,1" columnstretch="1,1,0"> <property name="sizeConstraint"> <enum>QLayout::SetMaximumSize</enum> </property> @@ -451,20 +451,27 @@ </property> </widget> </item> - <item row="0" column="2"> + <item row="0" column="2"> <widget class="QLabel" name="cloud_storage_pin_label"> <property name="text"> <string>Verification PIN</string> </property> </widget> - </item> - <item row="1" column="2"> + </item> + <item row="1" column="2"> <widget class="QLineEdit" name="cloud_storage_pin"> <property name="toolTip"> <string extracomment="One time verification PIN for Subsurface cloud storage infrastructure"/> </property> </widget> - </item> + </item> + <item row="2" column="0"> + <widget class="QCheckBox" name="cloud_background_sync"> + <property name="text"> + <string>Sync to cloud in the background?</string> + </property> + </widget> + </item> </layout> </widget> </widget> @@ -1747,13 +1754,13 @@ </connection> </connections> <buttongroups> - <buttongroup name="buttonGroup_2"/> - <buttongroup name="buttonGroup_4"/> - <buttongroup name="buttonGroup_3"/> - <buttongroup name="buttonGroup_5"/> - <buttongroup name="buttonGroup"/> <buttongroup name="buttonGroup_6"/> + <buttongroup name="buttonGroup_3"/> <buttongroup name="buttonGroup_7"/> + <buttongroup name="buttonGroup_4"/> + <buttongroup name="buttonGroup"/> + <buttongroup name="buttonGroup_5"/> + <buttongroup name="buttonGroup_2"/> <buttongroup name="verticalSpeed"/> </buttongroups> </ui> |