- solved issue #368 - when using the Enable/Disable prj context menu entries the plotted status is not updated in the object properties

This commit is contained in:
Marius Stanciu 2020-01-07 14:47:29 +02:00
parent e062a4fad2
commit b327c216d7
2 changed files with 32 additions and 4 deletions

View File

@ -12040,8 +12040,7 @@ class App(QtCore.QObject):
log.debug("App.on_enable_sel_plot()")
object_list = self.collection.get_selected()
self.enable_plots(objects=object_list)
self.inform.emit('[success] %s' %
_("Selected plots enabled..."))
self.inform.emit('[success] %s' % _("Selected plots enabled..."))
def on_disable_sel_plots(self):
log.debug("App.on_disable_sel_plot()")
@ -12049,8 +12048,7 @@ class App(QtCore.QObject):
# self.inform.emit(_("Disabling plots ..."))
object_list = self.collection.get_selected()
self.disable_plots(objects=object_list)
self.inform.emit('[success] %s' %
_("Selected plots disabled..."))
self.inform.emit('[success] %s' % _("Selected plots disabled..."))
def enable_plots(self, objects):
"""
@ -12066,6 +12064,20 @@ class App(QtCore.QObject):
if obj.options['plot'] is False:
obj.options.set_change_callback(lambda x: None)
obj.options['plot'] = True
try:
# only the Gerber obj has on_plot_cb_click() method
obj.ui.plot_cb.stateChanged.disconnect(obj.on_plot_cb_click)
# disable this cb while disconnected,
# in case the operation takes time the user is not allowed to change it
obj.ui.plot_cb.setDisabled(True)
except AttributeError:
pass
obj.set_form_item("plot")
try:
obj.ui.plot_cb.stateChanged.connect(obj.on_plot_cb_click)
obj.ui.plot_cb.setDisabled(False)
except AttributeError:
pass
obj.options.set_change_callback(obj.on_options_change)
def worker_task(objs):
@ -12100,6 +12112,18 @@ class App(QtCore.QObject):
if obj.options['plot'] is True:
obj.options.set_change_callback(lambda x: None)
obj.options['plot'] = False
try:
# only the Gerber obj has on_plot_cb_click() method
obj.ui.plot_cb.stateChanged.disconnect(obj.on_plot_cb_click)
obj.ui.plot_cb.setDisabled(True)
except AttributeError:
pass
obj.set_form_item("plot")
try:
obj.ui.plot_cb.stateChanged.connect(obj.on_plot_cb_click)
obj.ui.plot_cb.setDisabled(False)
except AttributeError:
pass
obj.options.set_change_callback(obj.on_options_change)
try:

View File

@ -9,6 +9,10 @@ CAD program, and create G-Code for Isolation routing.
=================================================
7.01.2019
- solved issue #368 - when using the Enable/Disable prj context menu entries the plotted status is not updated in the object properties
6.01.2019
- working on new NCC Tool