- reverted the class methods in AppTool
- added a button for Transformations Tool in the lower side (common) of the Object UI - some other UI changes - after using Isolation Tool it will switch automatically to the Geometry UI
This commit is contained in:
@@ -149,6 +149,12 @@ class ObjectUI(QtWidgets.QWidget):
|
||||
self.common_grid.addWidget(self.offsetvector_entry, 4, 0)
|
||||
self.common_grid.addWidget(self.offset_button, 4, 1)
|
||||
|
||||
self.transformations_button = QtWidgets.QPushButton(_('Transformations'))
|
||||
self.transformations_button.setToolTip(
|
||||
_("Geometrical transformations of the current object.")
|
||||
)
|
||||
self.common_grid.addWidget(self.transformations_button, 5, 0, 1, 2)
|
||||
|
||||
layout.addStretch()
|
||||
|
||||
def confirmation_message(self, accepted, minval, maxval):
|
||||
|
||||
@@ -182,6 +182,11 @@ class FlatCAMObj(QtCore.QObject):
|
||||
except (TypeError, AttributeError):
|
||||
pass
|
||||
|
||||
try:
|
||||
self.ui.transformations_button.clicked.connect(self.app.transform_tool.run)
|
||||
except (TypeError, AttributeError):
|
||||
pass
|
||||
|
||||
# self.ui.skew_button.clicked.connect(self.on_skew_button_click)
|
||||
|
||||
def build_ui(self):
|
||||
|
||||
43
AppTool.py
43
AppTool.py
@@ -101,8 +101,7 @@ class AppTool(QtWidgets.QWidget):
|
||||
|
||||
self.show()
|
||||
|
||||
@classmethod
|
||||
def draw_tool_selection_shape(cls, old_coords, coords, **kwargs):
|
||||
def draw_tool_selection_shape(self, old_coords, coords, **kwargs):
|
||||
"""
|
||||
|
||||
:param old_coords: old coordinates
|
||||
@@ -114,17 +113,17 @@ class AppTool(QtWidgets.QWidget):
|
||||
if 'shapes_storage' in kwargs:
|
||||
s_storage = kwargs['shapes_storage']
|
||||
else:
|
||||
s_storage = cls.app.tool_shapes
|
||||
s_storage = self.app.tool_shapes
|
||||
|
||||
if 'color' in kwargs:
|
||||
color = kwargs['color']
|
||||
else:
|
||||
color = cls.app.defaults['global_sel_line']
|
||||
color = self.app.defaults['global_sel_line']
|
||||
|
||||
if 'face_color' in kwargs:
|
||||
face_color = kwargs['face_color']
|
||||
else:
|
||||
face_color = cls.app.defaults['global_sel_fill']
|
||||
face_color = self.app.defaults['global_sel_fill']
|
||||
|
||||
if 'face_alpha' in kwargs:
|
||||
face_alpha = kwargs['face_alpha']
|
||||
@@ -146,11 +145,10 @@ class AppTool(QtWidgets.QWidget):
|
||||
color_t = face_color[:-2] + str(hex(int(face_alpha * 255)))[2:]
|
||||
|
||||
s_storage.add(sel_rect, color=color, face_color=color_t, update=True, layer=0, tolerance=None)
|
||||
if cls.app.is_legacy is True:
|
||||
if self.app.is_legacy is True:
|
||||
s_storage.redraw()
|
||||
|
||||
@classmethod
|
||||
def draw_selection_shape_polygon(cls, points, **kwargs):
|
||||
def draw_selection_shape_polygon(self, points, **kwargs):
|
||||
"""
|
||||
|
||||
:param points: a list of points from which to create a Polygon
|
||||
@@ -161,17 +159,17 @@ class AppTool(QtWidgets.QWidget):
|
||||
if 'shapes_storage' in kwargs:
|
||||
s_storage = kwargs['shapes_storage']
|
||||
else:
|
||||
s_storage = cls.app.tool_shapes
|
||||
s_storage = self.app.tool_shapes
|
||||
|
||||
if 'color' in kwargs:
|
||||
color = kwargs['color']
|
||||
else:
|
||||
color = cls.app.defaults['global_sel_line']
|
||||
color = self.app.defaults['global_sel_line']
|
||||
|
||||
if 'face_color' in kwargs:
|
||||
face_color = kwargs['face_color']
|
||||
else:
|
||||
face_color = cls.app.defaults['global_sel_fill']
|
||||
face_color = self.app.defaults['global_sel_fill']
|
||||
|
||||
if 'face_alpha' in kwargs:
|
||||
face_alpha = kwargs['face_alpha']
|
||||
@@ -189,11 +187,10 @@ class AppTool(QtWidgets.QWidget):
|
||||
color_t = face_color[:-2] + str(hex(int(face_alpha * 255)))[2:]
|
||||
|
||||
s_storage.add(sel_rect, color=color, face_color=color_t, update=True, layer=0, tolerance=None)
|
||||
if cls.app.is_legacy is True:
|
||||
if self.app.is_legacy is True:
|
||||
s_storage.redraw()
|
||||
|
||||
@classmethod
|
||||
def delete_tool_selection_shape(cls, **kwargs):
|
||||
def delete_tool_selection_shape(self, **kwargs):
|
||||
"""
|
||||
|
||||
:param kwargs:
|
||||
@@ -203,13 +200,12 @@ class AppTool(QtWidgets.QWidget):
|
||||
if 'shapes_storage' in kwargs:
|
||||
s_storage = kwargs['shapes_storage']
|
||||
else:
|
||||
s_storage = cls.app.tool_shapes
|
||||
s_storage = self.app.tool_shapes
|
||||
|
||||
s_storage.clear()
|
||||
s_storage.redraw()
|
||||
|
||||
@classmethod
|
||||
def draw_moving_selection_shape_poly(cls, points, data, **kwargs):
|
||||
def draw_moving_selection_shape_poly(self, points, data, **kwargs):
|
||||
"""
|
||||
|
||||
:param points:
|
||||
@@ -221,17 +217,17 @@ class AppTool(QtWidgets.QWidget):
|
||||
if 'shapes_storage' in kwargs:
|
||||
s_storage = kwargs['shapes_storage']
|
||||
else:
|
||||
s_storage = cls.app.move_tool.sel_shapes
|
||||
s_storage = self.app.move_tool.sel_shapes
|
||||
|
||||
if 'color' in kwargs:
|
||||
color = kwargs['color']
|
||||
else:
|
||||
color = cls.app.defaults['global_sel_line']
|
||||
color = self.app.defaults['global_sel_line']
|
||||
|
||||
if 'face_color' in kwargs:
|
||||
face_color = kwargs['face_color']
|
||||
else:
|
||||
face_color = cls.app.defaults['global_sel_fill']
|
||||
face_color = self.app.defaults['global_sel_fill']
|
||||
|
||||
if 'face_alpha' in kwargs:
|
||||
face_alpha = kwargs['face_alpha']
|
||||
@@ -261,11 +257,10 @@ class AppTool(QtWidgets.QWidget):
|
||||
elif not geo.is_valid:
|
||||
s_storage.add(geo, color="red", face_color=color_t_error, update=True, layer=0, tolerance=None)
|
||||
|
||||
if cls.app.is_legacy is True:
|
||||
if self.app.is_legacy is True:
|
||||
s_storage.redraw()
|
||||
|
||||
@classmethod
|
||||
def delete_moving_selection_shape(cls, **kwargs):
|
||||
def delete_moving_selection_shape(self, **kwargs):
|
||||
"""
|
||||
|
||||
:param kwargs:
|
||||
@@ -275,7 +270,7 @@ class AppTool(QtWidgets.QWidget):
|
||||
if 'shapes_storage' in kwargs:
|
||||
s_storage = kwargs['shapes_storage']
|
||||
else:
|
||||
s_storage = cls.app.move_tool.sel_shapes
|
||||
s_storage = self.app.move_tool.sel_shapes
|
||||
|
||||
s_storage.clear()
|
||||
s_storage.redraw()
|
||||
|
||||
@@ -1865,6 +1865,9 @@ class ToolIsolation(AppTool, Gerber):
|
||||
|
||||
self.app.app_obj.new_object("geometry", iso_name, iso_init, plot=plot)
|
||||
|
||||
# Switch notebook to Selected page
|
||||
self.app.ui.notebook.setCurrentWidget(self.app.ui.selected_tab)
|
||||
|
||||
def combined_rest(self, iso_obj, iso2geo, tools_storage, lim_area, plot=True):
|
||||
"""
|
||||
|
||||
|
||||
@@ -8906,7 +8906,7 @@ class App(QtCore.QObject):
|
||||
"""
|
||||
self.log.debug("Plot_all()")
|
||||
if muted is not True:
|
||||
self.inform.emit('[success] %s...' % _("Redrawing all objects"))
|
||||
self.inform[str, bool].emit('[success] %s...' % _("Redrawing all objects"), False)
|
||||
|
||||
for plot_obj in self.collection.get_list():
|
||||
def worker_task(obj):
|
||||
|
||||
@@ -17,6 +17,10 @@ CHANGELOG for FlatCAM beta
|
||||
- made some minor changes in the GUI of the FlatCAM Tools
|
||||
- in Tools Database made sure that each new tool added has a unique name
|
||||
- in AppTool made some methods to be class methods
|
||||
- reverted the class methods in AppTool
|
||||
- added a button for Transformations Tool in the lower side (common) of the Object UI
|
||||
- some other UI changes
|
||||
- after using Isolation Tool it will switch automatically to the Geometry UI
|
||||
|
||||
31.05.2020
|
||||
|
||||
|
||||
Reference in New Issue
Block a user