Changelog crash fix (macOS) (#1935)

On macOS, trying to display a dialog before showing the main window
(like when starting minimized) leads to a crash. The dialog will now
show before the main window is opened, preventing this issue.
This commit is contained in:
Daniel
2020-09-06 06:02:15 -04:00
committed by GitHub
parent caf0023327
commit b024b47afd
4 changed files with 19 additions and 30 deletions
+18
View File
@@ -3,6 +3,7 @@
#include <atomic>
#include "common/Args.hpp"
#include "common/Version.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "controllers/commands/CommandController.hpp"
#include "controllers/ignores/IgnoreController.hpp"
@@ -70,6 +71,23 @@ void Application::initialize(Settings &settings, Paths &paths)
assert(isAppInitialized == false);
isAppInitialized = true;
// Show changelog
if (getSettings()->currentVersion.getValue() != "" &&
getSettings()->currentVersion.getValue() != CHATTERINO_VERSION)
{
auto box = new QMessageBox(QMessageBox::Information, "Chatterino 2",
"Show changelog?",
QMessageBox::Yes | QMessageBox::No);
box->setAttribute(Qt::WA_DeleteOnClose);
if (box->exec() == QMessageBox::Yes)
{
QDesktopServices::openUrl(
QUrl("https://www.chatterino.com/changelog"));
}
}
getSettings()->currentVersion.setValue(CHATTERINO_VERSION);
if (getSettings()->enableExperimentalIrc)
{
Irc::instance().load();