From 684882455773f410e07c0dd16977e5696edaf6ce Mon Sep 17 00:00:00 2001 From: Jan Kotanski Date: Sun, 3 Nov 2019 06:00:06 +0100 Subject: [PATCH] add bookkeeping exporter parameters (#1023) --- pyqtgraph/GraphicsScene/exportDialog.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pyqtgraph/GraphicsScene/exportDialog.py b/pyqtgraph/GraphicsScene/exportDialog.py index 8085c5bf..045698fe 100644 --- a/pyqtgraph/GraphicsScene/exportDialog.py +++ b/pyqtgraph/GraphicsScene/exportDialog.py @@ -23,6 +23,8 @@ class ExportDialog(QtGui.QWidget): self.currentExporter = None self.scene = scene + self.exporterParameters = {} + self.selectBox = QtGui.QGraphicsRectItem() self.selectBox.setPen(fn.mkPen('y', width=3, style=QtCore.Qt.DashLine)) self.selectBox.hide() @@ -121,7 +123,18 @@ class ExportDialog(QtGui.QWidget): return expClass = self.exporterClasses[str(item.text())] exp = expClass(item=self.ui.itemTree.currentItem().gitem) - params = exp.parameters() + + if prev: + oldtext = str(prev.text()) + self.exporterParameters[oldtext] = self.currentExporter.parameters() + newtext = str(item.text()) + if newtext in self.exporterParameters.keys(): + params = self.exporterParameters[newtext] + exp.params = params + else: + params = exp.parameters() + self.exporterParameters[newtext] = params + if params is None: self.ui.paramTree.clear() else: