obs-studio/UI/win-update/win-update.hpp
jp9000 0fb34ed965 UI: Fix closing OBS before showing whats new dialog
The program can get stuck waiting for the browser within a event queue,
so instead mark that the program is closing, do it in a separate thread,
signal the window when it's finished, and then check whether it's in the
process of closing before actually showing the dialog.
2020-03-16 08:59:46 -07:00

50 lines
931 B
C++

#pragma once
#include <QThread>
#include <QString>
class AutoUpdateThread : public QThread {
Q_OBJECT
bool manualUpdate;
bool user_confirmed = false;
virtual void run() override;
void info(const QString &title, const QString &text);
int queryUpdate(bool manualUpdate, const char *text_utf8);
private slots:
void infoMsg(const QString &title, const QString &text);
int queryUpdateSlot(bool manualUpdate, const QString &text);
public:
AutoUpdateThread(bool manualUpdate_) : manualUpdate(manualUpdate_) {}
};
class WhatsNewInfoThread : public QThread {
Q_OBJECT
virtual void run() override;
signals:
void Result(const QString &text);
public:
inline WhatsNewInfoThread() {}
};
class WhatsNewBrowserInitThread : public QThread {
Q_OBJECT
QString url;
virtual void run() override;
signals:
void Result(const QString &url);
public:
inline WhatsNewBrowserInitThread(const QString &url_) : url(url_) {}
};