Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 26, 2026

Project widgets were not remembering selected layers/fields and qgscombomaplayer/field combos lacked consistent column guessing from project layers.

  • Data persistence

    • Added widget_settings storage to ModellingDataManager (saved/loaded with project) for widget-specific selections.
  • Layer/field auto-guessing & restoration

    • Basal contacts, sorter, sampler, and thickness calculator widgets now use ColumnMatcher to suggest layers/fields and restore previous selections; guards added when layers are missing.
    • Thickness calculator passes required parameters and handles multi-part results, with a simple progress updater.
    • LoopStructural model setup widgets (DEM, Fault Layers, Stratigraphic Layers) now auto-guess layers/fields via ColumnMatcher, persist selections through widget_settings, and restore them on reopen (with missing-layer guards).
  • Example (sampler widget guessing/persisting)

    dtm_names = get_layer_names(self.dtmLayerComboBox)
    matcher = ColumnMatcher(dtm_names)
    dtm_match = matcher.find_match('DTM') or matcher.find_match('DEM')
    if dtm_match:
        self.dtmLayerComboBox.setLayer(self.data_manager.find_layer_by_name(dtm_match))
    
    # Persist current selections
    self.data_manager.set_widget_settings('sampler_widget', {
        'dtm_layer': self.dtmLayerComboBox.currentLayer().name() if self.dtmLayerComboBox.currentLayer() else None,
        ...
    })
Original prompt

For every qgscombomaplayer combo box and field combo box ensure that the column matcher is used to guess the appropriate column from the current layers in the project. Also ensure that any selections of layers are stored in the project data. So that when the widgets are closed and reopened the same layers are selected. This can be managed through the data manager and the selections stored in a json. Feel free to suggest or use a different data structure to achieve the same purpose but ensure that the approach implemented is modular and can be extended.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 5 commits January 26, 2026 01:41
Co-authored-by: lachlangrose <7371904+lachlangrose@users.noreply.github.com>
Co-authored-by: lachlangrose <7371904+lachlangrose@users.noreply.github.com>
Co-authored-by: lachlangrose <7371904+lachlangrose@users.noreply.github.com>
Co-authored-by: lachlangrose <7371904+lachlangrose@users.noreply.github.com>
Co-authored-by: lachlangrose <7371904+lachlangrose@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement layer selection storage for combo boxes Persist and auto-guess layer/field selections across map2loop widgets Jan 26, 2026
Copilot AI requested a review from lachlangrose January 26, 2026 01:47
@lachlangrose
Copy link
Member

@copilot can you do the same thing with the LoopStructural widget? e.g. all of the model set up

Co-authored-by: lachlangrose <7371904+lachlangrose@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 26, 2026

@copilot can you do the same thing with the LoopStructural widget? e.g. all of the model set up

Added ColumnMatcher-based auto-guessing plus persistence/restore for the LoopStructural setup widgets (DEM, Fault Layers, Stratigraphic Layers). Changes are in 271ca04.

Copilot AI changed the title Persist and auto-guess layer/field selections across map2loop widgets Persist and auto-guess layer/field selections across map2loop and LoopStructural setup widgets Jan 26, 2026
@lachlangrose lachlangrose marked this pull request as ready for review January 26, 2026 07:47
@lachlangrose lachlangrose merged commit 6dec6e2 into dev-0.1.12 Jan 26, 2026
1 check passed
@lachlangrose lachlangrose deleted the copilot/enhance-layer-selection-storage branch January 26, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants