- changed the Disable plots menu entry in the context menu, into a Toggle Visibility menu entry

- Spanish Google translation 100% but two strings (big ones)
This commit is contained in:
Marius Stanciu
2019-07-30 20:05:16 +03:00
parent 99a8ed757d
commit 1e7421ebe9
16 changed files with 693 additions and 280 deletions

View File

@@ -1462,7 +1462,7 @@ class App(QtCore.QObject):
self.connect_toolbar_signals()
# Context Menu
self.ui.popmenu_disable.triggered.connect(lambda: self.disable_plots(self.collection.get_selected()))
self.ui.popmenu_disable.triggered.connect(lambda: self.toggle_plots(self.collection.get_selected()))
self.ui.popmenu_panel_toggle.triggered.connect(self.on_toggle_notebook)
self.ui.popmenu_new_geo.triggered.connect(self.new_geometry_object)
@@ -8532,12 +8532,46 @@ The normal flow when working in FlatCAM is the following:</span></p>
:return:
"""
# if no objects selected then do nothing
if not self.collection.get_selected():
return
# if at least one object is visible then do the disable
exit_flag = True
for obj in objects:
if obj.options['plot'] is True:
exit_flag = False
break
if exit_flag:
return
log.debug("Disabling plots ...")
self.inform.emit(_("Working ..."))
for obj in objects:
obj.options['plot'] = False
self.plots_updated.emit()
def toggle_plots(self, objects):
"""
Toggle plots visibility
:param objects: list of Objects for which to be toggled the visibility
:return:
"""
# if no objects selected then do nothing
if not self.collection.get_selected():
return
log.debug("Toggling plots ...")
self.inform.emit(_("Working ..."))
for obj in objects:
if obj.options['plot'] is False:
obj.options['plot'] = True
else:
obj.options['plot'] = False
self.plots_updated.emit()
def clear_plots(self):
objects = self.collection.get_list()