KiCad PCB EDA Suite
|
#include <notifications_manager.h>
Public Member Functions | |
NOTIFICATIONS_MANAGER () | |
void | CreateOrUpdate (const wxString &aKey, const wxString &aTitle, const wxString &aDescription, const wxString &aHref=wxEmptyString) |
Create a notification with the given parameters or updates an existing one with the same key. | |
void | Remove (const wxString &aKey) |
Remove a notification by key. | |
void | Load () |
Load notifications stored from disk. | |
void | Save () |
Save notifications to disk. | |
void | ShowList (wxWindow *aParent, wxPoint aPos) |
Show the notification list. | |
void | RegisterStatusBar (KISTATUSBAR *aStatusBar) |
Add a status bar for handling. | |
void | UnregisterStatusBar (KISTATUSBAR *aStatusBar) |
Remove status bar from handling. | |
Private Member Functions | |
void | onListWindowClosed (wxCloseEvent &aEvent) |
Handle removing the shown list window from our list of shown windows. | |
Private Attributes | |
std::vector< NOTIFICATION > | m_notifications |
Current stack of notifications. | |
std::vector< NOTIFICATIONS_LIST * > | m_shownDialogs |
Currently shown notification lists. | |
std::vector< KISTATUSBAR * > | m_statusBars |
Status bars registered for updates. | |
wxFileName | m_destFileName |
The cached file path to read/write notifications on disk. | |
Friends | |
class | NOTIFICATION_LIST |
Definition at line 51 of file notifications_manager.h.
NOTIFICATIONS_MANAGER::NOTIFICATIONS_MANAGER | ( | ) |
Definition at line 254 of file notifications_manager.cpp.
References PATHS::GetUserCachePath(), and m_destFileName.
void NOTIFICATIONS_MANAGER::CreateOrUpdate | ( | const wxString & | aKey, |
const wxString & | aTitle, | ||
const wxString & | aDescription, | ||
const wxString & | aHref = wxEmptyString |
||
) |
Create a notification with the given parameters or updates an existing one with the same key.
aKey | is a unique key for the notification, this allows removing or updating the same notification. |
aTitle | is the displayed title for the event. |
aDescription | is the text that displays underneath the title and has slightly more info them later programatically in case a notification is no longer required. |
aHref | is link to external or internal content. |
Definition at line 296 of file notifications_manager.cpp.
References NOTIFICATION::description, NOTIFICATION::href, m_notifications, m_shownDialogs, m_statusBars, Save(), and NOTIFICATION::title.
Referenced by KICAD_MANAGER_FRAME::CreatePCM(), and Load().
void NOTIFICATIONS_MANAGER::Load | ( | ) |
Load notifications stored from disk.
Definition at line 260 of file notifications_manager.cpp.
References CreateOrUpdate(), m_destFileName, and m_notifications.
Referenced by PGM_BASE::InitPgm().
|
private |
Handle removing the shown list window from our list of shown windows.
Definition at line 375 of file notifications_manager.cpp.
References m_shownDialogs.
Referenced by ShowList().
void NOTIFICATIONS_MANAGER::RegisterStatusBar | ( | KISTATUSBAR * | aStatusBar | ) |
Add a status bar for handling.
Definition at line 410 of file notifications_manager.cpp.
References m_notifications, m_statusBars, and KISTATUSBAR::SetNotificationCount().
Referenced by EVT_MENU_RANGE().
void NOTIFICATIONS_MANAGER::Remove | ( | const wxString & | aKey | ) |
Remove a notification by key.
aKey | is the unique key to locate. |
Definition at line 341 of file notifications_manager.cpp.
References m_notifications, m_shownDialogs, m_statusBars, and Save().
Referenced by KICAD_MANAGER_FRAME::CreatePCM().
void NOTIFICATIONS_MANAGER::Save | ( | ) |
Save notifications to disk.
Definition at line 285 of file notifications_manager.cpp.
References m_destFileName, and m_notifications.
Referenced by CreateOrUpdate(), and Remove().
void NOTIFICATIONS_MANAGER::ShowList | ( | wxWindow * | aParent, |
wxPoint | aPos | ||
) |
Show the notification list.
Definition at line 389 of file notifications_manager.cpp.
References NOTIFICATIONS_LIST::Add(), m_notifications, m_shownDialogs, and onListWindowClosed().
Referenced by KISTATUSBAR::onNotificationsIconClick().
void NOTIFICATIONS_MANAGER::UnregisterStatusBar | ( | KISTATUSBAR * | aStatusBar | ) |
Remove status bar from handling.
Definition at line 419 of file notifications_manager.cpp.
References m_statusBars.
Referenced by KICAD_MANAGER_FRAME::~KICAD_MANAGER_FRAME().
|
friend |
Definition at line 53 of file notifications_manager.h.
|
private |
The cached file path to read/write notifications on disk.
Definition at line 119 of file notifications_manager.h.
Referenced by Load(), NOTIFICATIONS_MANAGER(), and Save().
|
private |
Current stack of notifications.
Definition at line 110 of file notifications_manager.h.
Referenced by CreateOrUpdate(), Load(), RegisterStatusBar(), Remove(), Save(), and ShowList().
|
private |
Currently shown notification lists.
Definition at line 113 of file notifications_manager.h.
Referenced by CreateOrUpdate(), onListWindowClosed(), Remove(), and ShowList().
|
private |
Status bars registered for updates.
Definition at line 116 of file notifications_manager.h.
Referenced by CreateOrUpdate(), RegisterStatusBar(), Remove(), and UnregisterStatusBar().