From 3c255ea736cdb1e3d0bf77f1160b6d495cb090db Mon Sep 17 00:00:00 2001 From: sabetts Date: Wed, 5 Sep 2001 07:48:49 +0000 Subject: * src/messages.h (MESSAGE_WELCOME): The help keystroke is not hardcoded. * src/main.c (show_welcome_message): new function (main): call show_welcome_message to show the welcome message. * src/actions.h (find_keybinding_by_action): new prototype * src/actions.c (key_actions): change to a static variable. (key_actions_last): likewise (key_actions_table_size): likewise (find_keybinding_by_action): new function --- src/main.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 7e2b7f7..af294d7 100644 --- a/src/main.c +++ b/src/main.c @@ -308,6 +308,35 @@ read_startup_files () } } +static void +show_welcome_message () +{ + rp_action *help_action; + char *prefix, *help; + + prefix = keysym_to_string (prefix_key.sym, prefix_key.state); + + /* Find the help key binding. */ + help_action = find_keybinding_by_action ("help"); + if (help_action) + help = keysym_to_string (help_action->key, help_action->state); + else + help = NULL; + + + if (help) + { + marked_message_printf (0, 0, MESSAGE_WELCOME, prefix, help); + free (help); + } + else + { + marked_message_printf (0, 0, MESSAGE_WELCOME, prefix, ":help"); + } + + free (prefix); +} + int main (int argc, char *argv[]) { @@ -429,8 +458,8 @@ main (int argc, char *argv[]) read_startup_files (); - /* Indicate to the user that ratpoison has booted */ - message (MESSAGE_WELCOME); + /* Indicate to the user that ratpoison has booted. */ + show_welcome_message(); handle_events (); -- cgit v1.2.3