Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion loopstructural/gui/map2loop_tools/basal_contacts_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def _run_extractor(self):
# Validate inputs
if not self.geologyLayerComboBox.currentLayer():
QMessageBox.warning(self, "Missing Input", "Please select a geology layer.")
return
return False

try:
result, contact_type = self._extract_contacts()
Expand All @@ -197,6 +197,7 @@ def _run_extractor(self):
message=f"[map2loop] Failed to save basal contacts debug output: {err}",
log_level=2,
)
return True
except Exception as err:
if self._debug:
self._debug.plugin.log(
Expand All @@ -205,6 +206,7 @@ def _run_extractor(self):
)
raise err
QMessageBox.critical(self, "Error", f"An error occurred: {err}")
return False

def get_parameters(self):
"""Get current widget parameters.
Expand Down
30 changes: 16 additions & 14 deletions loopstructural/gui/map2loop_tools/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def setup_ui(self):

def _run_and_accept(self):
"""Run the sampler and accept dialog if successful."""
self.widget._run_sampler()
# Dialog stays open so user can see the result
if self.widget._run_sampler():
self.accept()


class SorterDialog(QDialog):
Expand Down Expand Up @@ -73,7 +73,8 @@ def setup_ui(self):

def _run_and_accept(self):
"""Run the sorter and accept dialog if successful."""
self.widget._run_sorter()
if self.widget._run_sorter():
self.accept()


class UserDefinedSorterDialog(QDialog):
Expand Down Expand Up @@ -101,16 +102,15 @@ def setup_ui(self):
layout.addWidget(self.widget)

# Replace the run button with dialog buttons
# self.widget.runButton.hide()

# self.button_box = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel, self)
# self.button_box.accepted.connect(self._run_and_accept)
# self.button_box.rejected.connect(self.reject)
# layout.addWidget(self.button_box)
self.button_box = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel, self)
self.button_box.accepted.connect(self._run_and_accept)
self.button_box.rejected.connect(self.reject)
layout.addWidget(self.button_box)

def _run_and_accept(self):
"""Run the sorter and accept dialog if successful."""
self.widget._run_sorter()
if self.widget._run_sorter():
self.accept()


class BasalContactsDialog(QDialog):
Expand Down Expand Up @@ -146,7 +146,8 @@ def setup_ui(self):

def _run_and_accept(self):
"""Run the extractor and accept dialog if successful."""
self.widget._run_extractor()
if self.widget._run_extractor():
self.accept()


class ThicknessCalculatorDialog(QDialog):
Expand Down Expand Up @@ -182,7 +183,8 @@ def setup_ui(self):

def _run_and_accept(self):
"""Run the calculator and accept dialog if successful."""
self.widget._run_calculator()
if self.widget._run_calculator():
self.accept()


class PaintStratigraphicOrderDialog(QDialog):
Expand Down Expand Up @@ -218,5 +220,5 @@ def setup_ui(self):

def _run_and_accept(self):
"""Run the painter and accept dialog if successful."""
self.widget._run_painter()

if self.widget._run_painter():
self.accept()
1 change: 1 addition & 0 deletions loopstructural/gui/map2loop_tools/fault_topology_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,4 @@ def _run_topology(self):
# addGeoDataFrameToproject(gdf, "Input Faults")
# addGeoDataFrameToproject(df, "Fault Topology Table")
QMessageBox.information(self, "Success", f"Calculated fault topology for {len(df)} pairs.")
return True
Loading