From 22f317da8df8c509981ca4e3f9aeb830cd4803b8 Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Wed, 13 Sep 2023 17:25:53 +0200 Subject: [PATCH] remove wonky path variable from graph export to use last directory instead; closes #121 --- src/gui_qt/graphs/graphwindow.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui_qt/graphs/graphwindow.py b/src/gui_qt/graphs/graphwindow.py index ce40d71..ad6755f 100644 --- a/src/gui_qt/graphs/graphwindow.py +++ b/src/gui_qt/graphs/graphwindow.py @@ -558,16 +558,14 @@ class QGraphWindow(QtWidgets.QGraphicsView, Ui_GraphWindow): elif other_item in self.graphic.items(): self.legend.addItem(other_item, convert(other_item.opts.get('name', ''), old='tex', new='html')) - def export_dialog(self, path=None): + def export_dialog(self, _=None): filters = 'All files (*.*);;AGR (*.agr);;SVG (*.svg);;PDF (*.pdf)' for imgformat in QtGui.QImageWriter.supportedImageFormats(): str_format = imgformat.data().decode('utf-8') filters += ';;' + str_format.upper() + ' (*.' + str_format + ')' - if path is None: - path = '' outfile = None - f = FileDialog(caption='Export graphic', directory=str(path), filter=filters, mode='save') + f = FileDialog(caption='Export graphic', filter=filters, mode='save') f.setOption(FileDialog.DontConfirmOverwrite) mode = f.exec() if mode == QtWidgets.QDialog.Accepted: