diff --git a/GreenshotCore/Configuration/CoreConfiguration.cs b/GreenshotCore/Configuration/CoreConfiguration.cs index 7beaddd7a..a4845e475 100644 --- a/GreenshotCore/Configuration/CoreConfiguration.cs +++ b/GreenshotCore/Configuration/CoreConfiguration.cs @@ -21,7 +21,7 @@ using System; using System.Collections.Generic; -namespace GreenshotCore.Configuration { +namespace Greenshot.Core { public enum Destinations {Editor=1, FileDefault=2, FileWithDialog=4, Clipboard=8, Printer=16, EMail=32} /// /// Description of CoreConfiguration. diff --git a/GreenshotCore/Core/ConfigHelper.cs b/GreenshotCore/Core/ConfigHelper.cs index 645befacd..541f8e112 100644 --- a/GreenshotCore/Core/ConfigHelper.cs +++ b/GreenshotCore/Core/ConfigHelper.cs @@ -25,7 +25,7 @@ using System.Reflection; using System.Text; using System.Windows.Forms; -namespace GreenshotCore.Configuration { +namespace Greenshot.Core { /// /// Attribute for telling that this class is linked to a section in the ini-configuration @@ -61,7 +61,9 @@ namespace GreenshotCore.Configuration { } // Interface for - public interface IniSection { + public class IniSection { + // Flag to specify if values have been changed + public bool IsDirty = false; } public class IniConfig { @@ -184,6 +186,8 @@ namespace GreenshotCore.Configuration { if (properties != null && properties.ContainsKey(propertyName)) { propertyValue = properties[propertyName]; } else { + // Mark as dirty, we didn't use properties from the file (even defaults from the default file are allowed) + section.IsDirty = true; propertyValue = iniPropertyAttribute.DefaultValue; LOG.Debug("Using default property for " + propertyName + " : " + propertyValue); } @@ -376,6 +380,7 @@ namespace GreenshotCore.Configuration { } } writer.WriteLine(); + section.IsDirty = false; } // Write left over properties