aboutsummaryrefslogtreecommitdiffstats
path: root/src/i_ui.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-02-09 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-02-09 20:20:20 +0100
commitc57bd4c629eca16d665b116a8b296fc595413c43 (patch)
tree63cabb012487b158cb861d6c49448db0e8f660c3 /src/i_ui.go
parent2000 sloc (diff)
downloadhardflip-c57bd4c629eca16d665b116a8b296fc595413c43.tar.gz
hardflip-c57bd4c629eca16d665b116a8b296fc595413c43.tar.bz2
hardflip-c57bd4c629eca16d665b116a8b296fc595413c43.tar.xz
hardflip-c57bd4c629eca16d665b116a8b296fc595413c43.tar.zst
hardflip-c57bd4c629eca16d665b116a8b296fc595413c43.zip
fine actually
Diffstat (limited to 'src/i_ui.go')
-rw-r--r--src/i_ui.go23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/i_ui.go b/src/i_ui.go
index eefb79f..312f8b5 100644
--- a/src/i_ui.go
+++ b/src/i_ui.go
@@ -66,6 +66,7 @@ type HardUI struct {
style [7]tcell.Style
dim [2]int
err [2]string
+ buff string
}
func i_left_right(text_len int, ui *HardUI) (int, int) {
@@ -177,6 +178,9 @@ func i_draw_bottom_text(ui HardUI) {
text = "Loading..."
case ERROR_MODE:
text = ERROR_KEYS_HINTS
+ case WELCOME_MODE:
+ default:
+ text = ""
}
i_draw_text(ui.s,
1, ui.dim[H] - 1, ui.dim[W] - 1, ui.dim[H] - 1,
@@ -268,6 +272,16 @@ func i_draw_welcome_box(ui HardUI) {
i_draw_text(ui.s, l, line, r, line, ui.style[STYLE_DEF], text)
}
+func i_prompt_gpg(ui HardUI) {
+ text := "gpg: "
+ i_draw_text(ui.s,
+ 1, ui.dim[H] - 1, ui.dim[W] - 1, ui.dim[H] - 1,
+ ui.style[STYLE_DEF], text)
+ ui.s.ShowCursor(6 + len(ui.buff), ui.dim[H] - 1)
+ i_draw_text(ui.s, 6, ui.dim[H] - 1, ui.dim[W], ui.dim[H] - 1,
+ ui.style[STYLE_DEF], ui.buff)
+}
+
func i_draw_zhosts_box(ui HardUI) {
i_draw_msg(ui.s, 1, ui.style[STYLE_BOX], ui.dim, " No hosts ")
text := "Hosts list empty. Add hosts/folders by pressing (a/m)"
@@ -469,6 +483,9 @@ func i_ui(data_dir string) {
data_dir,
load_err,
}
+ if data.opts.GPG == DEFAULT_OPTS.GPG && data.litems.head == nil {
+ data.ui.mode = WELCOME_MODE
+ }
for {
data.ui.s.Clear()
i_draw_bottom_text(data.ui)
@@ -478,8 +495,12 @@ func i_ui(data_dir string) {
if data.load_err != nil && len(data.load_err) > 0 {
data.ui.mode = ERROR_MODE
}
- if data.opts.GPG == DEFAULT_OPTS.GPG && data.litems.head == nil {
+ if data.ui.mode == WELCOME_MODE {
i_draw_welcome_box(data.ui)
+ if len(data.opts.GPG) == 0 {
+ i_prompt_gpg(data.ui)
+ } else {
+ }
} else if data.litems.head == nil {
i_draw_zhosts_box(data.ui)
}