diff --git a/loopstructural/gui/map2loop_tools/sorter_widget.py b/loopstructural/gui/map2loop_tools/sorter_widget.py index 298ea6b..8e53e02 100644 --- a/loopstructural/gui/map2loop_tools/sorter_widget.py +++ b/loopstructural/gui/map2loop_tools/sorter_widget.py @@ -70,6 +70,7 @@ def __init__(self, parent=None, data_manager=None, debug_manager=None): self.sortingAlgorithmComboBox.currentIndexChanged.connect(self._on_algorithm_changed) self.geologyLayerComboBox.layerChanged.connect(self._on_geology_layer_changed) self.structureLayerComboBox.layerChanged.connect(self._on_structure_layer_changed) + self.contactsLayerComboBox.layerChanged.connect(self._on_contacts_layer_changed) self.runButton.clicked.connect(self._run_sorter) self.orientationTypeComboBox.setCurrentIndex(1) # Default to Dip Direction self._guess_layers() @@ -278,6 +279,12 @@ def _on_structure_layer_changed(self): if dipdir_match := matcher.find_match('DIPDIR'): self.dipDirFieldComboBox.setField(dipdir_match) + def _on_contacts_layer_changed(self): + """Update field combo boxes when contacts layer changes.""" + layer = self.contactsLayerComboBox.currentLayer() + self.unitName1FieldComboBox.setLayer(layer) + self.unitName2FieldComboBox.setLayer(layer) + def _on_algorithm_changed(self): """Update UI based on selected sorting algorithm and map2loop requirements.""" algorithm_index = self.sortingAlgorithmComboBox.currentIndex()