- made sure that if the OR-TOOLS package is not installed then the options in the Preferences for the related optimizations are disabled
This commit is contained in:
@@ -123,14 +123,14 @@ class RadioSetDefaults(RadioSet):
|
||||
* 'label': Shown in the UI
|
||||
* 'value': The value returned is selected
|
||||
|
||||
:param choices: List of choices. See description.
|
||||
:param orientation: 'horizontal' (default) of 'vertical'.
|
||||
:param parent: Qt parent widget.
|
||||
:type choices: list
|
||||
:param choices: List of choices. See description.
|
||||
:param orientation: 'horizontal' (default) of 'vertical'.
|
||||
:param parent: Qt parent widget.
|
||||
:type choices: list
|
||||
:param dictionary:
|
||||
:type dictionary: "dict"
|
||||
:type dictionary: "dict"
|
||||
:param key_spec:
|
||||
:type key_spec: 'str'
|
||||
:type key_spec: 'str'
|
||||
"""
|
||||
|
||||
super(RadioSetDefaults, self).__init__(choices=choices, orientation=orientation, compact=compact, parent=parent)
|
||||
|
||||
@@ -346,6 +346,13 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI):
|
||||
self.optimization_time_label.setDisabled(True)
|
||||
self.optimization_time_entry.setDisabled(True)
|
||||
|
||||
try:
|
||||
import ortools
|
||||
except ModuleNotFoundError:
|
||||
self.excellon_optimization_radio.setOptionsDisabled([_('MetaHeuristic'), _('Basic')], True)
|
||||
self.optimization_time_label.setDisabled(True)
|
||||
self.optimization_time_entry.setDisabled(True)
|
||||
|
||||
# Setting plot colors signals
|
||||
self.line_color_entry.editingFinished.connect(self.on_line_color_entry)
|
||||
self.fill_color_entry.editingFinished.connect(self.on_fill_color_entry)
|
||||
|
||||
@@ -171,6 +171,13 @@ class GeometryGenPrefGroupUI(OptionsGroupUI):
|
||||
self.optimization_time_label.setDisabled(True)
|
||||
self.optimization_time_entry.setDisabled(True)
|
||||
|
||||
try:
|
||||
import ortools
|
||||
except ModuleNotFoundError:
|
||||
self.opt_algorithm_radio.setOptionsDisabled([_('MetaHeuristic'), _('Basic')], True)
|
||||
self.optimization_time_label.setDisabled(True)
|
||||
self.optimization_time_entry.setDisabled(True)
|
||||
|
||||
self.opt_algorithm_radio.activated_custom.connect(self.optimization_selection)
|
||||
|
||||
# Setting plot colors signals
|
||||
|
||||
Reference in New Issue
Block a user