From b42e73a6d4db31ca6b68f4b6d3a7cea75552ec5e Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 19 Jan 2024 20:20:20 +0100 Subject: cool --- i_host.go | 4 ++-- i_info.go | 5 ++++- i_ui.go | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/i_host.go b/i_host.go index bcb39e1..0ff0eb2 100644 --- a/i_host.go +++ b/i_host.go @@ -43,7 +43,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * hardflip: src/i_host.go - * Fri Jan 19 12:52:11 2024 + * Fri Jan 19 18:44:09 2024 * Joe * * interfacing hosts @@ -104,7 +104,7 @@ func i_draw_host_panel(ui HardUI, icons bool, litems *ItemsList, data *HardData) ui.dim[W] / 3, ui.dim[H] - 2, " Hosts ", false) line := 1 - if litems.head == nil { + if litems == nil || litems.head == nil { return } for ptr := litems.draw; ptr != nil && line < ui.dim[H] - 2; ptr = ptr.next { diff --git a/i_info.go b/i_info.go index 8b5ccd6..271f1d0 100644 --- a/i_info.go +++ b/i_info.go @@ -43,7 +43,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * hardflip: src/i_info.go - * Fri Jan 19 12:48:40 2024 + * Fri Jan 19 18:44:13 2024 * Joe * * interfacing informations about items @@ -304,6 +304,9 @@ func i_draw_info_panel(ui HardUI, percent bool, litems *ItemsList) { ui.s.SetContent(ui.dim[W] / 3, 0, tcell.RuneTTee, nil, ui.def_style) ui.s.SetContent(ui.dim[W] / 3, ui.dim[H] - 2, tcell.RuneBTee, nil, ui.def_style) + if litems == nil { + return + } // number display if litems.head != nil { text := " " + strconv.Itoa(litems.curr.ID) + " of " + diff --git a/i_ui.go b/i_ui.go index db83c2c..9b7456b 100644 --- a/i_ui.go +++ b/i_ui.go @@ -43,7 +43,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * hardflip: src/i_ui.go - * Fri Jan 19 17:09:15 2024 + * Fri Jan 19 18:45:35 2024 * Joe * * interfacing with the user @@ -267,6 +267,8 @@ func i_draw_load_ui(ui *HardUI) { return } ui.s.Clear() + i_draw_host_panel(*ui, false, nil, nil) + i_draw_info_panel(*ui, false, nil) // TODO: msg mode text := "Loading " + strconv.Itoa(g_load_count) + " hosts" text_len := len(text) / 2 -- cgit v1.2.3