mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-28 13:21:10 -07:00
Re-add the CloudSync functionality
It got removed in the marketplace upgrade. CURA-9146
This commit is contained in:
parent
5a62278097
commit
5ce5ce769e
14 changed files with 1147 additions and 2 deletions
32
plugins/Marketplace/CloudSync/RestartApplicationPresenter.py
Normal file
32
plugins/Marketplace/CloudSync/RestartApplicationPresenter.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
from UM import i18nCatalog
|
||||
from UM.Message import Message
|
||||
from cura.CuraApplication import CuraApplication
|
||||
|
||||
|
||||
class RestartApplicationPresenter:
|
||||
"""Presents a dialog telling the user that a restart is required to apply changes
|
||||
|
||||
Since we cannot restart Cura, the app is closed instead when the button is clicked
|
||||
"""
|
||||
def __init__(self, app: CuraApplication) -> None:
|
||||
self._app = app
|
||||
self._i18n_catalog = i18nCatalog("cura")
|
||||
|
||||
def present(self) -> None:
|
||||
app_name = self._app.getApplicationDisplayName()
|
||||
|
||||
message = Message(self._i18n_catalog.i18nc("@info:generic",
|
||||
"You need to quit and restart {} before changes have effect.",
|
||||
app_name))
|
||||
|
||||
message.addAction("quit",
|
||||
name="Quit " + app_name,
|
||||
icon = "",
|
||||
description="Close the application",
|
||||
button_align=Message.ActionButtonAlignment.ALIGN_RIGHT)
|
||||
|
||||
message.actionTriggered.connect(self._quitClicked)
|
||||
message.show()
|
||||
|
||||
def _quitClicked(self, *_):
|
||||
self._app.windowClosed()
|
||||
Loading…
Add table
Add a link
Reference in a new issue