KiCad PCB EDA Suite
Loading...
Searching...
No Matches
NOTIFICATIONS_MANAGER Class Reference

#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. More...
 
void Remove (const wxString &aKey)
 Remove a notification by key. More...
 
void Load ()
 Loads notifications stored from disk. More...
 
void Save ()
 Saves notifications to disk. More...
 
void ShowList (wxWindow *aParent, wxPoint aPos)
 Shows the notification list. More...
 
void RegisterStatusBar (KISTATUSBAR *aStatusBar)
 Add a status bar for handling. More...
 
void UnregisterStatusBar (KISTATUSBAR *aStatusBar)
 Removes status bar from handling. More...
 

Private Member Functions

void onListWindowClosed (wxCloseEvent &aEvent)
 Handles removing the shown list window from our list of shown windows. More...
 

Private Attributes

std::vector< NOTIFICATIONm_notifications
 Currently shown notification lists. More...
 
std::vector< NOTIFICATIONS_LIST * > m_shownDialogs
 Status bars registered for updates. More...
 
std::vector< KISTATUSBAR * > m_statusBars
 The cached file path to read/write notifications on disk. More...
 
wxFileName m_destFileName
 

Friends

class NOTIFICATION_LIST
 

Detailed Description

Definition at line 50 of file notifications_manager.h.

Constructor & Destructor Documentation

◆ NOTIFICATIONS_MANAGER()

NOTIFICATIONS_MANAGER::NOTIFICATIONS_MANAGER ( )

Definition at line 244 of file notifications_manager.cpp.

References PATHS::GetUserCachePath(), and m_destFileName.

Member Function Documentation

◆ CreateOrUpdate()

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.

Parameters
aKeyis a unique key for the notification, this allows removing or updating the same notification
aTitleis the displayed title for the event
aDescriptionis the text that displays underneath the title and has slightly more info them later programtically in case a notificaiton is no logner required
aHrefis link to external or internal content

Definition at line 286 of file notifications_manager.cpp.

References NOTIFICATION::description, NOTIFICATION::href, m_notifications, m_shownDialogs, m_statusBars, Save(), and NOTIFICATION::title.

Referenced by Load().

◆ Load()

void NOTIFICATIONS_MANAGER::Load ( )

Loads notifications stored from disk.

Definition at line 250 of file notifications_manager.cpp.

References CreateOrUpdate(), m_destFileName, and m_notifications.

Referenced by PGM_BASE::InitPgm().

◆ onListWindowClosed()

void NOTIFICATIONS_MANAGER::onListWindowClosed ( wxCloseEvent &  aEvent)
private

Handles removing the shown list window from our list of shown windows.

Current stack of notifications

Definition at line 365 of file notifications_manager.cpp.

References m_shownDialogs.

Referenced by ShowList().

◆ RegisterStatusBar()

void NOTIFICATIONS_MANAGER::RegisterStatusBar ( KISTATUSBAR aStatusBar)

Add a status bar for handling.

Definition at line 400 of file notifications_manager.cpp.

References m_notifications, m_statusBars, and KISTATUSBAR::SetNotificationCount().

◆ Remove()

void NOTIFICATIONS_MANAGER::Remove ( const wxString &  aKey)

Remove a notification by key.

Parameters
aKeyis the unique key to locate

Definition at line 331 of file notifications_manager.cpp.

References m_notifications, m_shownDialogs, m_statusBars, and Save().

◆ Save()

void NOTIFICATIONS_MANAGER::Save ( )

Saves notifications to disk.

Definition at line 275 of file notifications_manager.cpp.

References m_destFileName, and m_notifications.

Referenced by CreateOrUpdate(), and Remove().

◆ ShowList()

void NOTIFICATIONS_MANAGER::ShowList ( wxWindow *  aParent,
wxPoint  aPos 
)

Shows the notification list.

Definition at line 379 of file notifications_manager.cpp.

References NOTIFICATIONS_LIST::Add(), m_notifications, m_shownDialogs, and onListWindowClosed().

◆ UnregisterStatusBar()

void NOTIFICATIONS_MANAGER::UnregisterStatusBar ( KISTATUSBAR aStatusBar)

Removes status bar from handling.

Definition at line 409 of file notifications_manager.cpp.

References m_statusBars.

Friends And Related Function Documentation

◆ NOTIFICATION_LIST

friend class NOTIFICATION_LIST
friend

Definition at line 52 of file notifications_manager.h.

Member Data Documentation

◆ m_destFileName

wxFileName NOTIFICATIONS_MANAGER::m_destFileName
private

Definition at line 117 of file notifications_manager.h.

Referenced by Load(), NOTIFICATIONS_MANAGER(), and Save().

◆ m_notifications

std::vector<NOTIFICATION> NOTIFICATIONS_MANAGER::m_notifications
private

Currently shown notification lists.

Definition at line 108 of file notifications_manager.h.

Referenced by CreateOrUpdate(), Load(), RegisterStatusBar(), Remove(), Save(), and ShowList().

◆ m_shownDialogs

std::vector<NOTIFICATIONS_LIST*> NOTIFICATIONS_MANAGER::m_shownDialogs
private

Status bars registered for updates.

Definition at line 111 of file notifications_manager.h.

Referenced by CreateOrUpdate(), onListWindowClosed(), Remove(), and ShowList().

◆ m_statusBars

std::vector<KISTATUSBAR*> NOTIFICATIONS_MANAGER::m_statusBars
private

The cached file path to read/write notifications on disk.

Definition at line 114 of file notifications_manager.h.

Referenced by CreateOrUpdate(), RegisterStatusBar(), Remove(), and UnregisterStatusBar().


The documentation for this class was generated from the following files: