# HG changeset patch
# User tmodes
# Date 1795866427 -3600
#      Sat Nov 28 12:47:07 2026 +0100
# Node ID 20a35388e364276ee6fd507e298e0b278651c515
# Parent  a366f5b90f659239ba55394c72993e7cce525371
Edit output parameter dialog: Use unique name for items in wxPropertyGrid by prefixing the section

diff -r a366f5b90f65 -r 20a35388e364 src/hugin1/hugin/EditOutputIniDialog.cpp
--- a/src/hugin1/hugin/EditOutputIniDialog.cpp	Sat Nov 28 10:27:27 2026 +0100
+++ b/src/hugin1/hugin/EditOutputIniDialog.cpp	Sat Nov 28 12:47:07 2026 +0100
@@ -158,15 +158,18 @@
 
 void EditOutputIniDialog::AddKey(wxPGProperty* section, const wxString& key, const wxString& value)
 {
+    // name has to be unique for all section
+    // therefore add section name before the key, separated by a dot
+    const wxString keyName = section->GetName() + "." + key;
     if (key.SubString(0, 8).CmpNoCase("Condition") == 0)
     {
-        wxPGProperty* p = m_grid->AppendIn(section, new wxStringProperty(key, wxPG_LABEL, value));
+        wxPGProperty* p = m_grid->AppendIn(section, new wxStringProperty(key, keyName, value));
         p->SetHelpString(_("Define which condition should be fulfilled to apply this setting.\nThe variables CameraModel, CameraMaker, Lens, HFOV, LensType, Focallength, Focallength35mm, Filename, Path, ImageCount, PanoHFOV and PanoVFOV can be used.\nFor comparison you can use ==, !=, =~ and !~ for strings and ==, !=, <, <=, > and >= for numbers."));
         return;
     };
     if (key.CmpNoCase("Projection") == 0)
     {
-        wxPGProperty* p = m_grid->AppendIn(section, new wxEnumProperty(key, wxPG_LABEL, ProjectionArray));
+        wxPGProperty* p = m_grid->AppendIn(section, new wxEnumProperty(key, keyName, ProjectionArray));
         if (value.IsEmpty())
         {
             p->SetValue(ProjectionArray[0]);
@@ -180,25 +183,25 @@
     };
     if (key.CmpNoCase("FOV") == 0)
     {
-        wxPGProperty* p = m_grid->AppendIn(section, new wxStringProperty(key, wxPG_LABEL, value));
+        wxPGProperty* p = m_grid->AppendIn(section, new wxStringProperty(key, keyName, value));
         p->SetHelpString(_("Select which field of view should be set.\nCan be Auto for automatic detection, or a fixed horizontal field of view (e.g. 120) or horizontal x vertical field of view (e.g. 140x70)."));
         return;
     };
     if (key.CmpNoCase("Canvas") == 0)
     {
-        wxPGProperty* p = m_grid->AppendIn(section, new wxStringProperty(key, wxPG_LABEL, value));
+        wxPGProperty* p = m_grid->AppendIn(section, new wxStringProperty(key, keyName, value));
         p->SetHelpString(_("Select to which size the canvas should be set.\nFor automatic detection use Auto or a scale factor in percent (e.g. 70%).\nOr give a width x height (e.g. 8000x4000)."));
         return;
     };
     if (key.CmpNoCase("Crop") == 0)
     {
-        wxPGProperty* p = m_grid->AppendIn(section, new wxStringProperty(key, wxPG_LABEL, value));
+        wxPGProperty* p = m_grid->AppendIn(section, new wxStringProperty(key, keyName, value));
         p->SetHelpString(_("Select which crop should be used.\nFor automatic detection use Auto, AutoOutside or AutoHDR.\nOr give 4 numbers as left, right, top and bottom. You can use absolute pixel values (e.g. 100,7900,1000,3900) or relative values by appending a percentage sign (e.g. 10,90,10,90%)."));
         return;
     };
     if (key.CmpNoCase("OutputExposure") == 0)
     {
-        wxPGProperty* p = m_grid->AppendIn(section, new wxStringProperty(key, wxPG_LABEL, value));
+        wxPGProperty* p = m_grid->AppendIn(section, new wxStringProperty(key, keyName, value));
         p->SetHelpString(_("Select which output exposure value should be used.\nFor automatic detection use Auto or give a fixed exposure value."));
         return;
     };
@@ -211,13 +214,13 @@
             // remove whitespace from begin and end
             values[i].Trim(true).Trim(false);
         }
-        wxPGProperty* p = m_grid->AppendIn(section, new wxMultiChoiceProperty(key, wxPG_LABEL, OutputTypeArray, values));
+        wxPGProperty* p = m_grid->AppendIn(section, new wxMultiChoiceProperty(key, keyName, OutputTypeArray, values));
         p->SetHelpString(_("Select which output types should be activated."));
         return;
     };
     if (key.CmpNoCase("Blender") == 0)
     {
-        wxPGProperty* p = m_grid->AppendIn(section, new wxEnumProperty(key, wxPG_LABEL, BlenderArray));
+        wxPGProperty* p = m_grid->AppendIn(section, new wxEnumProperty(key, keyName, BlenderArray));
         if (value.IsEmpty())
         {
             p->SetValue(BlenderArray[0]);
@@ -231,13 +234,13 @@
     };
     if (key.CmpNoCase("BlenderArgs") == 0)
     {
-        wxPGProperty* p = m_grid->AppendIn(section, new wxStringProperty(key, wxPG_LABEL, value));
+        wxPGProperty* p = m_grid->AppendIn(section, new wxStringProperty(key, keyName, value));
         p->SetHelpString(_("Select which arguments should be passed to the blender."));
         return;
     };
     if (key.CmpNoCase("LDRFileType") == 0)
     {
-        wxPGProperty* p = m_grid->AppendIn(section, new wxEnumProperty(key, wxPG_LABEL, LDRFileTypeArray));
+        wxPGProperty* p = m_grid->AppendIn(section, new wxEnumProperty(key, keyName, LDRFileTypeArray));
         if (value.IsEmpty())
         {
             p->SetValue(LDRFileTypeArray[0]);
@@ -251,13 +254,13 @@
     };
     if (key.CmpNoCase("LDRCompression") == 0)
     {
-        wxPGProperty* p = m_grid->AppendIn(section, new wxStringProperty(key, wxPG_LABEL, value));
+        wxPGProperty* p = m_grid->AppendIn(section, new wxStringProperty(key, keyName, value));
         p->SetHelpString(_("Select which compressions should be used for LDR images.\nFor TIFF images NONE, PACKBITS, LZW and DEFLATE are supported.\nFor JPEG image give a number as quality (0-100)."));
         return;
     };
     if (key.CmpNoCase("HDRFileType") == 0)
     {
-        wxPGProperty* p = m_grid->AppendIn(section, new wxEnumProperty(key, wxPG_LABEL, HDRFileTypeArray));
+        wxPGProperty* p = m_grid->AppendIn(section, new wxEnumProperty(key, keyName, HDRFileTypeArray));
         if (value.IsEmpty())
         {
             p->SetValue(HDRFileTypeArray[0]);
@@ -271,12 +274,12 @@
     };
     if (key.CmpNoCase("HDRCompression") == 0)
     {
-        wxPGProperty* p = m_grid->AppendIn(section, new wxStringProperty(key, wxPG_LABEL, value));
+        wxPGProperty* p = m_grid->AppendIn(section, new wxStringProperty(key, keyName, value));
         p->SetHelpString(_("Select which compressions should be used for HDR images.\nFor TIFF images NONE, PACKBITS, LZW and DEFLATE are supported."));
         return;
     }
     // fall-through, should not be called
-    wxPGProperty* newProperty = m_grid->AppendIn(section, new wxStringProperty(key, wxPG_LABEL, value));
+    wxPGProperty* newProperty = m_grid->AppendIn(section, new wxStringProperty(key, keyName, value));
 };
 
 void EditOutputIniDialog::ReadIni()
