12 # Original Copyright (C) 2016 by Kevin Kofler <kevin.kofler@chello.at> |
12 # Original Copyright (C) 2016 by Kevin Kofler <kevin.kofler@chello.at> |
13 # |
13 # |
14 |
14 |
15 from __future__ import unicode_literals |
15 from __future__ import unicode_literals |
16 |
16 |
17 from PyQt5.QtCore import qVersion, QFile, QStandardPaths, QProcess |
17 from PyQt5.QtCore import QFile, QStandardPaths, QProcess |
18 from PyQt5.QtPrintSupport import QPrinter, QPrintEngine |
18 from PyQt5.QtPrintSupport import QPrinter, QPrintEngine |
19 |
19 |
20 import Globals |
20 import Globals |
|
21 from Globals import qVersionTuple |
21 |
22 |
22 |
23 |
23 _FilePrintJobs = [] |
24 _FilePrintJobs = [] |
24 |
25 |
25 |
26 |
169 printer, fileDeletePolicy, pageSelectPolicy, useCupsOptions, |
170 printer, fileDeletePolicy, pageSelectPolicy, useCupsOptions, |
170 pageRange, exe) |
171 pageRange, exe) |
171 argsList.append(fileName) |
172 argsList.append(fileName) |
172 |
173 |
173 self.__process = QProcess() |
174 self.__process = QProcess() |
174 if qVersion() < "5.6.0": |
175 if qVersionTuple() < (5, 6, 0): |
175 self.__process.error.connect(self.__processError) |
176 self.__process.error.connect(self.__processError) |
176 else: |
177 else: |
177 self.__process.errorOccurred.connect(self.__processError) |
178 self.__process.errorOccurred.connect(self.__processError) |
178 self.__process.finished.connect(self.__processFinished) |
179 self.__process.finished.connect(self.__processFinished) |
179 self.__process.start(exe, argsList) |
180 self.__process.start(exe, argsList) |