Parcourir la source

- more update s on project save choice

Marius Stanciu il y a 7 ans
Parent
commit
33b722aa1a
2 fichiers modifiés avec 15 ajouts et 0 suppressions
  1. 14 0
      FlatCAMApp.py
  2. 1 0
      flatcamTools/ToolCutOut.py

+ 14 - 0
FlatCAMApp.py

@@ -2403,6 +2403,7 @@ class App(QtCore.QObject):
         log.debug("Object changed, updating the bounding box data on self.options")
         log.debug("Object changed, updating the bounding box data on self.options")
         # delete the old selection shape
         # delete the old selection shape
         self.delete_selection_shape()
         self.delete_selection_shape()
+        self.should_we_save = True
 
 
     def on_object_plotted(self, obj):
     def on_object_plotted(self, obj):
         self.on_zoom_fit(None)
         self.on_zoom_fit(None)
@@ -2730,6 +2731,8 @@ class App(QtCore.QObject):
                     v['data']['name'] = obj_name_single
                     v['data']['name'] = obj_name_single
             self.new_object("geometry", obj_name_single, initialize)
             self.new_object("geometry", obj_name_single, initialize)
 
 
+        self.should_we_save = True
+
     def on_edit_join_exc(self):
     def on_edit_join_exc(self):
         """
         """
         Callback for Edit->Join Excellon. Joins the selected excellon objects into
         Callback for Edit->Join Excellon. Joins the selected excellon objects into
@@ -2750,6 +2753,7 @@ class App(QtCore.QObject):
             FlatCAMExcellon.merge(objs, obj)
             FlatCAMExcellon.merge(objs, obj)
 
 
         self.new_object("excellon", 'Combo_Excellon', initialize)
         self.new_object("excellon", 'Combo_Excellon', initialize)
+        self.should_we_save = True
 
 
     def on_edit_join_grb(self):
     def on_edit_join_grb(self):
         """
         """
@@ -2771,6 +2775,7 @@ class App(QtCore.QObject):
             FlatCAMGerber.merge(objs, obj)
             FlatCAMGerber.merge(objs, obj)
 
 
         self.new_object("gerber", 'Combo_Gerber', initialize)
         self.new_object("gerber", 'Combo_Gerber', initialize)
+        self.should_we_save = True
 
 
     def on_convert_singlegeo_to_multigeo(self):
     def on_convert_singlegeo_to_multigeo(self):
         self.report_usage("on_convert_singlegeo_to_multigeo()")
         self.report_usage("on_convert_singlegeo_to_multigeo()")
@@ -2793,6 +2798,8 @@ class App(QtCore.QObject):
         obj.solid_geometry[:] = []
         obj.solid_geometry[:] = []
         obj.plot()
         obj.plot()
 
 
+        self.should_we_save = True
+
         self.inform.emit("[success] A Geometry object was converted to MultiGeo type.")
         self.inform.emit("[success] A Geometry object was converted to MultiGeo type.")
 
 
     def on_convert_multigeo_to_singlegeo(self):
     def on_convert_multigeo_to_singlegeo(self):
@@ -2817,6 +2824,8 @@ class App(QtCore.QObject):
         obj.solid_geometry = deepcopy(total_solid_geometry)
         obj.solid_geometry = deepcopy(total_solid_geometry)
         obj.plot()
         obj.plot()
 
 
+        self.should_we_save = True
+
         self.inform.emit("[success] A Geometry object was converted to SingleGeo type.")
         self.inform.emit("[success] A Geometry object was converted to SingleGeo type.")
 
 
     def on_options_dict_change(self, field):
     def on_options_dict_change(self, field):
@@ -2900,6 +2909,8 @@ class App(QtCore.QObject):
             scale_options(factor)
             scale_options(factor)
             self.options_write_form()
             self.options_write_form()
 
 
+            self.should_we_save = True
+
             # change this only if the workspace is active
             # change this only if the workspace is active
             if self.defaults['global_workspace'] is True:
             if self.defaults['global_workspace'] is True:
                 self.plotcanvas.draw_workspace()
                 self.plotcanvas.draw_workspace()
@@ -3856,6 +3867,7 @@ class App(QtCore.QObject):
             self.plot_all(zoom=False)
             self.plot_all(zoom=False)
             self.inform.emit('[success] Origin set ...')
             self.inform.emit('[success] Origin set ...')
             self.plotcanvas.vis_disconnect('mouse_press', self.on_set_zero_click)
             self.plotcanvas.vis_disconnect('mouse_press', self.on_set_zero_click)
+            self.should_we_save = True
 
 
     def on_selectall(self):
     def on_selectall(self):
         self.report_usage("on_selectall()")
         self.report_usage("on_selectall()")
@@ -3916,6 +3928,7 @@ class App(QtCore.QObject):
                     obj.mirror('X', [px, py])
                     obj.mirror('X', [px, py])
                     obj.plot()
                     obj.plot()
                     self.object_changed.emit(obj)
                     self.object_changed.emit(obj)
+
             except Exception as e:
             except Exception as e:
                 self.inform.emit("[ERROR_NOTCL] Due of %s, Flip action was not executed." % str(e))
                 self.inform.emit("[ERROR_NOTCL] Due of %s, Flip action was not executed." % str(e))
                 return
                 return
@@ -3955,6 +3968,7 @@ class App(QtCore.QObject):
                     obj.mirror('Y', [px, py])
                     obj.mirror('Y', [px, py])
                     obj.plot()
                     obj.plot()
                     self.object_changed.emit(obj)
                     self.object_changed.emit(obj)
+
             except Exception as e:
             except Exception as e:
                 self.inform.emit("[ERROR_NOTCL] Due of %s, Flip action was not executed." % str(e))
                 self.inform.emit("[ERROR_NOTCL] Due of %s, Flip action was not executed." % str(e))
                 return
                 return

+ 1 - 0
flatcamTools/ToolCutOut.py

@@ -359,6 +359,7 @@ class ToolCutOut(FlatCAMTool):
         cutout_obj.plot()
         cutout_obj.plot()
         self.app.inform.emit("[success] Any form CutOut operation finished.")
         self.app.inform.emit("[success] Any form CutOut operation finished.")
         self.app.ui.notebook.setCurrentWidget(self.app.ui.project_tab)
         self.app.ui.notebook.setCurrentWidget(self.app.ui.project_tab)
+        self.should_we_save = True
 
 
     def on_rectangular_cutout(self):
     def on_rectangular_cutout(self):
         name = self.obj_combo.currentText()
         name = self.obj_combo.currentText()