Updater: Add/clarify error messages

This commit is contained in:
Dentomologist
2022-10-31 23:08:35 -07:00
parent 2808db7f2f
commit 7cd08fde75
5 changed files with 39 additions and 23 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,7 +21,7 @@ public:
void run() override;
void OnUpdateAvailable(const NewVersionInformation& info) override;
bool CheckForUpdate();
void CheckForUpdate();
private:
QWidget* m_parent;