- in Geometry Editor - made sure that selecting shapes on canvas will update the UI - final fix

This commit is contained in:
Marius Stanciu
2020-11-29 15:44:16 +02:00
committed by Marius Stanciu
parent 4f46620e7e
commit bdabd6cfdf
2 changed files with 93 additions and 87 deletions

View File

@@ -12,6 +12,7 @@ CHANGELOG for FlatCAM beta
- in Geometry Editor - improvements and some issues are solved - in Geometry Editor - improvements and some issues are solved
- in Geometry Editor - improvement in update of the whole Geometry Editor UI on shape selection on canvas - in Geometry Editor - improvement in update of the whole Geometry Editor UI on shape selection on canvas
- in Geometry Editor - fixed multiple plotting for the same selection - in Geometry Editor - fixed multiple plotting for the same selection
- in Geometry Editor - made sure that selecting shapes on canvas will update the UI - final fix
28.11.2020 28.11.2020

View File

@@ -2669,6 +2669,8 @@ class FCSelect(DrawTool):
self.draw_app.tw.itemClicked.connect(self.draw_app.on_tree_geo_click) self.draw_app.tw.itemClicked.connect(self.draw_app.on_tree_geo_click)
# self.draw_app.tw.itemClicked.emit(self.draw_app.tw.currentItem(), 0) # self.draw_app.tw.itemClicked.emit(self.draw_app.tw.currentItem(), 0)
self.draw_app.update_ui()
return "" return ""
def clean_up(self): def clean_up(self):
@@ -3865,11 +3867,10 @@ class AppGeoEditor(QtCore.QObject):
def on_geo_elem_selected(self): def on_geo_elem_selected(self):
pass pass
def on_tree_geo_click(self): def update_ui(self):
self.selected = [] self.selected = []
last_obj_shape = None last_obj_shape = None
try:
selected_tree_items = self.tw.selectedItems() selected_tree_items = self.tw.selectedItems()
for sel in selected_tree_items: for sel in selected_tree_items:
for obj_shape in self.storage.get_objects(): for obj_shape in self.storage.get_objects():
@@ -3964,6 +3965,10 @@ class AppGeoEditor(QtCore.QObject):
self.geo_coords_entry.setText(str(coords)) self.geo_coords_entry.setText(str(coords))
self.geo_vertex_entry.set_value(vertex_nr) self.geo_vertex_entry.set_value(vertex_nr)
def on_tree_geo_click(self):
try:
self.update_ui()
self.plot_all() self.plot_all()
except Exception as e: except Exception as e:
self.app.log.debug("APpGeoEditor.on_tree_selection_change() -> %s" % str(e)) self.app.log.debug("APpGeoEditor.on_tree_selection_change() -> %s" % str(e))