Selaa lähdekoodia

Only enable check for update button when the sparkle updater is not working

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
Claudio Cambra 3 vuotta sitten
vanhempi
commit
ecd5f663dc
1 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  1. 5 1
      src/gui/generalsettings.cpp

+ 5 - 1
src/gui/generalsettings.cpp

@@ -304,7 +304,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