diff --git a/ObjectCollection.py b/ObjectCollection.py index 81fdb011..3e5ef4de 100644 --- a/ObjectCollection.py +++ b/ObjectCollection.py @@ -318,7 +318,7 @@ class ObjectCollection(QtCore.QAbstractItemModel): for obj in self.get_selected(): if type(obj) != FlatCAMGeometry: self.app.ui.menuprojectgeneratecnc.setVisible(False) - if type(obj) != FlatCAMGeometry and type(obj) != FlatCAMExcellon: + if type(obj) != FlatCAMGeometry and type(obj) != FlatCAMExcellon and type(obj) != FlatCAMGerber: self.app.ui.menuprojectedit.setVisible(False) if type(obj) != FlatCAMGerber and type(obj) != FlatCAMExcellon: self.app.ui.menuprojectviewsource.setVisible(False) diff --git a/README.md b/README.md index 6d61b60d..f3fe4fb9 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,11 @@ CAD program, and create G-Code for Isolation routing. - added a new parameter in NCC tool named offset. If the offset is used then the copper clearing will finish to a set distance of the copper features - fixed bugs in Geometry Editor - added protection's against the 'bowtie' geometries for Subtract Tool in Geometry Editor -- added all the tool from Geometry Editor to the the contextual menu +- added all the tools from Geometry Editor to the the contextual menu - fixed bug in Add Text Tool in Geometry Editor that gave error when clicking to place text without having text in the box +- added all the tools from Gerber Editor to the the contextual menu +- added the menu entry "Edit" in the Project contextual menu for Gerber objects + 12.08.2019 diff --git a/flatcamEditors/FlatCAMGrbEditor.py b/flatcamEditors/FlatCAMGrbEditor.py index ad6f9b4e..b493e42a 100644 --- a/flatcamEditors/FlatCAMGrbEditor.py +++ b/flatcamEditors/FlatCAMGrbEditor.py @@ -3474,6 +3474,16 @@ class FlatCAMGrbEditor(QtCore.QObject): self.app.ui.grb_draw_track.triggered.connect(self.on_track_add) self.app.ui.grb_draw_region.triggered.connect(self.on_region_add) + self.app.ui.grb_draw_poligonize.triggered.connect(self.on_poligonize) + self.app.ui.grb_draw_semidisc.triggered.connect(self.on_add_semidisc) + self.app.ui.grb_draw_disc.triggered.connect(self.on_disc_add) + self.app.ui.grb_draw_buffer.triggered.connect(lambda: self.select_tool("buffer")) + self.app.ui.grb_draw_scale.triggered.connect(lambda: self.select_tool("scale")) + self.app.ui.grb_draw_markarea.triggered.connect(lambda: self.select_tool("markarea")) + self.app.ui.grb_draw_eraser.triggered.connect(self.on_eraser) + self.app.ui.grb_draw_transformations.triggered.connect(self.on_transform) + + def disconnect_canvas_event_handlers(self): # we restore the key and mouse control to FlatCAMApp method @@ -3530,6 +3540,39 @@ class FlatCAMGrbEditor(QtCore.QObject): except (TypeError, AttributeError): pass + try: + self.app.ui.grb_draw_poligonize.triggered.disconnect(self.on_poligonize) + except (TypeError, AttributeError): + pass + try: + self.app.ui.grb_draw_semidisc.triggered.diconnect(self.on_add_semidisc) + except (TypeError, AttributeError): + pass + try: + self.app.ui.grb_draw_disc.triggered.disconnect(self.on_disc_add) + except (TypeError, AttributeError): + pass + try: + self.app.ui.grb_draw_buffer.triggered.disconnect() + except (TypeError, AttributeError): + pass + try: + self.app.ui.grb_draw_scale.triggered.disconnect() + except (TypeError, AttributeError): + pass + try: + self.app.ui.grb_draw_markarea.triggered.disconnect() + except (TypeError, AttributeError): + pass + try: + self.app.ui.grb_draw_eraser.triggered.disconnect(self.on_eraser) + except (TypeError, AttributeError): + pass + try: + self.app.ui.grb_draw_transformations.triggered.disconnect(self.on_transform) + except (TypeError, AttributeError): + pass + def clear(self): self.active_tool = None self.selected = [] diff --git a/flatcamGUI/FlatCAMGUI.py b/flatcamGUI/FlatCAMGUI.py index b4e14bd4..a5add0d3 100644 --- a/flatcamGUI/FlatCAMGUI.py +++ b/flatcamGUI/FlatCAMGUI.py @@ -1635,8 +1635,23 @@ class FlatCAMGUI(QtWidgets.QMainWindow): self.grb_editor_cmenu = self.popMenu.addMenu(QtGui.QIcon('share/draw32.png'), _("Gerber Editor")) self.grb_draw_pad = self.grb_editor_cmenu.addAction(QtGui.QIcon('share/aperture32.png'), _("Pad")) self.grb_draw_pad_array = self.grb_editor_cmenu.addAction(QtGui.QIcon('share/padarray32.png'), _("Pad Array")) + self.grb_editor_cmenu.addSeparator() + self.grb_draw_track = self.grb_editor_cmenu.addAction(QtGui.QIcon('share/track32.png'), _("Track")) self.grb_draw_region = self.grb_editor_cmenu.addAction(QtGui.QIcon('share/polygon32.png'), _("Region")) + self.grb_draw_poligonize = self.grb_editor_cmenu.addAction(QtGui.QIcon('share/poligonize32.png'), _("Poligonize")) + self.grb_draw_semidisc = self.grb_editor_cmenu.addAction(QtGui.QIcon('share/semidisc32.png'), _("SemiDisc")) + self.grb_draw_disc = self.grb_editor_cmenu.addAction(QtGui.QIcon('share/disc32.png'), _("Disc")) + self.grb_editor_cmenu.addSeparator() + + self.grb_draw_buffer = self.grb_editor_cmenu.addAction(QtGui.QIcon('share/buffer16-2.png'), _("Buffer")) + self.grb_draw_scale = self.grb_editor_cmenu.addAction(QtGui.QIcon('share/scale32.png'), _("Scale")) + self.grb_draw_markarea = self.grb_editor_cmenu.addAction(QtGui.QIcon('share/markarea32.png'), _("Mark Area")) + self.grb_draw_eraser = self.grb_editor_cmenu.addAction(QtGui.QIcon('share/eraser26.png'), _("Eraser")) + self.grb_editor_cmenu.addSeparator() + + self.grb_draw_transformations = self.grb_editor_cmenu.addAction(QtGui.QIcon('share/transform.png'), + _("Transformations")) self.e_editor_cmenu = self.popMenu.addMenu(QtGui.QIcon('share/drill32.png'), _("Exc Editor")) self.drill = self.e_editor_cmenu.addAction(QtGui.QIcon('share/drill32.png'), _("Add Drill"))