diff options
author | Daniel Kamil Kozar <dkk089@gmail.com> | 2019-04-14 21:34:22 +0200 |
---|---|---|
committer | Daniel Kamil Kozar <dkk089@gmail.com> | 2019-04-15 21:27:09 +0200 |
commit | a9c580a24348540f838c56deeafd276c725fd0fc (patch) | |
tree | 6b21ea718780072eb1fa808587aaa36ca275d48a | |
parent | 59268fe770f6bb230b7dc49f3b5d5e7ac82fbcba (diff) |
Allow using "b" and "B" key bindings in the connections tab
-rw-r--r-- | src/doc.h | 5 | ||||
-rw-r--r-- | src/uit_conn.c | 12 |
2 files changed, 15 insertions, 2 deletions
@@ -703,7 +703,8 @@ static const doc_key_t doc_keys[] = { "i/Return Toggle information box.\n" "f Find user in user list.\n" "m Send a PM to the selected user.\n" - "q Find file in download queue." + "q Find file in download queue.\n" + "b/B Browse the selected user's list, B to force a redownload." }, { "queue", "Download queue", LISTING_KEYS @@ -727,7 +728,7 @@ static const doc_key_t doc_keys[] = { { "search", "Search results tab", LISTING_KEYS "f Find user in user list.\n" - "b/B Browse the selected users' list, B to force a redownload.\n" + "b/B Browse the selected user's list, B to force a redownload.\n" "d Add selected file to the download queue.\n" "h Toggle hub column visibility.\n" "u Order by username.\n" diff --git a/src/uit_conn.c b/src/uit_conn.c index 1bc603e..8c0a788 100644 --- a/src/uit_conn.c +++ b/src/uit_conn.c @@ -336,6 +336,18 @@ static void t_key(ui_tab_t *tab, guint64 key) { } break; + case INPT_CHAR('b'): // b (/browse userlist) + case INPT_CHAR('B'): // B (force /browse userlist) + if(!cc) + ui_m(NULL, 0, "Nothing selected."); + else if(!cc->hub || !cc->uid) + ui_m(NULL, 0, "User or hub unknown."); + else if(!g_hash_table_lookup(hub_uids, &cc->uid)) + ui_m(NULL, 0, "User is not online."); + else + uit_fl_queue(cc->uid, key == INPT_CHAR('B'), NULL, tab, TRUE, FALSE); + break; + #define S(num, name)\ case INPT_CHAR('0'+num):\ t->s_##name = !t->s_##name;\ |