- fixed bug saving the FlatCAM project saying the file is used by another application
This commit is contained in:
parent
0e3a9f0795
commit
994fa65e96
|
@ -10254,13 +10254,6 @@ class App(QtCore.QObject):
|
||||||
self.inform.emit('[WARNING_NOTCL] %s' % _("Save Project cancelled."))
|
self.inform.emit('[WARNING_NOTCL] %s' % _("Save Project cancelled."))
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
|
||||||
f = open(filename, 'r')
|
|
||||||
f.close()
|
|
||||||
except IOError:
|
|
||||||
self.inform.emit('[ERROR_NOTCL] %s' % _("The object is used by another application."))
|
|
||||||
return
|
|
||||||
|
|
||||||
if use_thread is True:
|
if use_thread is True:
|
||||||
self.worker_task.emit({'fcn': self.save_project,
|
self.worker_task.emit({'fcn': self.save_project,
|
||||||
'params': [filename, quit_action]})
|
'params': [filename, quit_action]})
|
||||||
|
@ -12167,14 +12160,14 @@ class App(QtCore.QObject):
|
||||||
g = json.dumps(d, default=to_dict, indent=2, sort_keys=True).encode('utf-8')
|
g = json.dumps(d, default=to_dict, indent=2, sort_keys=True).encode('utf-8')
|
||||||
# # Write
|
# # Write
|
||||||
f.write(g)
|
f.write(g)
|
||||||
self.inform.emit('[success] %s: %s' %
|
self.inform.emit('[success] %s: %s' % (_("Project saved to"), filename))
|
||||||
(_("Project saved to"), filename))
|
|
||||||
else:
|
else:
|
||||||
# Open file
|
# Open file
|
||||||
try:
|
try:
|
||||||
f = open(filename, 'w')
|
f = open(filename, 'w')
|
||||||
except IOError:
|
except IOError:
|
||||||
App.log.error("Failed to open file for saving: %s", filename)
|
App.log.error("Failed to open file for saving: %s", filename)
|
||||||
|
self.inform.emit('[ERROR_NOTCL] %s' % _("The object is used by another application."))
|
||||||
return
|
return
|
||||||
|
|
||||||
# Write
|
# Write
|
||||||
|
@ -12188,8 +12181,7 @@ class App(QtCore.QObject):
|
||||||
except IOError:
|
except IOError:
|
||||||
if silent is False:
|
if silent is False:
|
||||||
self.inform.emit('[ERROR_NOTCL] %s: %s %s' %
|
self.inform.emit('[ERROR_NOTCL] %s: %s %s' %
|
||||||
(_("Failed to verify project file"), filename, _("Retry to save it."))
|
(_("Failed to verify project file"), filename, _("Retry to save it.")))
|
||||||
)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -12197,8 +12189,7 @@ class App(QtCore.QObject):
|
||||||
except Exception:
|
except Exception:
|
||||||
if silent is False:
|
if silent is False:
|
||||||
self.inform.emit('[ERROR_NOTCL] %s: %s %s' %
|
self.inform.emit('[ERROR_NOTCL] %s: %s %s' %
|
||||||
(_("Failed to parse saved project file"), filename, _("Retry to save it."))
|
(_("Failed to parse saved project file"), filename, _("Retry to save it.")))
|
||||||
)
|
|
||||||
f.close()
|
f.close()
|
||||||
return
|
return
|
||||||
saved_f.close()
|
saved_f.close()
|
||||||
|
@ -12209,8 +12200,7 @@ class App(QtCore.QObject):
|
||||||
(_("Project saved to"), filename))
|
(_("Project saved to"), filename))
|
||||||
else:
|
else:
|
||||||
self.inform.emit('[ERROR_NOTCL] %s: %s %s' %
|
self.inform.emit('[ERROR_NOTCL] %s: %s %s' %
|
||||||
(_("Failed to parse saved project file"), filename, _("Retry to save it."))
|
(_("Failed to parse saved project file"), filename, _("Retry to save it.")))
|
||||||
)
|
|
||||||
|
|
||||||
tb_settings = QSettings("Open Source", "FlatCAM")
|
tb_settings = QSettings("Open Source", "FlatCAM")
|
||||||
lock_state = self.ui.lock_action.isChecked()
|
lock_state = self.ui.lock_action.isChecked()
|
||||||
|
|
|
@ -20,6 +20,7 @@ CAD program, and create G-Code for Isolation routing.
|
||||||
- fixed the generate_from_geometry_2() method to use the default values in case the parameters are None
|
- fixed the generate_from_geometry_2() method to use the default values in case the parameters are None
|
||||||
- added ability to save the Source File as PDF - fixed page size and added line breaks
|
- added ability to save the Source File as PDF - fixed page size and added line breaks
|
||||||
- more mods to generate_from_geometry_2() method
|
- more mods to generate_from_geometry_2() method
|
||||||
|
- fixed bug saving the FlatCAM project saying the file is used by another application
|
||||||
|
|
||||||
16.12.2019
|
16.12.2019
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue