- when applying a new language if there are any changes in the current project, the app will offer to save the project before the reboot

This commit is contained in:
Marius Stanciu 2019-08-05 01:15:19 +03:00
parent afdff59aff
commit 3d54932713
2 changed files with 18 additions and 0 deletions

View File

@ -159,6 +159,23 @@ def restart_program(app):
Note: this function does not return. Any cleanup action (like
saving data) must be done before calling this function.
"""
if app.should_we_save and app.collection.get_list():
msgbox = QtWidgets.QMessageBox()
msgbox.setText(_("There are files/objects modified in FlatCAM. "
"\n"
"Do you want to Save the project?"))
msgbox.setWindowTitle(_("Save changes"))
msgbox.setWindowIcon(QtGui.QIcon('share/save_as.png'))
bt_yes = msgbox.addButton(_('Yes'), QtWidgets.QMessageBox.YesRole)
bt_no = msgbox.addButton(_('No'), QtWidgets.QMessageBox.NoRole)
msgbox.setDefaultButton(bt_yes)
msgbox.exec_()
response = msgbox.clickedButton()
if response == bt_yes:
app.on_file_saveprojectas(thread=True, quit=True)
app.save_defaults()
python = sys.executable
os.execl(python, python, *sys.argv)

View File

@ -13,6 +13,7 @@ CAD program, and create G-Code for Isolation routing.
- made sure that if using an negative Gerber isolation diameter, the resulting Geometry object will use a tool with positive diameter
- fixed bug that when isolating a Gerber file made out of a single polygon, an Recurrsion Exception was issued together with inability to create tbe isolation
- when applying a new language if there are any changes in the current project, the app will offer to save the project before the reboot
3.08.2019