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)
 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< NOTIFICATIONm_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
 

Detailed Description

Definition at line 51 of file notifications_manager.h.

Constructor & Destructor Documentation

◆ NOTIFICATIONS_MANAGER()

NOTIFICATIONS_MANAGER::NOTIFICATIONS_MANAGER ( )

Definition at line 254 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 
)

Create 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 programatically in case a notification is no longer required.
aHrefis 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().

◆ 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().

◆ onListWindowClosed()

void NOTIFICATIONS_MANAGER::onListWindowClosed ( wxCloseEvent &  aEvent)
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().

◆ RegisterStatusBar()

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().

◆ Remove()

void NOTIFICATIONS_MANAGER::Remove ( const wxString &  aKey)

Remove a notification by key.

Parameters
aKeyis 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().

◆ Save()

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().

◆ ShowList()

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().

◆ UnregisterStatusBar()

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().

Friends And Related Function Documentation

◆ NOTIFICATION_LIST

friend class NOTIFICATION_LIST
friend

Definition at line 53 of file notifications_manager.h.

Member Data Documentation

◆ m_destFileName

wxFileName NOTIFICATIONS_MANAGER::m_destFileName
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().

◆ m_notifications

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

Current stack of notifications.

Definition at line 110 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

Currently shown notification lists.

Definition at line 113 of file notifications_manager.h.

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

◆ m_statusBars

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

Status bars registered for updates.

Definition at line 116 of file notifications_manager.h.

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


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