aboutsummaryrefslogtreecommitdiffstats
path: root/i_ui.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-01-08 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-01-08 20:20:20 +0100
commit28108920b5e4c6ad916b4c974319b14b3be27798 (patch)
tree2e6c662bedb8162aa1342dae27eaf140104f68d6 /i_ui.go
parentcool (diff)
downloadhardflip-28108920b5e4c6ad916b4c974319b14b3be27798.tar.gz
hardflip-28108920b5e4c6ad916b4c974319b14b3be27798.tar.bz2
hardflip-28108920b5e4c6ad916b4c974319b14b3be27798.tar.xz
hardflip-28108920b5e4c6ad916b4c974319b14b3be27798.tar.zst
hardflip-28108920b5e4c6ad916b4c974319b14b3be27798.zip
factor
Diffstat (limited to '')
-rw-r--r--i_ui.go16
1 files changed, 2 insertions, 14 deletions
diff --git a/i_ui.go b/i_ui.go
index f81e04c..2d5294e 100644
--- a/i_ui.go
+++ b/i_ui.go
@@ -43,7 +43,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* hardflip: src/i_ui.go
- * Mon Jan 08 12:18:01 2024
+ * Mon Jan 08 14:53:10 2024
* Joe
*
* interfacing with the user
@@ -61,8 +61,6 @@ type HardUI struct {
s tcell.Screen
mode uint8
sel_max int
- count_dirs int
- count_hosts int
def_style tcell.Style
dir_style tcell.Style
title_style tcell.Style
@@ -321,7 +319,6 @@ func i_info_panel(ui HardUI, lhost *HostList) {
if lhost.head == nil {
return
}
- // HACK: litems instead of this mess
// host = lhost.sel(ui.sel_id)
host_type = host.protocol_str()
// name, type
@@ -481,20 +478,11 @@ func i_info_panel(ui HardUI, lhost *HostList) {
}
}
-func i_get_sel_max(ldirs *DirsList) (int, int, int) {
- count_dirs, count_hosts := ldirs.count()
-
- count_dirs -= 1
- return count_dirs + count_hosts, count_dirs, count_hosts
-}
-
func i_ui(data *HardData) {
// TODO: replace everything ui with litems
var err error
ui := &data.ui
- // TODO: get better counts
- // NOTE: put this in c_load_data and also produce better code
- ui.sel_max, ui.count_dirs, ui.count_hosts = i_get_sel_max(data.ldirs)
+ ui.sel_max = data.litems.last.ID
ui.s, err = tcell.NewScreen()
if err != nil {