UserMsg Pile
version 0.0.1
UserMsg pile.
|
brief description More...
#include <usermsgman.h>
Public Types | |
typedef void(* | KbShowMessage) (const UserMsg &um) |
the calback that may be used to be informed about messages | |
Signals | |
void | signalShow (UserMsg um) |
A message should be shown. | |
Static Public Member Functions | |
static UserMsgMan * | singleton () |
Get the singleton. | |
static bool | init (bool start_disabled=false) |
Prepares the manager for being used. More... | |
static void | end () |
Terminates the manager (releases resources). More... | |
static bool | isInitialized () |
Tells if the manager has been initialized. More... | |
static const UserMsgStg & | settings () |
Get the settings. More... | |
static void | setSettings (const UserMsgStg &value) |
Copy the settings to internal storage. | |
static KbShowMessage | callbackShow () |
Get the callback. | |
static void | setCallbackShow (KbShowMessage value) |
Copy the settings to internal storage. | |
static const QString & | logFile () |
The path to the log file. | |
static void | setLogFile (const QString &value) |
Set the path to the log file. | |
static void | autosetLogFile (const QString &base_name) |
Give me the base name for log file and let me do the rest. | |
static void | disable () |
Sets the cache mode; no messages are being shown. | |
static void | enable (bool collapse_messages=false) |
Exist cached mode; cached messages are being shown. | |
static bool | isEnabled () |
Tells if the manager is in cached mode (false). | |
static bool | isVisible (UserMsgEntry::Type value) |
tells if a type is visible or not | |
static void | setVisible (UserMsgEntry::Type ty, bool b_visible) |
enables or disables the visibility of a type | |
static void | setAllVisible (bool include_debug) |
Enable all types (make them visible). | |
static void | show (const UserMsg &um) |
Shows an error message. More... | |
Protected Member Functions | |
void | _addMessageToQueue (const UserMsg &um) |
Appends the message to the queue. More... | |
void | _showMessage (const UserMsg &um) |
Shows an error message. More... | |
void | _showQueue (bool collapse_messages) |
Presents the queue to the user. More... | |
void | _openLogFile () |
Prepares the log file to be used. More... | |
void | _logMessage (const UserMsg &um) |
Log the message. More... | |
Static Protected Member Functions | |
static void | autostart () |
used internally to start the manager if not started already | |
Friends | |
class | LogMsg |
brief description
A singleton is created internally and it manages the settings and behaviour of UserMsg.
The manager can be explicitly initialized but it does not have to. Any static function that will be invoked will first check for its existance and it will create it if it does not exist.
Resources can be freed using UserMsgMan::end(), for example at the end of the application.
Initial state for the manager is enabled; to start in disabled state use
at the beginning of your application.
|
protected |
Appends the message to the queue.
|
protected |
Log the message.
If log is available logs the message, otherwise does nothing.
|
protected |
Prepares the log file to be used.
|
protected |
Shows an error message.
Presents a message to the user.
|
protected |
Presents the queue to the user.
|
static |
Terminates the manager (releases resources).
If the singleton exists is being destroyed.
|
static |
Prepares the manager for being used.
A new instance is only created if the singleton is NULL.
|
static |
Tells if the manager has been initialized.
This is the only static function that will not create the singleton
|
static |
Get the settings.
|
static |
Shows an error message.
Presents a message to the user.