win-update.hpp 931 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #include <QThread>
  3. #include <QString>
  4. class AutoUpdateThread : public QThread {
  5. Q_OBJECT
  6. bool manualUpdate;
  7. bool user_confirmed = false;
  8. virtual void run() override;
  9. void info(const QString &title, const QString &text);
  10. int queryUpdate(bool manualUpdate, const char *text_utf8);
  11. private slots:
  12. void infoMsg(const QString &title, const QString &text);
  13. int queryUpdateSlot(bool manualUpdate, const QString &text);
  14. public:
  15. AutoUpdateThread(bool manualUpdate_) : manualUpdate(manualUpdate_) {}
  16. };
  17. class WhatsNewInfoThread : public QThread {
  18. Q_OBJECT
  19. virtual void run() override;
  20. signals:
  21. void Result(const QString &text);
  22. public:
  23. inline WhatsNewInfoThread() {}
  24. };
  25. class WhatsNewBrowserInitThread : public QThread {
  26. Q_OBJECT
  27. QString url;
  28. virtual void run() override;
  29. signals:
  30. void Result(const QString &url);
  31. public:
  32. inline WhatsNewBrowserInitThread(const QString &url_) : url(url_) {}
  33. };