diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-06-12 19:12:34 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-06-12 19:12:34 -0400 |
| commit | 4a7a77480bfd44c7780e9e37bceadac7e367c062 (patch) | |
| tree | 3cceddbc3b021d8b29ba760847fe5541337b780c /src/statusbar.h | |
| parent | 16d6a4c528fd226ac5bf9a2ff54911c567d5bca0 (diff) | |
changed StatusBarNotifications to a generic StatusBarAction
added update notification to statusbar
Diffstat (limited to 'src/statusbar.h')
| -rw-r--r-- | src/statusbar.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/statusbar.h b/src/statusbar.h index 8edfd037..2baf12ee 100644 --- a/src/statusbar.h +++ b/src/statusbar.h @@ -7,14 +7,15 @@ struct APIStats; class APIUserAccount; class Settings; +namespace Ui { class MainWindow; } -class StatusBarNotifications : public QWidget +class StatusBarAction : public QWidget { public: - StatusBarNotifications(QAction* action); + StatusBarAction(QAction* action); - void update(bool hasNotifications); + void set(bool visible); protected: void mouseDoubleClickEvent(QMouseEvent* e) override; @@ -23,23 +24,27 @@ private: QAction* m_action; QLabel* m_icon; QLabel* m_text; + + QString cleanupActionText(const QString& s) const; }; class StatusBar { public: - StatusBar(QStatusBar* bar, QAction* actionNotifications); + StatusBar(QStatusBar* bar, Ui::MainWindow* ui); void setProgress(int percent); - void updateNotifications(bool hasNotifications); - void updateAPI(const APIStats& stats, const APIUserAccount& user); + void setNotifications(bool hasNotifications); + void setAPI(const APIStats& stats, const APIUserAccount& user); + void setUpdateAvailable(bool b); void checkSettings(const Settings& settings); private: QStatusBar* m_bar; - StatusBarNotifications* m_notifications; QProgressBar* m_progress; + StatusBarAction* m_notifications; + StatusBarAction* m_update; QLabel* m_api; }; |
