]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Only enable check for update button when the sparkle updater is not working
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Thu, 23 Feb 2023 13:25:03 +0000 (14:25 +0100)
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>
Sat, 22 Jul 2023 09:16:39 +0000 (11:16 +0200)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/generalsettings.cpp

index af2d8acee8b33843eac50e55a34adde1385070a5..0296c7083280b28fabcad9038d697e2ba25e1c1e 100644 (file)
@@ -308,7 +308,11 @@ void GeneralSettings::slotUpdateInfo()
         connect(sparkleUpdater, &SparkleUpdater::statusChanged, this, &GeneralSettings::slotUpdateInfo, Qt::UniqueConnection);
         _ui->updateStateLabel->setText(sparkleUpdater->statusString());
         _ui->restartButton->setVisible(false);
-        _ui->updateButton->setEnabled(true);
+
+        const auto updaterState = sparkleUpdater->state();
+        const auto enableUpdateButton = updaterState == SparkleUpdater::State::Idle ||
+                                        updaterState == SparkleUpdater::State::Unknown;
+        _ui->updateButton->setEnabled(enableUpdateButton);
     }
 #endif