mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-22 22:23:57 -06:00
Swap text and title for message.
Move link opening code into the PrintJobAwaitingApprovalMessage.py CURA-9221
This commit is contained in:
parent
9b20a1b37f
commit
1a023f7285
3 changed files with 21 additions and 14 deletions
|
@ -1,5 +1,8 @@
|
|||
# Copyright (c) 2022 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
from PyQt6.QtCore import QUrl
|
||||
from PyQt6.QtGui import QDesktopServices
|
||||
|
||||
from UM import i18nCatalog
|
||||
from UM.Message import Message
|
||||
|
||||
|
@ -12,14 +15,19 @@ class PrintJobPendingApprovalMessage(Message):
|
|||
|
||||
def __init__(self) -> None:
|
||||
super().__init__(
|
||||
text = I18N_CATALOG.i18nc("@info:status", "The print job was succesfully submitted"),
|
||||
title=I18N_CATALOG.i18nc("@info:title", "You will recieve a confirmation via email when the print job is approved"),
|
||||
text = I18N_CATALOG.i18nc("@info:status", "You will receive a confirmation via email when the print job is approved"),
|
||||
title=I18N_CATALOG.i18nc("@info:title", "The print job was successfully submitted"),
|
||||
message_type=Message.MessageType.POSITIVE
|
||||
)
|
||||
self.self.addAction("learn_more",
|
||||
I18N_CATALOG.i18nc("@action", "Learn more"),
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
button_style = Message.ActionButtonStyle.LINK,
|
||||
button_align = Message.ActionButtonAlignment.ALIGN_LEFT)
|
||||
self.addAction("manage_print_jobs", I18N_CATALOG.i18nc("@action", "Manage print jobs"), "", "")
|
||||
|
||||
self.addAction("learn_more", I18N_CATALOG.i18nc("@action", "Learn more"), "", "",
|
||||
button_style = Message.ActionButtonStyle.LINK,
|
||||
button_align = Message.ActionButtonAlignment.ALIGN_LEFT)
|
||||
|
||||
self.actionTriggered.connect(self._onActionTriggered)
|
||||
|
||||
def _onActionTriggered(self, message: Message, action: str):
|
||||
""" Callback function for the "Manage print jobs" button on the pending approval notification. """
|
||||
if action == "manage_print_jobs":
|
||||
QDesktopServices.openUrl(QUrl("https://ultimaker.com/"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue