Skip to content

Commit

Permalink
Track username vs text field type via a combobox Tag
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyrat committed Dec 17, 2023
1 parent 4d4366a commit f56b810
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
19 changes: 12 additions & 7 deletions KeePassRPC/Forms/KeeFieldForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,17 @@ public KeeFieldForm(string name, string value, string id, FormFieldType type, in
if (value == "{USERNAME}")
{
textBox2.Text = Value = value;
comboBox1.Text = "Username";
comboBox1.Text = "Text";
comboBox1.Tag = "username";
comboBox1.Enabled = false;
label6.Visible = true;
} else
if (value == "{PASSWORD}")
} else if (value == "{PASSWORD}")
{
textBox2.Text = Value = value;
comboBox1.Text = "Password";
comboBox1.Enabled = false;
label7.Visible = true;
}
else
} else
{
if (type == FormFieldType.FFTpassword)
comboBox1.Text = "Password";
Expand All @@ -57,7 +56,11 @@ public KeeFieldForm(string name, string value, string id, FormFieldType type, in
else if (type == FormFieldType.FFTtext)
comboBox1.Text = "Text";
else if (type == FormFieldType.FFTusername)
comboBox1.Text = "Username";
{
// Shouldn't happen but gives a way out if old bad data is present
comboBox1.Text = "Text";
comboBox1.Tag = "username";
}
else if (type == FormFieldType.FFTcheckbox)
comboBox1.Text = "Checkbox";

Expand Down Expand Up @@ -114,7 +117,9 @@ private void button1_Click(object sender, EventArgs e)
else if (comboBox1.Text == "Radio")
Type = FormFieldType.FFTradio;
else if (comboBox1.Text == "Text")
Type = FormFieldType.FFTtext;
{
Type = (string)comboBox1.Tag == "username" ? FormFieldType.FFTusername : FormFieldType.FFTtext;
}
else if (comboBox1.Text == "Username")
Type = FormFieldType.FFTusername;
else if (comboBox1.Text == "Checkbox")
Expand Down
2 changes: 1 addition & 1 deletion KeePassRPC/KeePassRPCExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace KeePassRPC
public sealed class KeePassRPCExt : Plugin
{
// version information
public static readonly Version PluginVersion = new Version(1, 15, 1);
public static readonly Version PluginVersion = new Version(1, 16, 0);

public override string UpdateUrl
{
Expand Down
2 changes: 1 addition & 1 deletion KeePassRPC/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@

// Assembly version information
[assembly: AssemblyVersion("2.0.48.*")]
[assembly: AssemblyFileVersion("1.15.1.0")] // also change PluginVersion in KeePassRPCExt.cs!
[assembly: AssemblyFileVersion("1.16.0.0")] // also change PluginVersion in KeePassRPCExt.cs!

0 comments on commit f56b810

Please sign in to comment.