From 0ae5c02ea03b33ef7ced1b4c18c667854d4df8ea Mon Sep 17 00:00:00 2001
From: Pierre-Antoine Rouby <pierre-antoine.rouby@inrae.fr>
Date: Fri, 20 Oct 2023 17:20:03 +0200
Subject: [PATCH] Friction: Fix open stricker edit.

---
 src/View/Frictions/Window.py | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/src/View/Frictions/Window.py b/src/View/Frictions/Window.py
index b6dd6afa..95b41d8b 100644
--- a/src/View/Frictions/Window.py
+++ b/src/View/Frictions/Window.py
@@ -240,17 +240,15 @@ class FrictionsWindow(PamhyrWindow):
         self._table.redo()
 
     def edit_stricklers(self):
-        strick = self.sub_win_filter_first(
-            "Stricklers",
-            contain=[]
-        )
+        if self.sub_window_exists(
+            StricklersWindow,
+            data=[self._study, self.parent.conf]
+        ):
+            return
 
-        if strick is None:
-            strick = StricklersWindow(
-                study=self._study,
-                config=self.parent.conf,
-                parent=self
-            )
-            strick.show()
-        else:
-            strick.activateWindow()
+        strick = StricklersWindow(
+            study=self._study,
+            config=self.parent.conf,
+            parent=self
+        )
+        strick.show()
-- 
GitLab