aboutsummaryrefslogtreecommitdiffstats
path: root/src/e_keys.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-05-16 20:20:20 +0200
committerJoe <rbo@gmx.us>2024-05-16 20:20:20 +0200
commitc545dd21171200889053694804eae6ca839379a2 (patch)
tree9295f4df134839a2a7a468a994a8b096b6dc89d0 /src/e_keys.go
parentv0.7 (diff)
downloadhardflip-c545dd21171200889053694804eae6ca839379a2.tar.gz
hardflip-c545dd21171200889053694804eae6ca839379a2.tar.bz2
hardflip-c545dd21171200889053694804eae6ca839379a2.tar.xz
hardflip-c545dd21171200889053694804eae6ca839379a2.tar.zst
hardflip-c545dd21171200889053694804eae6ca839379a2.zip
prompt ssh ok
Diffstat (limited to 'src/e_keys.go')
-rw-r--r--src/e_keys.go21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/e_keys.go b/src/e_keys.go
index bc30053..8094dd1 100644
--- a/src/e_keys.go
+++ b/src/e_keys.go
@@ -294,20 +294,33 @@ func e_welcome_events(data *HardData, ui *HardUI, event tcell.EventKey) bool {
ui.s.Fini()
os.Exit(0)
}
- if len(data.opts.GPG) == 0 {
+ switch ui.welcome_screen {
+ case WELCOME_GPG:
if event.Rune() < '1' || event.Rune() > '9' {
return true
} else {
data.opts.GPG = data.keys[event.Rune() - 48 - 1][0]
ui.s.HideCursor()
+ ui.welcome_screen += 1
}
- } else {
+ case WELCOME_CONFIRM_GPG:
if event.Rune() == 'y' {
- ui.mode = NORMAL_MODE
- c_write_options(data.opts.file, data.opts, &data.load_err)
+ ui.welcome_screen += 1
} else if event.Rune() == 'n' {
data.opts.GPG = ""
+ ui.welcome_screen -= 1
+ }
+ case WELCOME_SSH:
+ if event.Key() == tcell.KeyEnter {
+ data.opts.DefSSH = ui.buff.str()
+ ui.welcome_screen += 1
+ ui.s.HideCursor()
+ ui.buff.empty()
+ } else {
+ e_readline(event, &ui.buff, ui, data.home_dir)
}
+ case WELCOME_END:
+ return false
}
return false
}