Skip to content

Commit c0d6875

Browse files
committed
fix: connect layer change to update field combo boxes
1 parent ed17d93 commit c0d6875

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

loopstructural/gui/map2loop_tools/sorter_widget.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def __init__(self, parent=None, data_manager=None, debug_manager=None):
7070
self.sortingAlgorithmComboBox.currentIndexChanged.connect(self._on_algorithm_changed)
7171
self.geologyLayerComboBox.layerChanged.connect(self._on_geology_layer_changed)
7272
self.structureLayerComboBox.layerChanged.connect(self._on_structure_layer_changed)
73+
self.contactsLayerComboBox.layerChanged.connect(self._on_contacts_layer_changed)
7374
self.runButton.clicked.connect(self._run_sorter)
7475
self.orientationTypeComboBox.setCurrentIndex(1) # Default to Dip Direction
7576
self._guess_layers()
@@ -278,6 +279,12 @@ def _on_structure_layer_changed(self):
278279
if dipdir_match := matcher.find_match('DIPDIR'):
279280
self.dipDirFieldComboBox.setField(dipdir_match)
280281

282+
def _on_contacts_layer_changed(self):
283+
"""Update field combo boxes when contacts layer changes."""
284+
layer = self.contactsLayerComboBox.currentLayer()
285+
self.unitName1FieldComboBox.setLayer(layer)
286+
self.unitName2FieldComboBox.setLayer(layer)
287+
281288
def _on_algorithm_changed(self):
282289
"""Update UI based on selected sorting algorithm and map2loop requirements."""
283290
algorithm_index = self.sortingAlgorithmComboBox.currentIndex()

0 commit comments

Comments
 (0)