A handle to a optionally dismissable message in the UI.
More...
#include <dismissablemessagecontext.h>
Inherits QObject.
A handle to a optionally dismissable message in the UI.
Helper which holds and updates the state of some kind of message in the UI which is dismissable, optionally even persistently with a "don't show
again" link. The dismissed state is just a bool
hold in this class while the "don't show again" feature is implemented with librepcb::WorkspaceSettings::dismissedMessages and is therefore only available if a librepcb::Workspace is set.
◆ DismissableMessageContext() [1/3]
Constructor for a message without the "don't show again" feature.
Allows only temporary dismissing, but not permanently.
- Parameters
-
active | Whether the message should currently be shown or not. |
parent | Parent object. |
◆ DismissableMessageContext() [2/3]
Constructor for a message with the "don't show again" feature.
Allows both, temporary or permanently dismissing the message.
- Parameters
-
workspace | The workspace to use for the persistent settings. |
dismissKey | The unique identifier for this message, see details at librepcb::WorkspaceSettings::dismissedMessages. |
active | Whether the message should currently be shown or not. |
parent | Parent object. |
◆ DismissableMessageContext() [3/3]
◆ ~DismissableMessageContext()
◆ getUiData()
ui::DismissableMessageData getUiData |
( |
| ) |
const |
|
noexcept |
Get UI data.
- Returns
- UI data.
◆ setUiData()
void setUiData |
( |
const ui::DismissableMessageData & |
data | ) |
|
|
noexcept |
◆ setActive()
void setActive |
( |
bool |
active | ) |
|
|
noexcept |
Set whether the message should be shown (if not dismissed) or not.
The widget will be visible only if true
is passed and the message was not dismissed.
- Parameters
-
active | Whether the message should currently be shown or not. |
◆ dismiss()
Dismiss (hide) the message temporarily.
◆ dontShowAgain()
Dismiss (hide) the message persistently.
◆ isVisible()
Get whether the message shall currently be visible or not.
- Return values
-
true | Message shall be visible. |
false | Message shall be hidden. |
◆ operator=()
◆ visibilityChanged
void visibilityChanged |
( |
bool |
visible | ) |
|
|
signal |
◆ trigger()
void trigger |
( |
ui::DismissableMessageAction |
a | ) |
|
|
privatenoexcept |
◆ dismissedMessagesModified()
void dismissedMessagesModified |
( |
| ) |
|
|
privatenoexcept |
◆ updateVisibility()
void updateVisibility |
( |
| ) |
|
|
privatenoexcept |
◆ mWorkspace
◆ mDismissKey
const QString mDismissKey |
|
private |
◆ mActive
◆ mTemporarilyHidden
◆ mVisible
The documentation for this class was generated from the following files: