aboutsummaryrefslogtreecommitdiffstats
path: root/src/i_events.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-04-09 20:20:20 +0200
committerJoe <rbo@gmx.us>2024-04-09 20:20:20 +0200
commit7b6a12ee62afca66f4f58f8789a9388d56944897 (patch)
tree1471c7c64776486dd6046225cf8de026a53c0061 /src/i_events.go
parentmuch better roadmap (diff)
downloadhardflip-7b6a12ee62afca66f4f58f8789a9388d56944897.tar.gz
hardflip-7b6a12ee62afca66f4f58f8789a9388d56944897.tar.bz2
hardflip-7b6a12ee62afca66f4f58f8789a9388d56944897.tar.xz
hardflip-7b6a12ee62afca66f4f58f8789a9388d56944897.tar.zst
hardflip-7b6a12ee62afca66f4f58f8789a9388d56944897.zip
going good
Diffstat (limited to '')
-rw-r--r--src/i_events.go30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/i_events.go b/src/i_events.go
index de0a99a..a82c953 100644
--- a/src/i_events.go
+++ b/src/i_events.go
@@ -43,7 +43,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* hardflip: src/i_events.go
- * Thu Mar 14 10:38:55 2024
+ * Tue Apr 09 14:34:02 2024
* Joe
*
* events in the code
@@ -174,8 +174,8 @@ func i_reload_data(data *HardData) {
tmp_name = data.litems.curr.Dirs.Name
tmp_parent_path = data.litems.curr.Dirs.Parent.path()
} else {
- tmp_name = data.litems.curr.Host.Filename
- tmp_parent_path = data.litems.curr.Host.Parent.path()
+ tmp_name = data.litems.curr.Host.filename
+ tmp_parent_path = data.litems.curr.Host.parent.path()
}
}
conf_dir := c_get_conf_dir(&data.load_err)
@@ -205,8 +205,8 @@ func i_reload_data(data *HardData) {
}
}
} else {
- if curr.Host.Filename == tmp_name {
- if curr.Host.Parent.path() == tmp_parent_path {
+ if curr.Host.filename == tmp_name {
+ if curr.Host.parent.path() == tmp_parent_path {
data.litems.curr = curr
return
}
@@ -263,14 +263,14 @@ func i_delete_host(data *HardData) error {
if host == nil {
return nil
}
- file_path := data.data_dir + host.Parent.path() + host.Filename
+ file_path := data.data_dir + host.parent.path() + host.filename
if err := os.Remove(file_path); err != nil {
c_error_mode("can't remove " + file_path, err, &data.ui)
return err
}
tmp := data.litems.curr.prev
- host.Parent.lhost.del(host)
+ host.parent.lhost.del(host)
data.litems.del(data.litems.curr)
if tmp == nil {
tmp = data.litems.head
@@ -321,7 +321,6 @@ func i_set_protocol_defaults(data *HardData, in *HostNode) {
switch in.Protocol {
case PROTOCOL_SSH:
in.Port = 22
- in.Jump.Port = 22
data.ui.insert_sel_max = 11
case PROTOCOL_RDP:
in.Port = 3389
@@ -543,7 +542,7 @@ func i_events(data *HardData) {
data.insert.Name = ui.buff
ui.buff = ""
if data.litems.curr != nil {
- data.insert.Parent = data.litems.curr.path_node()
+ data.insert.parent = data.litems.curr.path_node()
}
} else {
i_readline(event, data)
@@ -622,11 +621,11 @@ func i_events(data *HardData) {
break
} else {
name := data.insert.Name
- parent := data.insert.Parent
+ parent := data.insert.parent
data.insert = nil
data.insert = &HostNode{}
data.insert.Name = name
- data.insert.Parent = parent
+ data.insert.parent = parent
data.insert.Protocol = int8(event.Rune() - 48 - 1)
data.ui.insert_sel_ok = false
ui.s.HideCursor()
@@ -645,7 +644,13 @@ func i_events(data *HardData) {
data.opts.GPG)
data.insert.Pass = pass
case 5: data.insert.Priv = ui.buff
- case 6: data.insert.Jump.Host = ui.buff
+ case 6:
+ data.insert.Jump.Host = ui.buff
+ if len(ui.buff) > 0 {
+ data.insert.Jump.Port = 22
+ } else {
+ data.insert.Jump.Port = 0
+ }
case 7:
tmp, _ := strconv.Atoi(ui.buff)
data.insert.Jump.Port = uint16(tmp)
@@ -665,7 +670,6 @@ func i_events(data *HardData) {
}
}
}
- // TODO: reset data.insert to nil on validate
case MKDIR_MODE:
if event.Key() == tcell.KeyEscape ||
event.Key() == tcell.KeyCtrlC {