- changed the extension of the Tool Database file to FlatDB for easy recognition (in the future double clicking such a file might import the new tools in the FC database)

- modified the ToolDB class and changed some strings
- Preferences classes now have access to the App attributes through app.setup_obj_classes() method
- moved app.setup_obj_classes() upper in the App.__init__()
- added a new Preferences setting allowing to modify the mouse cursor color
- remade the GUI in Preferences -> General grouping the settings in a more clear way
- made available the Jump To function in Excellon Editor
- added a clean_up() method in all the Editor Tools that need it, to be run when aborting using the ESC key
This commit is contained in:
Marius Stanciu
2019-12-26 01:47:50 +02:00
committed by Marius
parent fcc52a2682
commit 0268a02f3b
9 changed files with 920 additions and 480 deletions

View File

@@ -240,6 +240,8 @@ class FCPad(FCShapeTool):
self.draw_app.app.inform.emit(_("Click to place ..."))
self.draw_app.app.jump_signal.connect(lambda x: self.draw_app.update_utility_geometry(data=x))
# Switch notebook to Selected page
self.draw_app.app.ui.notebook.setCurrentWidget(self.draw_app.app.ui.selected_tab)
@@ -378,13 +380,17 @@ class FCPad(FCShapeTool):
self.draw_app.in_action = False
self.complete = True
self.draw_app.app.inform.emit('[success] %s' %
_("Done. Adding Pad completed."))
self.draw_app.app.inform.emit('[success] %s' % _("Done. Adding Pad completed."))
self.draw_app.app.jump_signal.disconnect()
def clean_up(self):
self.draw_app.selected = []
self.draw_app.apertures_table.clearSelection()
self.draw_app.plot_all()
try:
self.draw_app.app.jump_signal.disconnect()
except (TypeError, AttributeError):
pass
class FCPadArray(FCShapeTool):
@@ -464,6 +470,8 @@ class FCPadArray(FCShapeTool):
self.draw_app.app.inform.emit(_("Click on target location ..."))
self.draw_app.app.jump_signal.connect(lambda x: self.draw_app.update_utility_geometry(data=x))
# Switch notebook to Selected page
self.draw_app.app.ui.notebook.setCurrentWidget(self.draw_app.app.ui.selected_tab)
@@ -726,12 +734,16 @@ class FCPadArray(FCShapeTool):
_("Done. Pad Array added."))
self.draw_app.in_action = False
self.draw_app.array_frame.hide()
return
self.draw_app.app.jump_signal.disconnect()
def clean_up(self):
self.draw_app.selected = []
self.draw_app.apertures_table.clearSelection()
self.draw_app.plot_all()
try:
self.draw_app.app.jump_signal.disconnect()
except (TypeError, AttributeError):
pass
class FCPoligonize(FCShapeTool):
@@ -1077,6 +1089,10 @@ class FCRegion(FCShapeTool):
self.draw_app.selected = []
self.draw_app.apertures_table.clearSelection()
self.draw_app.plot_all()
try:
self.draw_app.app.jump_signal.disconnect()
except (TypeError, AttributeError):
pass
def on_key(self, key):
# Jump to coords
@@ -1190,6 +1206,10 @@ class FCTrack(FCRegion):
self.draw_app.selected = []
self.draw_app.apertures_table.clearSelection()
self.draw_app.plot_all()
try:
self.draw_app.app.jump_signal.disconnect()
except (TypeError, AttributeError):
pass
def click(self, point):
self.draw_app.in_action = True
@@ -1472,6 +1492,10 @@ class FCDisc(FCShapeTool):
self.draw_app.selected = []
self.draw_app.apertures_table.clearSelection()
self.draw_app.plot_all()
try:
self.draw_app.app.jump_signal.disconnect()
except (TypeError, AttributeError):
pass
class FCSemiDisc(FCShapeTool):
@@ -1737,6 +1761,10 @@ class FCSemiDisc(FCShapeTool):
self.draw_app.selected = []
self.draw_app.apertures_table.clearSelection()
self.draw_app.plot_all()
try:
self.draw_app.app.jump_signal.disconnect()
except (TypeError, AttributeError):
pass
class FCScale(FCShapeTool):
@@ -1921,6 +1949,8 @@ class FCApertureMove(FCShapeTool):
# Switch notebook to Selected page
self.draw_app.app.ui.notebook.setCurrentWidget(self.draw_app.app.ui.selected_tab)
self.draw_app.app.jump_signal.connect(lambda x: self.draw_app.update_utility_geometry(data=x))
self.sel_limit = self.draw_app.app.defaults["gerber_editor_sel_limit"]
self.selection_shape = self.selection_bbox()
@@ -2021,14 +2051,19 @@ class FCApertureMove(FCShapeTool):
self.draw_app.plot_all()
self.draw_app.build_ui()
self.draw_app.app.inform.emit('[success] %s' %
_("Done. Apertures Move completed."))
self.draw_app.app.inform.emit('[success] %s' % _("Done. Apertures Move completed."))
self.draw_app.app.jump_signal.disconnect()
def clean_up(self):
self.draw_app.selected = []
self.draw_app.apertures_table.clearSelection()
self.draw_app.plot_all()
try:
self.draw_app.app.jump_signal.disconnect()
except (TypeError, AttributeError):
pass
def utility_geometry(self, data=None):
"""
Temporary geometry on screen while using this tool.
@@ -2098,8 +2133,8 @@ class FCApertureCopy(FCApertureMove):
sel_shapes_to_be_deleted = []
self.draw_app.build_ui()
self.draw_app.app.inform.emit('[success] %s' %
_("Done. Apertures copied."))
self.draw_app.app.inform.emit('[success] %s' % _("Done. Apertures copied."))
self.draw_app.app.jump_signal.disconnect()
class FCEraser(FCShapeTool):
@@ -2130,6 +2165,8 @@ class FCEraser(FCShapeTool):
# Switch notebook to Selected page
self.draw_app.app.ui.notebook.setCurrentWidget(self.draw_app.app.ui.selected_tab)
self.draw_app.app.jump_signal.connect(lambda x: self.draw_app.update_utility_geometry(data=x))
self.sel_limit = self.draw_app.app.defaults["gerber_editor_sel_limit"]
def set_origin(self, origin):
@@ -2206,13 +2243,17 @@ class FCEraser(FCShapeTool):
self.draw_app.delete_utility_geometry()
self.draw_app.plot_all()
self.draw_app.app.inform.emit('[success] %s' %
_("Done. Eraser tool action completed."))
self.draw_app.app.inform.emit('[success] %s' % _("Done. Eraser tool action completed."))
self.draw_app.app.jump_signal.disconnect()
def clean_up(self):
self.draw_app.selected = []
self.draw_app.apertures_table.clearSelection()
self.draw_app.plot_all()
try:
self.draw_app.app.jump_signal.disconnect()
except (TypeError, AttributeError):
pass
def utility_geometry(self, data=None):
"""
@@ -3760,6 +3801,11 @@ class FlatCAMGrbEditor(QtCore.QObject):
except (TypeError, AttributeError):
pass
try:
self.app.jump_signal.disconnect()
except (TypeError, AttributeError):
pass
def clear(self):
self.active_tool = None
self.selected = []