|
8 | 8 | using KeePass.Plugins; |
9 | 9 | using KeePass.Resources; |
10 | 10 | using KeePass.UI; |
| 11 | +using KeePass.Util; |
11 | 12 | using KeePassLib; |
12 | 13 | using KeePassLib.Cryptography.PasswordGenerator; |
13 | 14 | using KeePassLib.Security; |
@@ -238,12 +239,14 @@ private bool InitializeChildView(TabPage page, String uuid) { |
238 | 239 | picker.ShowCheckBox = true; |
239 | 240 | et_to_control[t] = picker; |
240 | 241 | } |
241 | | - else if (t.type == "Inline" || t.type == "Protected Inline") { |
| 242 | + else if (t.type == "Inline" || t.type == "Protected Inline" || t.type == "Inline URL") { |
242 | 243 | TextBox box = new TextBox(); |
243 | 244 | box.Top = control_offset_y; |
244 | 245 | box.Left = LEFT_CONTROL_OFFSET; |
245 | | - box.Width = CONTROL_WIDTH; |
| 246 | + box.Width = t.type == "Inline URL" ? CONTROL_WIDTH-30 : CONTROL_WIDTH; |
246 | 247 | int lines = LinesFromOption(t.options); |
| 248 | + if (t.type == "Inline URL") |
| 249 | + lines = 1; |
247 | 250 | if (lines > 1) { |
248 | 251 | box.Multiline = true; |
249 | 252 | box.AcceptsReturn = true; |
@@ -278,9 +281,15 @@ private bool InitializeChildView(TabPage page, String uuid) { |
278 | 281 | } |
279 | 282 | if (t.fieldName == PwDefs.PasswordField) { |
280 | 283 | entry_pass = current_password_field = sedit; |
281 | | - |
282 | 284 | } |
| 285 | + }else if (t.type == "Inline URL") { |
| 286 | + var link= new LinkLabel {Text = "Open"}; |
| 287 | + link.LinkClicked += (sender, args) => WinUtil.OpenUrl(box.Text??"", form.EntryRef); |
| 288 | + link.Location = new Point(box.Left + box.Width + 10, control_offset_y); |
| 289 | + link.Width = 50; |
| 290 | + et_to_control2[t] = link; |
283 | 291 | } |
| 292 | + |
284 | 293 | } |
285 | 294 | else if (t.type == "Popout" || t.type == "Protected Popout") { |
286 | 295 | Button btn = new Button(); |
@@ -388,7 +397,7 @@ private void save_child_vals() { |
388 | 397 | CheckBox checkbox = (CheckBox)pair.Value; |
389 | 398 | str = new ProtectedString(false, checkbox.Checked.ToString()); |
390 | 399 | } |
391 | | - else if (t.type == "Inline") { |
| 400 | + else if (t.type == "Inline" || t.type == "Inline URL") { |
392 | 401 | TextBox box = (TextBox)pair.Value; |
393 | 402 | str = new ProtectedString(false, box.Text == null ? "" : box.Text.Replace("\r", "")); |
394 | 403 | } |
@@ -470,7 +479,7 @@ private void init_child_vals() { |
470 | 479 | str = form.EntryStrings.Get(get_name); |
471 | 480 | if (str == null) |
472 | 481 | str = new ProtectedString(t.type.StartsWith("Protected"), ""); |
473 | | - if (t.type == "Inline") { |
| 482 | + if (t.type == "Inline" || t.type == "Inline URL") { |
474 | 483 | TextBox box = (TextBox)pair.Value; |
475 | 484 | String val = str.ReadString(); |
476 | 485 | val = val.Replace("\r", ""); |
|
0 commit comments