Skip to content

Commit

Permalink
Added a simple check so cancelling the dialog doesn't throw. #1551
Browse files Browse the repository at this point in the history
  • Loading branch information
rozyczko committed Feb 1, 2022
1 parent 886b871 commit f485cab
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -3913,20 +3913,20 @@ def onCopyToClipboard(self, format=None):
}
file_path = save_dialog.getSaveFileName(**kwargs)
filename = file_path[0]

if file_path[1] == 'Text (*.txt)':
Type_output = Text_output
filename = '.'.join((filename, 'txt'))
elif file_path[1] == 'Excel (*.xls)':
Type_output = Excel_output
filename = '.'.join((filename, 'xls'))
elif file_path[1] == 'Latex (*.log)':
Type_output = Latex_output
filename = '.'.join((filename, 'log'))

file_open = open(filename, 'w')
with file_open:
file_open.write(Type_output)
if filename:
if file_path[1] == 'Text (*.txt)':
Type_output = Text_output
filename = '.'.join((filename, 'txt'))
elif file_path[1] == 'Excel (*.xls)':
Type_output = Excel_output
filename = '.'.join((filename, 'xls'))
elif file_path[1] == 'Latex (*.log)':
Type_output = Latex_output
filename = '.'.join((filename, 'log'))

file_open = open(filename, 'w')
with file_open:
file_open.write(Type_output)
else:
cb = QtWidgets.QApplication.clipboard()
cb.setText(formatted_output)
Expand Down

0 comments on commit f485cab

Please sign in to comment.