aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-05-10 20:20:20 +0200
committerJoe <rbo@gmx.us>2024-05-10 20:20:20 +0200
commitcd0fc6ff5daa6f59d542b9bfa15a8a48792c1d6e (patch)
tree06dcabb740969ecc63b4d06957144bbc9ebb4163 /src
parenti know very well it aint right but hey cut me some slack ok im doing myy best... (diff)
downloadhardflip-cd0fc6ff5daa6f59d542b9bfa15a8a48792c1d6e.tar.gz
hardflip-cd0fc6ff5daa6f59d542b9bfa15a8a48792c1d6e.tar.bz2
hardflip-cd0fc6ff5daa6f59d542b9bfa15a8a48792c1d6e.tar.xz
hardflip-cd0fc6ff5daa6f59d542b9bfa15a8a48792c1d6e.tar.zst
hardflip-cd0fc6ff5daa6f59d542b9bfa15a8a48792c1d6e.zip
new mode ok
Diffstat (limited to 'src')
-rw-r--r--src/c_defs.go3
-rw-r--r--src/e_events.go4
-rw-r--r--src/e_keys.go6
-rw-r--r--src/i_help.go68
-rw-r--r--src/i_insert.go2
-rw-r--r--src/i_ui.go3
6 files changed, 80 insertions, 6 deletions
diff --git a/src/c_defs.go b/src/c_defs.go
index 3aa1884..a905897 100644
--- a/src/c_defs.go
+++ b/src/c_defs.go
@@ -78,7 +78,8 @@ const (
MKDIR_MODE
INSERT_MODE
RENAME_MODE
- MODE_MAX = RENAME_MODE
+ HELP_MODE
+ MODE_MAX = HELP_MODE
)
const (
diff --git a/src/e_events.go b/src/e_events.go
index c30946d..783e707 100644
--- a/src/e_events.go
+++ b/src/e_events.go
@@ -400,10 +400,6 @@ func e_deep_copy_host(base *HostNode) HostNode {
return new_host
}
-// func e_paste_item(litems *ItemsList, item ItemsNode) {
-// curr := litems.curr
-// }
-
// screen events such as keypresses
func e_events(data *HardData, fp [MODE_MAX + 1]key_event_mode_func) {
ui := &data.ui
diff --git a/src/e_keys.go b/src/e_keys.go
index 667ba3d..28cc628 100644
--- a/src/e_keys.go
+++ b/src/e_keys.go
@@ -246,6 +246,8 @@ func e_normal_events(data *HardData, ui *HardUI, event tcell.EventKey) bool {
data.litems.curr.is_dir() == false {
ui.mode = RENAME_MODE
ui.buff = data.litems.curr.Host.Name
+ } else if event.Rune() == '?' {
+ ui.mode = HELP_MODE
}
return false
}
@@ -829,3 +831,7 @@ func e_rename_events(data *HardData, ui *HardUI, event tcell.EventKey) bool {
ui.buff = ""
return false
}
+
+func e_help_events(data *HardData, ui *HardUI, event tcell.EventKey) bool {
+ return false
+}
diff --git a/src/i_help.go b/src/i_help.go
new file mode 100644
index 0000000..5c179fe
--- /dev/null
+++ b/src/i_help.go
@@ -0,0 +1,68 @@
+/*
+ * ========================
+ * ===== ===============
+ * ====== ================
+ * ====== ================
+ * ====== ==== ==== ==
+ * ====== === == = =
+ * ====== === = == =
+ * = === === = == ====
+ * = === === = == = =
+ * == ===== ==== ==
+ * ========================
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ * Copyright (c) 2023-2024, Joe
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of the organization nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ''AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * hardflip: src/i_help.go
+ * Fri May 10 15:40:13 2024
+ * Joe
+ *
+ * helping the user
+ */
+
+package main
+
+func i_draw_help(ui HardUI) {
+ if ui.dim[W] < 8 || ui.dim[H] < 4 {
+ return
+ }
+ win := Quad{
+ 4,
+ 4,
+ ui.dim[W] - 4,
+ ui.dim[H] - 4,
+ }
+ i_draw_box(ui.s,
+ win.L, win.T, win.R, win.B,
+ ui.style[BOX_STYLE], ui.style[HEAD_STYLE],
+ " Keys ", true)
+}
diff --git a/src/i_insert.go b/src/i_insert.go
index 27c150a..08efdb4 100644
--- a/src/i_insert.go
+++ b/src/i_insert.go
@@ -43,7 +43,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
* hardflip: src/i_insert.go
- * Tue May 07 10:23:23 2024
+ * Fri May 10 15:40:07 2024
* Joe
*
* insert a new host
diff --git a/src/i_ui.go b/src/i_ui.go
index 09a1d65..327eb4c 100644
--- a/src/i_ui.go
+++ b/src/i_ui.go
@@ -713,6 +713,7 @@ func i_ui(data_dir string) {
MKDIR_MODE: e_mkdir_events,
INSERT_MODE: e_insert_events,
RENAME_MODE: e_rename_events,
+ HELP_MODE: e_help_events,
}
for {
data.ui.s.Clear()
@@ -751,6 +752,8 @@ func i_ui(data_dir string) {
}
case RENAME_MODE:
i_prompt_insert(data.ui, data.litems.curr)
+ case HELP_MODE:
+ i_draw_help(data.ui)
}
data.ui.s.Show()
e_events(&data, fp)