hydrogen 1.2.3
StatusMessageDisplay Class Reference

Non-interactive display for status messages in the PlayerControl. More...

#include <StatusMessageDisplay.h>

Inheritance diagram for StatusMessageDisplay:
LCDDisplay Object< StatusMessageDisplay > Object< LCDDisplay > Base Base

Public Slots

void onPreferencesChanged (H2Core::Preferences::Changes changes)
 
- Public Slots inherited from LCDDisplay
void onPreferencesChanged (H2Core::Preferences::Changes changes)
 

Public Member Functions

 StatusMessageDisplay (QWidget *pParent, QSize size)
 
 ~StatusMessageDisplay ()
 
void showMessage (const QString &sMessage, const QString &sCaller="")
 
- Public Member Functions inherited from LCDDisplay
 LCDDisplay (QWidget *pParent, QSize size=QSize(0, 0), bool bFixedFont=false, bool bIsActive=true)
 
 ~LCDDisplay ()
 
bool getIsActive () const
 
void setIsActive (bool bIsActive)
 
void setUseRedFont (bool bUseRedFont)
 
- Public Member Functions inherited from Object< LCDDisplay >
 Object ()
 
 Object (const Object< LCDDisplay > &other)
 
- Public Member Functions inherited from Base
 Base ()
 
 Base (const Base &other)
 
virtual const char * class_name () const
 
void Print (bool bShort=true) const
 Prints content of toQString() via DEBUGLOG.
 
virtual QString toQString (const QString &sPrefix="", bool bShort=true) const
 Formatted string version for debugging purposes.
 
- Public Member Functions inherited from Object< StatusMessageDisplay >
 Object ()
 
 Object (const Object< StatusMessageDisplay > &other)
 

Private Slots

void onScrollTimerEvent ()
 
void onStatusTimerEvent ()
 

Private Member Functions

void displayMessage (const QString &sMessage)
 
virtual void enterEvent (QEvent *ev) override
 
virtual void leaveEvent (QEvent *ev) override
 
virtual void mousePressEvent (QMouseEvent *ev) override
 
virtual void paintEvent (QPaintEvent *ev) override
 
void reset ()
 
void updateMaxLength ()
 
void updateStyleSheet ()
 

Private Attributes

bool m_bEntered
 
bool m_bPreScroll
 
int m_nHistorySize
 
int m_nPreScrollTimeout
 Amount of time in milliseconds that pass before a message is being scrolled.
 
int m_nScrollTimeout
 Amount of time in milliseconds that pass between chopping characters for messages to long to display as a whole.
 
int m_nShowTimeout
 Amount of time in milliseconds for which the status message will be displayed.
 
QTimer * m_pScrollTimer
 
QTimer * m_pStatusTimer
 
QString m_sLastCaller
 
QString m_sScrollMessage
 
QStringList m_statusMessages
 

Additional Inherited Members

- Static Public Member Functions inherited from Base
static const char * _class_name ()
 return the class name
 
static QString base_clock (const QString &sMsg)
 Measures the current time and stores it in __last_clock.
 
static QString base_clock_in (const QString &sMsg)
 
static int bootstrap (Logger *logger, bool count=false)
 must be called before any Object instantiation !
 
static bool count_active ()
 
static int getAliveObjectCount ()
 
static object_map_t getObjectMap ()
 
static Loggerlogger ()
 return the logger instance
 
static int objects_count ()
 
static void printObjectMapDiff (object_map_t map)
 Creates the difference between a snapshot of the object map and its current state and prints it to std::cout.
 
static void set_count (bool flag)
 enable/disable class instances counting
 
static void write_objects_map_to (std::ostream &out, object_map_t *map=nullptr)
 output the full objects map to a given ostream
 
static void write_objects_map_to_cerr ()
 output objects map to stderr
 
- Static Public Attributes inherited from Base
static QString sPrintIndention = " "
 String used to format the debugging string output of some core classes.
 
- Protected Member Functions inherited from Object< LCDDisplay >
 ~Object ()
 
- Protected Member Functions inherited from Base
 ~Base ()
 
- Protected Member Functions inherited from Object< StatusMessageDisplay >
 ~Object ()
 
- Static Protected Member Functions inherited from Base
static void registerClass (const char *name, const atomic_obj_cpt_t *counters)
 
- Protected Attributes inherited from LCDDisplay
QSize m_size
 
- Static Protected Attributes inherited from Base
static bool __count = false
 should we count class instances
 
static timeval __last_clock = { 0, 0 }
 
static Logger__logger = nullptr
 

Detailed Description

Non-interactive display for status messages in the PlayerControl.

Shows a popup list of previous messages when clicking it.

Definition at line 32 of file StatusMessageDisplay.h.

Constructor & Destructor Documentation

◆ StatusMessageDisplay()

StatusMessageDisplay ( QWidget * pParent,
QSize size )

Definition at line 30 of file StatusMessageDisplay.cpp.

◆ ~StatusMessageDisplay()

Definition at line 56 of file StatusMessageDisplay.cpp.

Member Function Documentation

◆ displayMessage()

void displayMessage ( const QString & sMessage)
private

Definition at line 159 of file StatusMessageDisplay.cpp.

◆ enterEvent()

void enterEvent ( QEvent * ev)
overrideprivatevirtual

Definition at line 116 of file StatusMessageDisplay.cpp.

◆ leaveEvent()

void leaveEvent ( QEvent * ev)
overrideprivatevirtual

Definition at line 122 of file StatusMessageDisplay.cpp.

◆ mousePressEvent()

void mousePressEvent ( QMouseEvent * ev)
overrideprivatevirtual

Definition at line 128 of file StatusMessageDisplay.cpp.

◆ onPreferencesChanged

void onPreferencesChanged ( H2Core::Preferences::Changes changes)
slot

Definition at line 59 of file StatusMessageDisplay.cpp.

◆ onScrollTimerEvent

void onScrollTimerEvent ( )
privateslot

Definition at line 186 of file StatusMessageDisplay.cpp.

◆ onStatusTimerEvent

void onStatusTimerEvent ( )
privateslot

Definition at line 193 of file StatusMessageDisplay.cpp.

◆ paintEvent()

void paintEvent ( QPaintEvent * ev)
overrideprivatevirtual

Reimplemented from LCDDisplay.

Definition at line 90 of file StatusMessageDisplay.cpp.

◆ reset()

void reset ( )
private

Definition at line 198 of file StatusMessageDisplay.cpp.

◆ showMessage()

void showMessage ( const QString & sMessage,
const QString & sCaller = "" )

Definition at line 138 of file StatusMessageDisplay.cpp.

◆ updateMaxLength()

void updateMaxLength ( )
private

Definition at line 206 of file StatusMessageDisplay.cpp.

◆ updateStyleSheet()

void updateStyleSheet ( )
private

Definition at line 72 of file StatusMessageDisplay.cpp.

Field Documentation

◆ m_bEntered

bool m_bEntered
private

Definition at line 83 of file StatusMessageDisplay.h.

◆ m_bPreScroll

bool m_bPreScroll
private

Definition at line 75 of file StatusMessageDisplay.h.

◆ m_nHistorySize

int m_nHistorySize
private

Definition at line 77 of file StatusMessageDisplay.h.

◆ m_nPreScrollTimeout

int m_nPreScrollTimeout
private

Amount of time in milliseconds that pass before a message is being scrolled.

Important in order for the user to be able to read it properly.

Is supposed to be smaller than m_nShowTimeout.

Definition at line 74 of file StatusMessageDisplay.h.

◆ m_nScrollTimeout

int m_nScrollTimeout
private

Amount of time in milliseconds that pass between chopping characters for messages to long to display as a whole.

Is supposed to be smaller than m_nShowTimeout.

Definition at line 67 of file StatusMessageDisplay.h.

◆ m_nShowTimeout

int m_nShowTimeout
private

Amount of time in milliseconds for which the status message will be displayed.

Definition at line 61 of file StatusMessageDisplay.h.

◆ m_pScrollTimer

QTimer* m_pScrollTimer
private

Definition at line 81 of file StatusMessageDisplay.h.

◆ m_pStatusTimer

QTimer* m_pStatusTimer
private

Definition at line 80 of file StatusMessageDisplay.h.

◆ m_sLastCaller

QString m_sLastCaller
private

Definition at line 78 of file StatusMessageDisplay.h.

◆ m_sScrollMessage

QString m_sScrollMessage
private

Definition at line 57 of file StatusMessageDisplay.h.

◆ m_statusMessages

QStringList m_statusMessages
private

Definition at line 56 of file StatusMessageDisplay.h.