aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-04-16 20:20:20 +0200
committerJoe <rbo@gmx.us>2024-04-16 20:20:20 +0200
commit14329a6d21272feb06378a6ae39e12c8be4df5e7 (patch)
treec96863a880ba36dc9e0294ec1b1833b16d61ab06 /src
parentqwe (diff)
downloadhardflip-14329a6d21272feb06378a6ae39e12c8be4df5e7.tar.gz
hardflip-14329a6d21272feb06378a6ae39e12c8be4df5e7.tar.bz2
hardflip-14329a6d21272feb06378a6ae39e12c8be4df5e7.tar.xz
hardflip-14329a6d21272feb06378a6ae39e12c8be4df5e7.tar.zst
hardflip-14329a6d21272feb06378a6ae39e12c8be4df5e7.zip
cool
Diffstat (limited to 'src')
-rw-r--r--src/i_events.go16
-rw-r--r--src/i_insert.go7
-rw-r--r--src/i_ui.go7
3 files changed, 27 insertions, 3 deletions
diff --git a/src/i_events.go b/src/i_events.go
index 268fda5..75d9941 100644
--- a/src/i_events.go
+++ b/src/i_events.go
@@ -582,6 +582,9 @@ func i_events(data *HardData) {
if data.insert.Protocol == PROTOCOL_RDP &&
data.ui.insert_sel == INS_PROTOCOL {
data.ui.insert_sel = INS_RDP_HOST
+ } else if data.insert.Protocol == PROTOCOL_CMD &&
+ data.ui.insert_sel == INS_PROTOCOL {
+ data.ui.insert_sel = INS_CMD_CMD
} else if data.ui.insert_sel < data.ui.insert_sel_max {
data.ui.insert_sel += 1
}
@@ -590,6 +593,9 @@ func i_events(data *HardData) {
if data.insert.Protocol == PROTOCOL_RDP &&
data.ui.insert_sel == INS_RDP_HOST {
data.ui.insert_sel = INS_PROTOCOL
+ } else if data.insert.Protocol == PROTOCOL_CMD &&
+ data.ui.insert_sel == INS_CMD_CMD {
+ data.ui.insert_sel = INS_PROTOCOL
} else if data.ui.insert_sel > INS_PROTOCOL {
data.ui.insert_sel -= 1
}
@@ -643,6 +649,8 @@ func i_events(data *HardData) {
break
case INS_RDP_QUALITY: break
case INS_RDP_DRIVE + len(data.insert.Drive): break
+ case INS_CMD_CMD: ui.buff = data.insert.Host
+ case INS_CMD_SHELL: ui.buff = data.insert.Shell[0]
case INS_SSH_NOTE,
INS_RDP_NOTE + len(data.insert.Drive):
ui.buff = data.insert.Note
@@ -786,7 +794,9 @@ func i_events(data *HardData) {
INS_RDP_USER,
INS_RDP_PASS,
INS_RDP_FILE,
- INS_RDP_NOTE + len(data.insert.Drive):
+ INS_RDP_NOTE + len(data.insert.Drive),
+ INS_CMD_CMD,
+ INS_CMD_SHELL:
if event.Key() == tcell.KeyEnter {
switch data.ui.insert_sel {
case INS_SSH_HOST,
@@ -825,6 +835,10 @@ func i_events(data *HardData) {
data.insert.Domain = ui.buff
case INS_RDP_FILE:
data.insert.RDPFile = ui.buff
+ case INS_CMD_CMD:
+ data.insert.Host = ui.buff
+ case INS_CMD_SHELL:
+ data.insert.Shell[0] = ui.buff
case INS_SSH_NOTE,
INS_RDP_NOTE + len(data.insert.Drive):
data.insert.Note = ui.buff
diff --git a/src/i_insert.go b/src/i_insert.go
index f1838d5..c9dbed6 100644
--- a/src/i_insert.go
+++ b/src/i_insert.go
@@ -569,6 +569,13 @@ func i_draw_insert_cmd(ui HardUI, line int, win Quad, in *HostNode) int {
}
i_draw_text_box(ui, win.T + line, win, "Shell", in.Shell[0],
INS_CMD_SHELL, red);
+ if red == true {
+ if line += 1; win.T + line >= win.B { return line }
+ text := "file does not exist"
+ i_draw_text(ui.s, ui.dim[W] / 2, win.T + line,
+ win.R - 1, win.T + line, ui.style[ERR_STYLE], text)
+ }
+ red = false
return line
}
diff --git a/src/i_ui.go b/src/i_ui.go
index 7544316..f0d889c 100644
--- a/src/i_ui.go
+++ b/src/i_ui.go
@@ -419,8 +419,7 @@ func i_prompt_dir(ui HardUI, prompt string, home_dir string) {
err != nil {
style = style.Foreground(tcell.ColorRed)
} else if stat.IsDir() == true {
- style = style.Foreground(tcell.ColorGreen).
- Bold(true)
+ style = style.Foreground(tcell.ColorGreen).Bold(false)
} else {
style = style.Foreground(tcell.ColorRed)
}
@@ -757,6 +756,10 @@ func i_ui(data_dir string) {
} else {
i_prompt_dir(data.ui, "Local directory: ", home_dir)
}
+ case INS_CMD_CMD:
+ i_prompt_generic(data.ui, "Command: ", false, "")
+ case INS_CMD_SHELL:
+ i_prompt_generic(data.ui, "Shell: ", false, home_dir)
}
if len(data.insert.Drive) > 0 &&
data.ui.insert_sel >= INS_RDP_DRIVE &&