From f001efde8f7e2479913061db96c0bd8e1b5de310 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Fri, 3 Apr 2015 18:03:30 +0200 Subject: [PATCH] Add outputDevice, outputDeviceIcon properties and saveToOutputDevice slot to PrinterApplication --- PrinterApplication.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/PrinterApplication.py b/PrinterApplication.py index 7589c4763c..57a273c067 100644 --- a/PrinterApplication.py +++ b/PrinterApplication.py @@ -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())