- when saving a file from Code Editor and there is no object active then the OpenFileDialog filters are reset to FlatConfig files.

This commit is contained in:
Marius Stanciu 2019-02-23 20:39:38 +02:00 committed by Marius S
parent 88c9001784
commit 14dc34a18c
2 changed files with 10 additions and 6 deletions

View File

@ -3661,6 +3661,13 @@ class App(QtCore.QObject):
def handleSaveGCode(self, signal, name=None, filt=None):
self.report_usage("handleSaveGCode()")
if filt:
_filter_ = filt
else:
_filter_ = "G-Code Files (*.nc);; G-Code Files (*.txt);; G-Code Files (*.tap);; G-Code Files (*.cnc);; " \
"All Files (*.*)"
if name:
obj_name = name
else:
@ -3668,12 +3675,8 @@ class App(QtCore.QObject):
obj_name = self.collection.get_active().options['name']
except AttributeError:
obj_name = 'file'
_filter_ = "FlatConfig Files (*.FlatConfig);;All Files (*.*)"
if filt:
_filter_ = filt
else:
_filter_ = " G-Code Files (*.nc);; G-Code Files (*.txt);; G-Code Files (*.tap);; G-Code Files (*.cnc);; " \
"All Files (*.*)"
try:
filename = str(QtWidgets.QFileDialog.getSaveFileName(
caption="Export G-Code ...",
@ -3684,7 +3687,7 @@ class App(QtCore.QObject):
filename = str(QtWidgets.QFileDialog.getSaveFileName(caption="Export G-Code ...", filter=_filter_)[0])
if filename == "":
self.inform.emit("[WARNING_NOTCL]Export CNC Code cancelled.")
self.inform.emit("[WARNING_NOTCL]Export Code cancelled.")
return
else:
try:

View File

@ -16,6 +16,7 @@ CAD program, and create G-Code for Isolation routing.
- added a Toggle Code Editor Menu and key shortcut
- added the ability to open FlatConfig configuration files in COde Editor, Modify them and then save them.
- added ability to double click the FlatConfig files and open them in the FlatCAM Code Editor (to be verified)
- when saving a file from Code Editor and there is no object active then the OpenFileDialog filters are reset to FlatConfig files.
23.02.2019