Merge pull request #11018 from Dentomologist/add_updater_error_messages

Add updater error messages
This commit is contained in:
Admiral H. Curtiss
2022-11-15 01:08:55 +01:00
committed by GitHub
7 changed files with 57 additions and 37 deletions

View File

@ -558,12 +558,7 @@ void MenuBar::InstallUpdateManually()
auto* const updater = new Updater(this->parentWidget(), manual_track,
Config::Get(Config::MAIN_AUTOUPDATE_HASH_OVERRIDE));
if (!updater->CheckForUpdate())
{
ModalMessageBox::information(
this, tr("Update"),
tr("You are running the latest version available on this update track."));
}
updater->CheckForUpdate();
}
void MenuBar::AddHelpMenu()

View File

@ -29,21 +29,19 @@ Updater::Updater(QWidget* parent, std::string update_track, std::string hash_ove
void Updater::run()
{
AutoUpdateChecker::CheckForUpdate(m_update_track, m_hash_override);
AutoUpdateChecker::CheckForUpdate(m_update_track, m_hash_override,
AutoUpdateChecker::CheckType::Automatic);
}
bool Updater::CheckForUpdate()
void Updater::CheckForUpdate()
{
m_update_available = false;
AutoUpdateChecker::CheckForUpdate(m_update_track, m_hash_override);
return m_update_available;
AutoUpdateChecker::CheckForUpdate(m_update_track, m_hash_override,
AutoUpdateChecker::CheckType::Manual);
}
void Updater::OnUpdateAvailable(const NewVersionInformation& info)
{
bool later = false;
m_update_available = true;
std::optional<int> choice = RunOnObject(m_parent, [&] {
QDialog* dialog = new QDialog(m_parent);

View File

@ -21,11 +21,10 @@ public:
void run() override;
void OnUpdateAvailable(const NewVersionInformation& info) override;
bool CheckForUpdate();
void CheckForUpdate();
private:
QWidget* m_parent;
std::string m_update_track;
std::string m_hash_override;
bool m_update_available = false;
};