From ca8c7a23fd52184f5722e5dcae3f9dee4ac948cd Mon Sep 17 00:00:00 2001
From: Pierre-Antoine Rouby <pierre-antoine.rouby@inrae.fr>
Date: Fri, 26 Jan 2024 14:27:08 +0100
Subject: [PATCH] MainWindow: Put results menu in model action list.

---
 src/View/MainWindow.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/View/MainWindow.py b/src/View/MainWindow.py
index 7804aeef..955778ff 100644
--- a/src/View/MainWindow.py
+++ b/src/View/MainWindow.py
@@ -104,7 +104,8 @@ define_model_action = [
     "action_menu_edit_friction", "action_menu_edit_lateral_contribution",
     "action_menu_run_solver", "action_menu_sediment_layers",
     "action_menu_edit_reach_sediment_layers", "action_menu_edit_reservoirs",
-    "action_menu_edit_hydraulic_structures"
+    "action_menu_edit_hydraulic_structures",
+    "action_menu_results_last", "action_open_results_from_file",
 ]
 
 action = (
@@ -371,7 +372,8 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
 
             if solver.name == self.conf.last_solver_name:
                 self._last_solver = solver
-                self.enable_actions("action_menu_results_last", True)
+                if self._study is not None:
+                    self.enable_actions("action_menu_results_last", True)
                 return
 
         # Last solver note found, use default-mage if exists
-- 
GitLab