Uranium
Application Framework
|
Class for displaying messages to the user. More...
Public Member Functions | |
def | __init__ |
Class for displaying messages to the user. More... | |
def | show |
Show the message (if not already visible) | |
def | isDismissable |
Can the message be closed by user? | |
def | setTimer |
Set the lifetime timer of the message. More... | |
def | addAction |
Add an action to the message Actions are useful for making messages that require input from the user. More... | |
def | getActions |
Get the list of actions to display buttons for on the message. More... | |
def | setText |
Changes the text on the message. More... | |
def | getText |
Returns the text in the message. More... | |
def | setMaxProgress |
Sets the maximum numerical value of the progress bar on the message. More... | |
def | getMaxProgress |
Gets the maximum value of the progress bar on the message. More... | |
def | setProgress |
Changes the state of the progress bar. More... | |
def | getProgress |
Returns the current progress. More... | |
def | hide |
Hides this message. More... | |
Static Public Attributes | |
tuple | actionTriggered = Signal() |
tuple | progressChanged = Signal() |
Signal that gets emitted whenever the state of the progress bar on this message changes. More... | |
Class for displaying messages to the user.
def UM.Message.Message.__init__ | ( | self, | |
text = "" , |
|||
lifetime = 30 , |
|||
dismissable = True , |
|||
progress = None |
|||
) |
Class for displaying messages to the user.
text | Text that needs to be displayed in the message |
lifetime | How long should the message be displayed (in seconds). if lifetime is 0, it will never automatically be destroyed. |
dismissible | Can the user dismiss the message? Is there nay progress to be displayed? if -1, it's seen as indeterminate |
def UM.Message.Message.addAction | ( | self, | |
action_id, | |||
name, | |||
icon, | |||
description | |||
) |
Add an action to the message Actions are useful for making messages that require input from the user.
action_id | |
name | The displayed name of the action |
icon | Source of the icon to be used |
description | Description of the item (used for mouse over, etc) |
def UM.Message.Message.getActions | ( | self | ) |
Get the list of actions to display buttons for on the message.
Each action is a dictionary with the elements provided in addAction
.
def UM.Message.Message.getMaxProgress | ( | self | ) |
Gets the maximum value of the progress bar on the message.
Note that this is not the current value of the progress bar!
def UM.Message.Message.getProgress | ( | self | ) |
Returns the current progress.
This should be a value between 0 and the value of getMaxProgress()
.
def UM.Message.Message.getText | ( | self | ) |
Returns the text in the message.
def UM.Message.Message.hide | ( | self | ) |
Hides this message.
While the message object continues to exist in memory, it appears to the user that it is gone.
def UM.Message.Message.setMaxProgress | ( | self, | |
max_progress | |||
) |
Sets the maximum numerical value of the progress bar on the message.
If the reported progress hits this number, the bar will appear filled.
def UM.Message.Message.setProgress | ( | self, | |
progress | |||
) |
Changes the state of the progress bar.
progress | The new progress to display to the user. This should be between 0 and the value of getMaxProgress() . |
def UM.Message.Message.setText | ( | self, | |
text | |||
) |
Changes the text on the message.
text | The new text for the message. Please ensure that this text is internationalised. |
def UM.Message.Message.setTimer | ( | self, | |
timer | |||
) |
Set the lifetime timer of the message.
This is used by the QT application once the message is shown. If the lifetime is set to 0, no timer is added.
|
static |
Signal that gets emitted whenever the state of the progress bar on this message changes.