remove wonky path variable from graph export to use last directory instead; closes #121

This commit is contained in:
Dominik Demuth 2023-09-13 17:25:53 +02:00
parent 24b56cbd2a
commit 22f317da8d

View File

@ -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: