mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 23:46:22 -06:00
Printer can now actually be linked
CURA-336
This commit is contained in:
parent
3b51c31772
commit
bb9d3a47ef
3 changed files with 34 additions and 2 deletions
|
@ -30,3 +30,12 @@ class DiscoverUM3Action(MachineAction):
|
|||
return [printers[printer] for printer in printers]
|
||||
else:
|
||||
return []
|
||||
|
||||
@pyqtSlot(str)
|
||||
def setKey(self, key):
|
||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if global_container_stack:
|
||||
if "key" in global_container_stack.getMetaData():
|
||||
global_container_stack.setMetaDataEntry("key", key)
|
||||
else:
|
||||
global_container_stack.addMetaDataEntry("key", key)
|
||||
|
|
|
@ -145,4 +145,26 @@ Cura.MachineAction
|
|||
}
|
||||
}
|
||||
}
|
||||
Button
|
||||
{
|
||||
text: catalog.i18nc("@action:button", "Ok")
|
||||
anchors.right: cancelButton.left
|
||||
anchors.bottom: parent.bottom
|
||||
onClicked:
|
||||
{
|
||||
manager.setKey(base.selectedPrinter.getKey())
|
||||
completed()
|
||||
}
|
||||
}
|
||||
Button
|
||||
{
|
||||
id: cancelButton
|
||||
text: catalog.i18nc("@action:button", "Cancel")
|
||||
anchors.right: discoverUM3Action.right
|
||||
anchors.bottom: parent.bottom
|
||||
onClicked:
|
||||
{
|
||||
completed()
|
||||
}
|
||||
}
|
||||
}
|
|
@ -8,8 +8,8 @@ from UM.Message import Message
|
|||
from cura.PrinterOutputDevice import PrinterOutputDevice, ConnectionState
|
||||
|
||||
from PyQt5.QtNetwork import QHttpMultiPart, QHttpPart, QNetworkRequest, QNetworkAccessManager
|
||||
from PyQt5.QtCore import QUrl, QTimer, pyqtSignal, pyqtProperty
|
||||
from PyQt5.QtGui import QPixmap, QImage
|
||||
from PyQt5.QtCore import QUrl, QTimer, pyqtSignal, pyqtProperty, pyqtSlot
|
||||
from PyQt5.QtGui import QImage
|
||||
|
||||
import json
|
||||
|
||||
|
@ -89,6 +89,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
|
||||
## Get the unique key of this machine
|
||||
# \return key String containing the key of the machine.
|
||||
@pyqtSlot(result = str)
|
||||
def getKey(self):
|
||||
return self._key
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue