From 7afcdb48773036b15f197aab6030981f3efec171 Mon Sep 17 00:00:00 2001
From: Pierre-Antoine Rouby <pierre-antoine.rouby@inrae.fr>
Date: Tue, 23 May 2023 09:26:49 +0200
Subject: [PATCH] configure, stricklers: Work on copy and apply when click ok.

---
 src/View/Configure/Window.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/View/Configure/Window.py b/src/View/Configure/Window.py
index c019ca81..7bb3d61f 100644
--- a/src/View/Configure/Window.py
+++ b/src/View/Configure/Window.py
@@ -1,5 +1,6 @@
 # -*- coding: utf-8 -*-
 
+from copy import deepcopy
 from config import Config
 from View.ASubWindow import ASubWindow
 from View.ListedSubWindow import ListedSubWindow
@@ -110,7 +111,7 @@ class ConfigureWindow(ASubWindow, ListedSubWindow):
 
         # Stricklers
         table = self.find(QTableView, f"tableView_stricklers")
-        self._stricklers = self.conf.stricklers
+        self._stricklers = deepcopy(self.conf.stricklers)
         self._stricklers_table = TableModel(
             data = self._stricklers,
             undo = self._undo_stack,
@@ -180,6 +181,9 @@ class ConfigureWindow(ASubWindow, ListedSubWindow):
         self.conf.backup_frequence = self.get_time_edit("timeEdit_backup_frequence")
         self.conf.backup_max = self.get_spin_box("spinBox_backup_max")
 
+        # Stricklers
+        self.conf.stricklers = deepcopy(self._stricklers)
+
         # Language
         self.conf.lang = Config.languages()[self.get_combobox_text("comboBox_language")]
 
-- 
GitLab