From 624e9b6f71b72ab208b960efc25a6c5c02f4575a Mon Sep 17 00:00:00 2001
From: Pierre-Antoine Rouby <pierre-antoine.rouby@inrae.fr>
Date: Tue, 26 Sep 2023 12:07:10 +0200
Subject: [PATCH] refactoring: Apply PamhyrWindow on Debug window.

---
 src/View/Debug/Window.py | 24 +++++++++++-------------
 src/View/MainWindow.py   |  2 +-
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/src/View/Debug/Window.py b/src/View/Debug/Window.py
index 9b14aa20..2e99dadb 100644
--- a/src/View/Debug/Window.py
+++ b/src/View/Debug/Window.py
@@ -20,8 +20,7 @@ import logging
 
 from tools import trace, timer
 
-from View.ASubWindow import ASubMainWindow
-from View.ListedSubWindow import ListedSubWindow
+from View.Tools.PamhyrWindow import PamhyrWindow
 
 from PyQt5.QtGui import (
     QKeySequence,
@@ -45,20 +44,19 @@ logger = logging.getLogger()
 
 _translate = QCoreApplication.translate
 
-class ReplWindow(ASubMainWindow, ListedSubWindow):
-    def __init__(self, title="Debug REPL",
-                 study=None, config=None,
-                 solver=None, parent=None):
-        self._title = title
-
-        self._study = study
-        self._config = config
-        self._parent = parent
+class ReplWindow(PamhyrWindow):
+    _pamhyr_ui = "DebugRepl"
+    _pamhyr_name = "Debug REPL"
 
+    def __init__(self, study=None, config=None,
+                 solver=None, parent=None):
         super(ReplWindow, self).__init__(
-            name=self._title, ui="DebugRepl", parent=parent
+            title = self._pamhyr_name,
+            study = study,
+            config = config,
+            options = [],
+            parent = parent
         )
-        self.ui.setWindowTitle(self._title)
 
         self.__debug_exec_result__ = None
         self._history = []
diff --git a/src/View/MainWindow.py b/src/View/MainWindow.py
index 01e7a3b0..cb9d8b7e 100644
--- a/src/View/MainWindow.py
+++ b/src/View/MainWindow.py
@@ -56,7 +56,7 @@ from View.SolverParameters.Window import SolverParametersWindow
 from View.RunSolver.Window import SelectSolverWindow, SolverLogWindow
 from View.CheckList.Window import CheckListWindow
 from View.Results.Window import ResultsWindow
-# from View.Debug.Window import ReplWindow
+from View.Debug.Window import ReplWindow
 
 from Model.Study import Study
 
-- 
GitLab