diff --git a/FlatCAMTranslation.py b/FlatCAMTranslation.py index f51829eb..ce40148a 100644 --- a/FlatCAMTranslation.py +++ b/FlatCAMTranslation.py @@ -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) diff --git a/README.md b/README.md index 2f489fea..60359f5e 100644 --- a/README.md +++ b/README.md @@ -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