mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 22:25:53 +08:00
Add outputDevice, outputDeviceIcon properties and saveToOutputDevice slot to PrinterApplication
This commit is contained in:
parent
77f6929de4
commit
f001efde8f
@ -45,6 +45,7 @@ class PrinterApplication(QtApplication):
|
||||
self._physics = None
|
||||
self._volume = None
|
||||
self._platform = None
|
||||
self._output_source = 'local_file'
|
||||
self.activeMachineChanged.connect(self._onActiveMachineChanged)
|
||||
|
||||
def _loadPlugins(self):
|
||||
@ -257,6 +258,24 @@ class PrinterApplication(QtApplication):
|
||||
|
||||
removableDrivesChanged = pyqtSignal()
|
||||
|
||||
outputDeviceChanged = pyqtSignal()
|
||||
@pyqtProperty(str, notify = outputDeviceChanged)
|
||||
def outputDevice(self):
|
||||
return self._output_source
|
||||
|
||||
@pyqtProperty(str, notify = outputDeviceChanged)
|
||||
def outputDeviceIcon(self):
|
||||
if self._output_source == 'local_file':
|
||||
return 'save'
|
||||
elif self._output_source == 'sdcard':
|
||||
return 'save_sd'
|
||||
elif self._output_source == 'usb':
|
||||
return 'print_usb'
|
||||
|
||||
@pyqtSlot()
|
||||
def writeToOutputDevice(self):
|
||||
pass
|
||||
|
||||
@pyqtProperty("QStringList", notify = removableDrivesChanged)
|
||||
def removableDrives(self):
|
||||
return list(self.getStorageDevice('LocalFileStorage').getRemovableDrives().keys())
|
||||
|
Loading…
x
Reference in New Issue
Block a user