win-update.hpp 1.0 KB

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