#include <TrayIcon.hpp>
Public Member Functions | |
| TrayIcon () | |
| ~TrayIcon () | |
| bool | start () |
| void | stop () |
| void | set_icon (const std::string &icon_name) |
| void | set_icon_file (const std::string &png_path, int target_px=22) |
| void | set_tooltip (const std::string &text) |
| void | set_title (const std::string &title) |
| void | set_on_activate (std::function< void()> cb) |
| void | set_on_settings (std::function< void()> cb) |
| void | set_on_quit (std::function< void()> cb) |
| void | bind_ui_context () |
| TrayIcon () | |
| ~TrayIcon () | |
| bool | start () |
| void | stop () |
| void | set_icon (const std::string &icon_name) |
| void | set_icon_file (const std::string &png_path, int target_px=22) |
| void | set_tooltip (const std::string &text) |
| void | set_title (const std::string &title) |
| void | set_on_activate (std::function< void()> cb) |
| void | set_on_make_startup_persistent (std::function< void()> cb) |
| void | set_on_quit (std::function< void()> cb) |
| void | bind_ui_context () |
Private Attributes | |
| std::string | service_name_ |
| std::string | id_ = "bastionguard" |
| std::string | title_ = "BastionGuard" |
| std::string | icon_name_ = "security-high" |
| std::string | tooltip_ = "BastionGuard in esecuzione" |
| std::string | status_ = "Active" |
| GMainContext * | ui_ctx_ = nullptr |
| bool | have_pixmap_ = false |
| int | pix_w_ = 0 |
| int | pix_h_ = 0 |
| std::vector< uint8_t > | pix_rgba_ |
| std::function< void()> | on_activate_cb_ |
| std::function< void()> | on_settings_cb_ |
| std::function< void()> | on_quit_cb_ |
| std::thread | bus_thread_ |
| std::atomic_bool | running_ {false} |
| std::function< void()> | on_make_startup_persistent_cb_ |
Static Private Attributes | |
| static constexpr int | MENU_ROOT = 0 |
| static constexpr int | MENU_SHOW = 1 |
| static constexpr int | MENU_SETTINGS = 2 |
| static constexpr int | MENU_QUIT = 3 |
| static constexpr int | MENU_PERSIST_STARTUP = 2 |
Definition at line 37 of file TrayIcon.hpp.
|
default |
Definition at line 118 of file TrayIcon.cpp.
References icon_name_, id_, service_name_, status_, title_, and tooltip_.
| TrayIcon::~TrayIcon | ( | ) |
Definition at line 127 of file TrayIcon.cpp.
| TrayIcon::TrayIcon | ( | ) |
| TrayIcon::~TrayIcon | ( | ) |
| void TrayIcon::bind_ui_context | ( | ) |
Definition at line 297 of file TrayIcon.cpp.
References ui_ctx_.
| void TrayIcon::bind_ui_context | ( | ) |
References have_pixmap_, icon_name_, id_, on_activate_cb_, pix_h_, pix_rgba_, pix_w_, service_name_, status_, title_, tooltip_, and ui_ctx_.
| void TrayIcon::set_icon | ( | const std::string & | icon_name | ) |
Definition at line 363 of file TrayIcon.cpp.
References icon_name_.
| void TrayIcon::set_icon | ( | const std::string & | icon_name | ) |
| void TrayIcon::set_icon_file | ( | const std::string & | png_path, |
| int | target_px = 22 ) |
Definition at line 302 of file TrayIcon.cpp.
References have_pixmap_, icon_name_, pix_h_, pix_rgba_, and pix_w_.
| void TrayIcon::set_icon_file | ( | const std::string & | png_path, |
| int | target_px = 22 ) |
|
inline |
Definition at line 54 of file TrayIcon.hpp.
References on_activate_cb_.
|
inline |
Definition at line 54 of file TrayIcon.hpp.
References on_activate_cb_.
|
inline |
Definition at line 55 of file TrayIcon.hpp.
References on_make_startup_persistent_cb_.
|
inline |
Definition at line 56 of file TrayIcon.hpp.
References on_quit_cb_.
|
inline |
Definition at line 56 of file TrayIcon.hpp.
References on_quit_cb_.
|
inline |
Definition at line 55 of file TrayIcon.hpp.
References on_settings_cb_.
| void TrayIcon::set_title | ( | const std::string & | title | ) |
Definition at line 373 of file TrayIcon.cpp.
References title_.
| void TrayIcon::set_title | ( | const std::string & | title | ) |
| void TrayIcon::set_tooltip | ( | const std::string & | text | ) |
Definition at line 368 of file TrayIcon.cpp.
References tooltip_.
Referenced by MainWindow::onDaemonAlert(), MainWindow::onDaemonConnected(), and MainWindow::onDaemonDisconnected().
| void TrayIcon::set_tooltip | ( | const std::string & | text | ) |
| bool TrayIcon::start | ( | ) |
Definition at line 135 of file TrayIcon.cpp.
References bus_thread_, running_, and service_name_.
| bool TrayIcon::start | ( | ) |
| void TrayIcon::stop | ( | ) |
Definition at line 282 of file TrayIcon.cpp.
References bus_thread_, and running_.
Referenced by MainWindow::~MainWindow(), and ~TrayIcon().
| void TrayIcon::stop | ( | ) |
|
private |
Definition at line 117 of file TrayIcon.hpp.
|
private |
Definition at line 101 of file TrayIcon.hpp.
Referenced by bind_ui_context(), and set_icon_file().
|
private |
Definition at line 96 of file TrayIcon.hpp.
Referenced by bind_ui_context(), set_icon(), set_icon_file(), and TrayIcon().
|
private |
Definition at line 94 of file TrayIcon.hpp.
Referenced by bind_ui_context(), and TrayIcon().
|
staticconstexprprivate |
Definition at line 122 of file TrayIcon.hpp.
|
staticconstexprprivate |
Definition at line 123 of file TrayIcon.hpp.
|
staticconstexprprivate |
Definition at line 120 of file TrayIcon.hpp.
|
staticconstexprprivate |
Definition at line 122 of file TrayIcon.hpp.
|
staticconstexprprivate |
Definition at line 121 of file TrayIcon.hpp.
|
private |
Definition at line 107 of file TrayIcon.hpp.
Referenced by bind_ui_context(), and set_on_activate().
|
private |
Definition at line 108 of file TrayIcon.hpp.
Referenced by set_on_make_startup_persistent().
|
private |
Definition at line 109 of file TrayIcon.hpp.
Referenced by set_on_quit().
|
private |
Definition at line 108 of file TrayIcon.hpp.
Referenced by set_on_settings().
|
private |
Definition at line 103 of file TrayIcon.hpp.
Referenced by bind_ui_context(), and set_icon_file().
|
private |
Definition at line 104 of file TrayIcon.hpp.
Referenced by bind_ui_context(), and set_icon_file().
|
private |
Definition at line 102 of file TrayIcon.hpp.
Referenced by bind_ui_context(), and set_icon_file().
|
private |
Definition at line 118 of file TrayIcon.hpp.
|
private |
Definition at line 93 of file TrayIcon.hpp.
Referenced by bind_ui_context(), start(), and TrayIcon().
|
private |
Definition at line 98 of file TrayIcon.hpp.
Referenced by bind_ui_context(), and TrayIcon().
|
private |
Definition at line 95 of file TrayIcon.hpp.
Referenced by bind_ui_context(), set_title(), and TrayIcon().
|
private |
Definition at line 97 of file TrayIcon.hpp.
Referenced by bind_ui_context(), set_tooltip(), and TrayIcon().
|
private |
Definition at line 99 of file TrayIcon.hpp.
Referenced by bind_ui_context(), and ~TrayIcon().