diff options
author | Joe <rbo@gmx.us> | 2024-03-04 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-03-04 20:20:20 +0100 |
commit | 69a9f082280331007955ccc0a41fba34dbeee9c0 (patch) | |
tree | 886d3f6a0023c98cac7b79e2fb4a2bfbb1624e9a /src/i_events.go | |
parent | qwe (diff) | |
download | hardflip-69a9f082280331007955ccc0a41fba34dbeee9c0.tar.gz hardflip-69a9f082280331007955ccc0a41fba34dbeee9c0.tar.bz2 hardflip-69a9f082280331007955ccc0a41fba34dbeee9c0.tar.xz hardflip-69a9f082280331007955ccc0a41fba34dbeee9c0.tar.zst hardflip-69a9f082280331007955ccc0a41fba34dbeee9c0.zip |
good progress
Diffstat (limited to 'src/i_events.go')
-rw-r--r-- | src/i_events.go | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/i_events.go b/src/i_events.go index 6582ac6..39db96a 100644 --- a/src/i_events.go +++ b/src/i_events.go @@ -570,10 +570,12 @@ func i_events(data *HardData) { } else if event.Key() == tcell.KeyEnter { data.ui.insert_sel_ok = true switch data.ui.insert_sel { - case 1: - ui.buff = data.insert.Host - case 2: - ui.buff = strconv.Itoa(int(data.insert.Port)) + case 1: ui.buff = data.insert.Host + case 2: ui.buff = strconv.Itoa(int(data.insert.Port)) + case 3: ui.buff = data.insert.User + case 4: break + case 5: ui.buff = data.insert.Priv + case 6: ui.buff = data.insert.Jump.Host } } } else { @@ -604,21 +606,18 @@ func i_events(data *HardData) { } case 1, 2, 3, 4, 5, 6: if event.Key() == tcell.KeyEnter { - if data.ui.insert_sel == 1 { - data.insert.Host = ui.buff - } else if data.ui.insert_sel == 2 { + switch data.ui.insert_sel { + case 1: data.insert.Host = ui.buff + case 2: tmp, _ := strconv.Atoi(ui.buff) data.insert.Port = uint16(tmp) - } else if data.ui.insert_sel == 3 { - data.insert.User = ui.buff - } else if data.ui.insert_sel == 4 { + case 3: data.insert.User = ui.buff + case 4: pass, _ := c_encrypt_str(ui.buff, data.opts.GPG) data.insert.Pass = pass - } else if data.ui.insert_sel == 5 { - data.insert.Priv = ui.buff - } else if data.ui.insert_sel == 6 { - data.insert.Jump.Host = ui.buff + case 5: data.insert.Priv = ui.buff + case 6: data.insert.Jump.Host = ui.buff } data.ui.insert_sel_ok = false ui.buff = "" |