From c31d63b2d44896a63c69870412b994137447ffdc Mon Sep 17 00:00:00 2001 From: James Booth Date: Wed, 17 Feb 2016 01:24:39 +0000 Subject: [PATCH] Added /c-test notiify --- tests/test-c-plugin/test-c-plugin.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/test-c-plugin/test-c-plugin.c b/tests/test-c-plugin/test-c-plugin.c index 4faf890..c1fff9c 100644 --- a/tests/test-c-plugin/test-c-plugin.c +++ b/tests/test-c-plugin/test-c-plugin.c @@ -36,7 +36,21 @@ cmd_ctest(char **args) if (args[1]) { prof_win_focus(plugin_win); prof_cons_show(args[1]); - prof_win_show(plugin_win, "called -> prof_cons_show"); + char *str = "called -> prof_cons_show: "; + char buf[strlen(str) + strlen(args[1])]; + sprintf(buf, "%s%s", str, args[1]); + prof_win_show(plugin_win, buf); + } else { + prof_cons_show("Invalid usage, see '/help c-test' for details."); + } + } else if (strcmp(args[0], "notify") == 0) { + if (args[1]) { + prof_win_focus(plugin_win); + prof_notify(args[1], 5000, "c-test plugin"); + char *str = "called -> prof_notify: "; + char buf[strlen(str) + strlen(args[1])]; + sprintf(buf, "%s%s", str, args[1]); + prof_win_show(plugin_win, buf); } else { prof_cons_show("Invalid usage, see '/help c-test' for details."); } @@ -50,7 +64,7 @@ prof_init(const char * const version, const char * const status) { prof_win_create(plugin_win, handle_win_input); prof_register_command("/c-test", 1, 2, "/c-test", "C Test plugin", "C Test plugin", cmd_ctest); - char *arg_ac[] = { "consalert", "consshow", NULL }; + char *arg_ac[] = { "consalert", "consshow", "notify", NULL }; prof_register_ac("/c-test", arg_ac); }