mirror of
https://github.com/greenshot/greenshot
synced 2025-07-30 03:30:02 -07:00
Some small changes for a dirty flag in the configuration
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@811 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
afc764aa41
commit
09f5dda19f
2 changed files with 8 additions and 3 deletions
|
@ -21,7 +21,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
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}
|
public enum Destinations {Editor=1, FileDefault=2, FileWithDialog=4, Clipboard=8, Printer=16, EMail=32}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Description of CoreConfiguration.
|
/// Description of CoreConfiguration.
|
||||||
|
|
|
@ -25,7 +25,7 @@ using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace GreenshotCore.Configuration {
|
namespace Greenshot.Core {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Attribute for telling that this class is linked to a section in the ini-configuration
|
/// Attribute for telling that this class is linked to a section in the ini-configuration
|
||||||
|
@ -61,7 +61,9 @@ namespace GreenshotCore.Configuration {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Interface for
|
// Interface for
|
||||||
public interface IniSection {
|
public class IniSection {
|
||||||
|
// Flag to specify if values have been changed
|
||||||
|
public bool IsDirty = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class IniConfig {
|
public class IniConfig {
|
||||||
|
@ -184,6 +186,8 @@ namespace GreenshotCore.Configuration {
|
||||||
if (properties != null && properties.ContainsKey(propertyName)) {
|
if (properties != null && properties.ContainsKey(propertyName)) {
|
||||||
propertyValue = properties[propertyName];
|
propertyValue = properties[propertyName];
|
||||||
} else {
|
} 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;
|
propertyValue = iniPropertyAttribute.DefaultValue;
|
||||||
LOG.Debug("Using default property for " + propertyName + " : " + propertyValue);
|
LOG.Debug("Using default property for " + propertyName + " : " + propertyValue);
|
||||||
}
|
}
|
||||||
|
@ -376,6 +380,7 @@ namespace GreenshotCore.Configuration {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
writer.WriteLine();
|
writer.WriteLine();
|
||||||
|
section.IsDirty = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write left over properties
|
// Write left over properties
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue