mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 18:57:28 -07:00
General changes to the expert tab.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1809 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
8e4ac16006
commit
761b02df4d
8 changed files with 209 additions and 101 deletions
|
@ -53,12 +53,7 @@ namespace GreenshotPlugin.Controls {
|
|||
public void SetValue(Enum currentValue) {
|
||||
if (currentValue != null) {
|
||||
selectedEnum = currentValue;
|
||||
string selectedEnumKey = enumType.Name + "." + currentValue.ToString();
|
||||
if (Language.hasKey(selectedEnumKey)) {
|
||||
this.SelectedItem = Language.GetString(selectedEnumKey);
|
||||
} else {
|
||||
this.SelectedItem = currentValue.ToString();
|
||||
}
|
||||
this.SelectedItem = Language.Translate(currentValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,13 +70,7 @@ namespace GreenshotPlugin.Controls {
|
|||
this.Items.Clear();
|
||||
string enumTypeName = enumType.Name;
|
||||
foreach (var enumValue in availableValues) {
|
||||
string enumKey = enumTypeName + "." + enumValue.ToString();
|
||||
if (Language.hasKey(enumKey)) {
|
||||
string translation = Language.GetString(enumKey);
|
||||
this.Items.Add(translation);
|
||||
} else {
|
||||
this.Items.Add(enumValue.ToString());
|
||||
}
|
||||
this.Items.Add(Language.Translate((Enum)enumValue));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -341,7 +341,7 @@ namespace GreenshotPlugin.Controls {
|
|||
}
|
||||
} else if (typeof(TextBox).IsAssignableFrom(field.FieldType)) {
|
||||
TextBox textBox = controlObject as TextBox;
|
||||
textBox.Text = (string)section.Values[configBindable.PropertyName].Value;
|
||||
textBox.Text = section.Values[configBindable.PropertyName].ToString();
|
||||
} else if (typeof(GreenshotComboBox).IsAssignableFrom(field.FieldType)) {
|
||||
GreenshotComboBox comboxBox = controlObject as GreenshotComboBox;
|
||||
comboxBox.Populate(section.Values[configBindable.PropertyName].ValueType);
|
||||
|
@ -381,7 +381,7 @@ namespace GreenshotPlugin.Controls {
|
|||
iniDirty = true;
|
||||
} else if (typeof(TextBox).IsAssignableFrom(field.FieldType)) {
|
||||
TextBox textBox = controlObject as TextBox;
|
||||
section.Values[configBindable.PropertyName].Value = textBox.Text;
|
||||
section.Values[configBindable.PropertyName].UseValueOrDefault(textBox.Text);
|
||||
iniDirty = true;
|
||||
} else if (typeof(GreenshotComboBox).IsAssignableFrom(field.FieldType)) {
|
||||
GreenshotComboBox comboxBox = controlObject as GreenshotComboBox;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue