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) |
Creates 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 () |
Loads notifications stored from disk. | |
void | Save () |
Saves notifications to disk. | |
void | ShowList (wxWindow *aParent, wxPoint aPos) |
Shows the notification list. | |
void | RegisterStatusBar (KISTATUSBAR *aStatusBar) |
Add a status bar for handling. | |
void | UnregisterStatusBar (KISTATUSBAR *aStatusBar) |
Removes status bar from handling. | |
Private Member Functions | |
void | onListWindowClosed (wxCloseEvent &aEvent) |
Handles removing the shown list window from our list of shown windows. | |
Private Attributes | |
std::vector< NOTIFICATION > | m_notifications |
Currently shown notification lists. | |
std::vector< NOTIFICATIONS_LIST * > | m_shownDialogs |
Status bars registered for updates. | |
std::vector< KISTATUSBAR * > | m_statusBars |
The cached file path to read/write notifications on disk. | |
wxFileName | m_destFileName |
Friends | |
class | NOTIFICATION_LIST |
Definition at line 51 of file notifications_manager.h.
NOTIFICATIONS_MANAGER::NOTIFICATIONS_MANAGER | ( | ) |
Definition at line 249 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 |
||
) |
Creates 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 programtically in case a notificaiton is no logner required |
aHref | is link to external or internal content |
Definition at line 291 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 | ( | ) |
Loads notifications stored from disk.
Definition at line 255 of file notifications_manager.cpp.
References CreateOrUpdate(), m_destFileName, and m_notifications.
Referenced by PGM_BASE::InitPgm().
|
private |
Handles removing the shown list window from our list of shown windows.
Current stack of notifications
Definition at line 370 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 405 of file notifications_manager.cpp.
References m_notifications, m_statusBars, and KISTATUSBAR::SetNotificationCount().
Referenced by KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME().
void NOTIFICATIONS_MANAGER::Remove | ( | const wxString & | aKey | ) |
Remove a notification by key.
aKey | is the unique key to locate |
Definition at line 336 of file notifications_manager.cpp.
References m_notifications, m_shownDialogs, m_statusBars, and Save().
Referenced by KICAD_MANAGER_FRAME::CreatePCM().
void NOTIFICATIONS_MANAGER::Save | ( | ) |
Saves notifications to disk.
Definition at line 280 of file notifications_manager.cpp.
References m_destFileName, and m_notifications.
Referenced by CreateOrUpdate(), and Remove().
void NOTIFICATIONS_MANAGER::ShowList | ( | wxWindow * | aParent, |
wxPoint | aPos | ||
) |
Shows the notification list.
Definition at line 384 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 | ) |
Removes status bar from handling.
Definition at line 414 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 |
Definition at line 118 of file notifications_manager.h.
Referenced by Load(), NOTIFICATIONS_MANAGER(), and Save().
|
private |
Currently shown notification lists.
Definition at line 109 of file notifications_manager.h.
Referenced by CreateOrUpdate(), Load(), RegisterStatusBar(), Remove(), Save(), and ShowList().
|
private |
Status bars registered for updates.
Definition at line 112 of file notifications_manager.h.
Referenced by CreateOrUpdate(), onListWindowClosed(), Remove(), and ShowList().
|
private |
The cached file path to read/write notifications on disk.
Definition at line 115 of file notifications_manager.h.
Referenced by CreateOrUpdate(), RegisterStatusBar(), Remove(), and UnregisterStatusBar().