- 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:
Marius Stanciu
2021-11-20 19:41:52 +02:00
committed by Marius
parent 640739cc65
commit b494669ca0
6 changed files with 32 additions and 11 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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