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

Detailed Description

Definition at line 51 of file notifications_manager.h.

Constructor & Destructor Documentation

◆ NOTIFICATIONS_MANAGER()

NOTIFICATIONS_MANAGER::NOTIFICATIONS_MANAGER ( )

Definition at line 249 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 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().

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

◆ 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 370 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 405 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 336 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 ( )

Saves notifications to disk.

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

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

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

Definition at line 118 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 109 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 112 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 115 of file notifications_manager.h.

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


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