Ensure the right radio is selected when selective sync is picked
authorKevin Ottens <kevin.ottens@nextcloud.com>
Mon, 25 Jan 2021 15:53:21 +0000 (16:53 +0100)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Mon, 25 Jan 2021 15:53:21 +0000 (16:53 +0100)
This got broken previously when trying to reconcile during a
cherry-pick. This also repairs the case when the theme tells us the
default is to not select anything (not that we're using this right now
but in case we'd like to brand this).

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
src/gui/wizard/owncloudadvancedsetuppage.cpp

index a641b75b5322aab23557fa165bdb44f01f928eba..6053f04e8c1a60c1bd043186983c6ac95eac9c68 100644 (file)
@@ -149,6 +149,7 @@ void OwncloudAdvancedSetupPage::initializePage()
 
     if (Theme::instance()->wizardSelectiveSyncDefaultNothing()) {
         _selectiveSyncBlacklist = QStringList("/");
+        setRadioChecked(_ui.rSelectiveSync);
         QTimer::singleShot(0, this, &OwncloudAdvancedSetupPage::slotSelectiveSyncClicked);
     }
 
@@ -367,6 +368,9 @@ void OwncloudAdvancedSetupPage::slotSelectiveSyncClicked()
 
         if (updateBlacklist) {
             if (!_selectiveSyncBlacklist.isEmpty()) {
+                _ui.rSelectiveSync->blockSignals(true);
+                setRadioChecked(_ui.rSelectiveSync);
+                _ui.rSelectiveSync->blockSignals(false);
                 auto s = dlg->estimatedSize();
                 if (s > 0) {
                     _ui.lSelectiveSyncSizeLabel->setText(tr("(%1)").arg(Utility::octetsToString(s)));