# HG changeset patch
# User Edouard Tisserant <edouard@beremiz.fr>
# Date 1737448199 -3600
# Node ID 8c12c0df026a69d45527eefe48899cf4b0eaf428
# Parent  08ab4ad50346fc2d9fc4adaa7a9b54ca227fa30b
Let extensions know when configuration is new, to apply defaults.

Add "new_config" member to CTN, True when config was just created.

diff -r 08ab4ad50346 -r 8c12c0df026a ConfigTreeNode.py
--- a/ConfigTreeNode.py	Thu Jan 16 15:30:35 2025 +0100
+++ b/ConfigTreeNode.py	Tue Jan 21 09:29:59 2025 +0100
@@ -585,6 +585,8 @@
                 NewCTNName = self.FindNewName(CTNName)
                 # If dir have already be made, and file exist
                 if os.path.isdir(self.CTNPath(NewCTNName)):  # and os.path.isfile(self.ConfNodeXmlFilePath(CTNName)):
+                    # Make CTN aware that this configuration was loaded
+                    self.new_config = False
                     # Load the confnode.xml file into parameters members
                     self.LoadXMLParams(NewCTNName)
                     # Basic check. Better to fail immediately.
@@ -605,6 +607,8 @@
                     # just loaded, nothing to saved
                     self.ChangesToSave = False
                 else:
+                    # Make CTN aware that this is first time configuration
+                    self.new_config = True
                     # If confnode do not have corresponding file/dirs - they will be created on Save
                     self.CTNMakeDir()
                     # Find an IEC number