Skip to content

Commit

Permalink
add default folder for saving files
Browse files Browse the repository at this point in the history
  • Loading branch information
Qdelannoy committed Oct 16, 2020
1 parent 5547822 commit 5f6ce4a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions mnelab/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,17 @@ def open_file(self, f, text, ffilter="*"):

def export_file(self, f, text, ffilter="*",default_name=''):
"""Export to file."""
fname = QFileDialog.getSaveFileName(self, text, filter=ffilter)[0]


if default_name != '' :
default_name += "_"

curent_file_path = os.path.dirname(self.model.current["data"].filenames[0])
curent_file_name = self.model.current["name"]

Dialog = QFileDialog.getSaveFileName(self,text,os.path.join(curent_file_path,default_name+curent_file_name),filter=ffilter)

fname = Dialog[0]

if fname:
f(fname, ffilter)

Expand Down

0 comments on commit 5f6ce4a

Please sign in to comment.