From 5a5b1340aa799ee1d56961123a4770ebadb287bc Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 22 Dec 2013 22:14:15 +0000 Subject: Dynamically load UI functions, fixed tests --- src/command/command.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'src/command/command.c') diff --git a/src/command/command.c b/src/command/command.c index a13687a3..e37331ce 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -435,7 +435,7 @@ static struct cmd_t command_defs[] = NULL } } }, { "/beep", - cmd_beep, parse_args, 1, 1, cons_beep_setting, + cmd_beep, parse_args, 1, 1, &cons_beep_setting, { "/beep on|off", "Terminal beep on new messages.", { "/beep on|off", "------------", @@ -445,7 +445,7 @@ static struct cmd_t command_defs[] = NULL } } }, { "/notify", - cmd_notify, parse_args, 2, 2, cons_notify_setting, + cmd_notify, parse_args, 2, 2, &cons_notify_setting, { "/notify type value", "Control various desktop noficiations.", { "/notify type value", "------------------", @@ -470,7 +470,7 @@ static struct cmd_t command_defs[] = NULL } } }, { "/flash", - cmd_flash, parse_args, 1, 1, cons_flash_setting, + cmd_flash, parse_args, 1, 1, &cons_flash_setting, { "/flash on|off", "Terminal flash on new messages.", { "/flash on|off", "-------------", @@ -480,7 +480,7 @@ static struct cmd_t command_defs[] = NULL } } }, { "/intype", - cmd_intype, parse_args, 1, 1, cons_intype_setting, + cmd_intype, parse_args, 1, 1, &cons_intype_setting, { "/intype on|off", "Show when contact is typing.", { "/intype on|off", "--------------", @@ -488,7 +488,7 @@ static struct cmd_t command_defs[] = NULL } } }, { "/splash", - cmd_splash, parse_args, 1, 1, cons_splash_setting, + cmd_splash, parse_args, 1, 1, &cons_splash_setting, { "/splash on|off", "Splash logo on startup and /about command.", { "/splash on|off", "--------------", @@ -496,7 +496,7 @@ static struct cmd_t command_defs[] = NULL } } }, { "/autoconnect", - cmd_autoconnect, parse_args, 1, 2, cons_autoconnect_setting, + cmd_autoconnect, parse_args, 1, 2, &cons_autoconnect_setting, { "/autoconnect set|off [account]", "Set account to autoconnect with.", { "/autoconnect set|off [account]", "------------------------------", @@ -517,7 +517,7 @@ static struct cmd_t command_defs[] = NULL } } }, { "/titlebar", - cmd_titlebar, parse_args, 2, 2, cons_titlebar_setting, + cmd_titlebar, parse_args, 2, 2, &cons_titlebar_setting, { "/titlebar property on|off", "Show various properties in the window title bar.", { "/titlebar property on|off", "-------------------------", @@ -526,7 +526,7 @@ static struct cmd_t command_defs[] = NULL } } }, { "/mouse", - cmd_mouse, parse_args, 1, 1, cons_mouse_setting, + cmd_mouse, parse_args, 1, 1, &cons_mouse_setting, { "/mouse on|off", "Use profanity mouse handling.", { "/mouse on|off", "-------------", @@ -539,7 +539,7 @@ static struct cmd_t command_defs[] = NULL } } }, { "/chlog", - cmd_chlog, parse_args, 1, 1, cons_chlog_setting, + cmd_chlog, parse_args, 1, 1, &cons_chlog_setting, { "/chlog on|off", "Chat logging to file", { "/chlog on|off", "-------------", @@ -550,7 +550,7 @@ static struct cmd_t command_defs[] = NULL } } }, { "/grlog", - cmd_grlog, parse_args, 1, 1, cons_grlog_setting, + cmd_grlog, parse_args, 1, 1, &cons_grlog_setting, { "/grlog on|off", "Chat logging of chat rooms to file", { "/grlog on|off", "-------------", @@ -559,7 +559,7 @@ static struct cmd_t command_defs[] = NULL } } }, { "/states", - cmd_states, parse_args, 1, 1, cons_states_setting, + cmd_states, parse_args, 1, 1, &cons_states_setting, { "/states on|off", "Send chat states during a chat session.", { "/states on|off", "--------------", @@ -568,7 +568,7 @@ static struct cmd_t command_defs[] = NULL } } }, { "/outtype", - cmd_outtype, parse_args, 1, 1, cons_outtype_setting, + cmd_outtype, parse_args, 1, 1, &cons_outtype_setting, { "/outtype on|off", "Send typing notification to recipient.", { "/outtype on|off", "---------------", @@ -577,7 +577,7 @@ static struct cmd_t command_defs[] = NULL } } }, { "/gone", - cmd_gone, parse_args, 1, 1, cons_gone_setting, + cmd_gone, parse_args, 1, 1, &cons_gone_setting, { "/gone minutes", "Send 'gone' state to recipient after a period.", { "/gone minutes", "-------------", @@ -588,7 +588,7 @@ static struct cmd_t command_defs[] = NULL } } }, { "/history", - cmd_history, parse_args, 1, 1, cons_history_setting, + cmd_history, parse_args, 1, 1, &cons_history_setting, { "/history on|off", "Chat history in message windows.", { "/history on|off", "---------------", @@ -597,7 +597,7 @@ static struct cmd_t command_defs[] = NULL } } }, { "/log", - cmd_log, parse_args, 2, 2, cons_log_setting, + cmd_log, parse_args, 2, 2, &cons_log_setting, { "/log maxsize value", "Manage system logging settings.", { "/log maxsize value", "------------------", @@ -606,7 +606,7 @@ static struct cmd_t command_defs[] = NULL } } }, { "/reconnect", - cmd_reconnect, parse_args, 1, 1, cons_reconnect_setting, + cmd_reconnect, parse_args, 1, 1, &cons_reconnect_setting, { "/reconnect seconds", "Set reconnect interval.", { "/reconnect seconds", "------------------", @@ -615,7 +615,7 @@ static struct cmd_t command_defs[] = NULL } } }, { "/autoping", - cmd_autoping, parse_args, 1, 1, cons_autoping_setting, + cmd_autoping, parse_args, 1, 1, &cons_autoping_setting, { "/autoping seconds", "Server ping interval.", { "/autoping seconds", "-----------------", @@ -624,7 +624,7 @@ static struct cmd_t command_defs[] = NULL } } }, { "/autoaway", - cmd_autoaway, parse_args_with_freetext, 2, 2, cons_autoaway_setting, + cmd_autoaway, parse_args_with_freetext, 2, 2, &cons_autoaway_setting, { "/autoaway setting value", "Set auto idle/away properties.", { "/autoaway setting value", "-----------------------", @@ -645,7 +645,7 @@ static struct cmd_t command_defs[] = NULL } } }, { "/priority", - cmd_priority, parse_args, 1, 1, cons_priority_setting, + cmd_priority, parse_args, 1, 1, &cons_priority_setting, { "/priority value", "Set priority for the current account.", { "/priority value", "---------------", @@ -714,7 +714,7 @@ static struct cmd_t command_defs[] = NULL } } }, { "/theme", - cmd_theme, parse_args, 1, 2, cons_theme_setting, + cmd_theme, parse_args, 1, 2, &cons_theme_setting, { "/theme command [theme-name]", "Change colour theme.", { "/theme command [theme-name]", "---------------------------", @@ -730,7 +730,7 @@ static struct cmd_t command_defs[] = { "/statuses", - cmd_statuses, parse_args, 1, 1, cons_statuses_setting, + cmd_statuses, parse_args, 1, 1, &cons_statuses_setting, { "/statuses on|off", "Set notifications for status messages.", { "/statuses on|off", "----------------", @@ -1086,7 +1086,7 @@ cmd_execute(const char * const command, const char * const inp) gchar **args = cmd->parser(inp, cmd->min_args, cmd->max_args); if ((args == NULL) && (cmd->setting_func != NULL)) { cons_show(""); - cmd->setting_func(); + (*cmd->setting_func)(); cons_show("Usage: %s", cmd->help.usage); return TRUE; } else if (args == NULL) { -- cgit 1.4.1-2-gfad0 From d3fff13255863901a1af0860857e2a8276f7e324 Mon Sep 17 00:00:00 2001 From: James Booth Date: Thu, 2 Jan 2014 01:31:03 +0000 Subject: Added full stop to /about help summary Conflicts: src/command/command.c --- src/command/command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/command/command.c') diff --git a/src/command/command.c b/src/command/command.c index e37331ce..ad4235b8 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -90,7 +90,7 @@ static struct cmd_t command_defs[] = { "/about", cmd_about, parse_args, 0, 0, NULL, - { "/about", "About Profanity", + { "/about", "About Profanity.", { "/about", "------", "Show versioning and license information.", -- cgit 1.4.1-2-gfad0 From 8d4bec2d37a52ca8b3ae39e5f7b36a9ef5e289df Mon Sep 17 00:00:00 2001 From: James Booth Date: Thu, 2 Jan 2014 01:33:24 +0000 Subject: Added full stop to /chlog help summary Conflicts: src/command/command.c --- src/command/command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/command/command.c') diff --git a/src/command/command.c b/src/command/command.c index ad4235b8..031babce 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -540,7 +540,7 @@ static struct cmd_t command_defs[] = { "/chlog", cmd_chlog, parse_args, 1, 1, &cons_chlog_setting, - { "/chlog on|off", "Chat logging to file", + { "/chlog on|off", "Chat logging to file.", { "/chlog on|off", "-------------", "Switch chat logging on or off.", -- cgit 1.4.1-2-gfad0 From 3a57a792e415e6bdf8b7465e29df052fb7b96e51 Mon Sep 17 00:00:00 2001 From: James Booth Date: Thu, 2 Jan 2014 01:39:43 +0000 Subject: Added full stop to /grlog help summary Conflicts: src/command/command.c --- src/command/command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/command/command.c') diff --git a/src/command/command.c b/src/command/command.c index 031babce..ac020a15 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -551,7 +551,7 @@ static struct cmd_t command_defs[] = { "/grlog", cmd_grlog, parse_args, 1, 1, &cons_grlog_setting, - { "/grlog on|off", "Chat logging of chat rooms to file", + { "/grlog on|off", "Chat logging of chat rooms to file.", { "/grlog on|off", "-------------", "Switch chat room logging on or off.", -- cgit 1.4.1-2-gfad0 From 3fbd45bd0603d51255c9e6df2a56d5cd5de4dd2b Mon Sep 17 00:00:00 2001 From: James Booth Date: Thu, 2 Jan 2014 01:40:46 +0000 Subject: Added full stop to /help help summary Conflicts: src/command/command.c --- src/command/command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/command/command.c') diff --git a/src/command/command.c b/src/command/command.c index ac020a15..6d7aa627 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -74,7 +74,7 @@ static struct cmd_t command_defs[] = { { "/help", cmd_help, parse_args, 0, 1, NULL, - { "/help [area|command]", "Get help on using Profanity", + { "/help [area|command]", "Get help on using Profanity.", { "/help [area|command]", "-------------------------", "Use with no arguments to get a help summary.", -- cgit 1.4.1-2-gfad0