mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 15:44:04 -06:00
Move cloud flow message to correct folder
This commit is contained in:
parent
11ef53905b
commit
669e64afdb
2 changed files with 1 additions and 1 deletions
41
plugins/UM3NetworkPrinting/src/Messages/CloudFlowMessage.py
Normal file
41
plugins/UM3NetworkPrinting/src/Messages/CloudFlowMessage.py
Normal file
|
@ -0,0 +1,41 @@
|
|||
# Copyright (c) 2019 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
import os
|
||||
|
||||
from PyQt5.QtCore import QUrl
|
||||
from PyQt5.QtGui import QDesktopServices
|
||||
|
||||
from UM import i18nCatalog
|
||||
from UM.Message import Message
|
||||
from cura.CuraApplication import CuraApplication
|
||||
|
||||
|
||||
I18N_CATALOG = i18nCatalog("cura")
|
||||
|
||||
|
||||
class CloudFlowMessage(Message):
|
||||
|
||||
def __init__(self, address: str) -> None:
|
||||
|
||||
image_path = os.path.join(
|
||||
CuraApplication.getInstance().getPluginRegistry().getPluginPath("UM3NetworkPrinting") or "",
|
||||
"resources", "svg", "cloud-flow-start.svg"
|
||||
)
|
||||
|
||||
super().__init__(
|
||||
text=I18N_CATALOG.i18nc("@info:status",
|
||||
"Send and monitor print jobs from anywhere using your Ultimaker account."),
|
||||
lifetime=0,
|
||||
dismissable=True,
|
||||
option_state=False,
|
||||
image_source=image_path,
|
||||
image_caption=I18N_CATALOG.i18nc("@info:status Ultimaker Cloud should not be translated.",
|
||||
"Connect to Ultimaker Cloud"),
|
||||
)
|
||||
self._address = address
|
||||
self.addAction("", I18N_CATALOG.i18nc("@action", "Get started"), "", "")
|
||||
self.actionTriggered.connect(self._onCloudFlowStarted)
|
||||
|
||||
def _onCloudFlowStarted(self, messageId: str, actionId: str) -> None:
|
||||
QDesktopServices.openUrl(QUrl("http://{}/cloud_connect".format(self._address)))
|
||||
self.hide()
|
Loading…
Add table
Add a link
Reference in a new issue