Explorar el Código

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

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
Claudio Cambra hace 3 años
padre
commit
ecd5f663dc
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  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