statuswidget.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef STATUSWIDGET_H
  2. #define STATUSWIDGET_H
  3. #include <QWidget>
  4. #include <QSettings>
  5. namespace Ui {
  6. class StatusWidget;
  7. }
  8. class PatchDownloader;
  9. class LotroDatManager;
  10. class StatusWidget : public QWidget
  11. {
  12. Q_OBJECT
  13. public:
  14. explicit StatusWidget(QSettings* settings, PatchDownloader* patch_downloader, LotroDatManager* lotro_dat_manager, QWidget *parent = 0);
  15. ~StatusWidget();
  16. public slots:
  17. void updateFontsSizes();
  18. protected:
  19. void resizeEvent(QResizeEvent *event) override;
  20. private slots:
  21. void onPatchDownloaderStarted();
  22. void onPatchDownloaderFinished();
  23. void onPatchDownloaderProgressChanged(quint64 bytesDownloaded, quint64 bytesTotal,
  24. QString download_speed_formatted,
  25. QString elapsed_time_formatted);
  26. void on_game_button_clicked();
  27. void setToolTipToWeeklyCodeHelp();
  28. void setToolTipToWeeklyCodeComplete();
  29. void setToolTipToNewsHelp();
  30. void resetToolTip();
  31. private:
  32. Ui::StatusWidget *ui;
  33. QSettings* app_settings;
  34. PatchDownloader* patch_updater;
  35. LotroDatManager* lotro_manager;
  36. const QColor inWorkColor = QColor(85, 170, 255);
  37. const QColor readyColor = QColor(0, 170, 0);
  38. const QColor errorColor = QColor(255, 85, 0);
  39. const QString inWorkIconStyle = "image: url(:/assets/info.png);";
  40. const QString readyIconStyle = "image: url(:/assets/ok.png);";
  41. const QString criticalIconStyle = "image: url(:/assets/critical.png);";
  42. const QString warningIconStyle = "image: url(:/assets/warning.png);";
  43. };
  44. #endif // STATUSWIDGET_H