From 6dabbbd54140fb161d2a03d6d3f4fe67585311c6 Mon Sep 17 00:00:00 2001 From: James Booth Date: Fri, 11 Apr 2014 12:54:44 +0100 Subject: [PATCH 1/3] Added themes supplied by p41nm47r1x --- themes/batman | 36 ++++++++++++++++++++++++++++++++++++ themes/joker | 36 ++++++++++++++++++++++++++++++++++++ themes/shade | 36 ++++++++++++++++++++++++++++++++++++ themes/spawn | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 144 insertions(+) create mode 100644 themes/batman create mode 100644 themes/joker create mode 100644 themes/shade create mode 100644 themes/spawn diff --git a/themes/batman b/themes/batman new file mode 100644 index 00000000..a99d1dcf --- /dev/null +++ b/themes/batman @@ -0,0 +1,36 @@ +[colours] +bkgnd=default +titlebar=yellow +statusbar=yellow +titlebar.text=black +titlebar.brackets=black +statusbar.text=magenta +statusbar.brackets=black +statusbar.active=magenta +statusbar.new=magenta +main.text=white +input.text=yellow +main.time=white +main.splash=yellow +online=green +away=yellow +chat=green +dnd=green +xa=yellow +offline=grey +typing=cyan +gone=red +error=red +incoming=yellow +roominfo=green +me=black +them=yellow +titlebar.unencrypted=red +titlebar.encrypted=green +titlebar.untrusted=red +titlebar.trusted=green +otr.started.trusted=green +otr.started.untrusted=red +otr.ended=yellow +otr.trusted=green +otr.untrusted=red diff --git a/themes/joker b/themes/joker new file mode 100644 index 00000000..3c8adc39 --- /dev/null +++ b/themes/joker @@ -0,0 +1,36 @@ +[colours] +bkgnd=default +titlebar=magenta +statusbar=magenta +titlebar.text=white +titlebar.brackets=cyan +statusbar.text=green +statusbar.brackets=cyan +statusbar.active=green +statusbar.new=white +main.text=white +input.text=green +main.time=white +main.splash=green +online=green +away=yellow +chat=green +dnd=green +xa=yellow +offline=grey +typing=green +gone=red +error=red +incoming=yellow +roominfo=green +me=magenta +them=green +titlebar.unencrypted=red +titlebar.encrypted=green +titlebar.untrusted=red +titlebar.trusted=green +otr.started.trusted=green +otr.started.untrusted=red +otr.ended=yellow +otr.trusted=green +otr.untrusted=red diff --git a/themes/shade b/themes/shade new file mode 100644 index 00000000..0b61a0f7 --- /dev/null +++ b/themes/shade @@ -0,0 +1,36 @@ +[colours] +bkgnd=default +titlebar=default +statusbar=default +titlebar.text=white +titlebar.brackets=magenta +statusbar.text=magenta +statusbar.brackets=magenta +statusbar.active=white +statusbar.new=green +main.text=white +input.text=white +main.time=magenta +main.splash=magenta +online=green +away=yellow +chat=green +dnd=green +xa=yellow +offline=white +typing=green +gone=red +error=red +incoming=yellow +roominfo=green +me=black +them=magenta +titlebar.unencrypted=red +titlebar.encrypted=green +titlebar.untrusted=red +titlebar.trusted=green +otr.started.trusted=green +otr.started.untrusted=red +otr.ended=yellow +otr.trusted=green +otr.untrusted=red diff --git a/themes/spawn b/themes/spawn new file mode 100644 index 00000000..0703a4e9 --- /dev/null +++ b/themes/spawn @@ -0,0 +1,36 @@ +[colours] +bkgnd=default +titlebar=red +statusbar=red +titlebar.text=yellow +titlebar.brackets=green +statusbar.text=yellow +statusbar.brackets=green +statusbar.active=white +statusbar.new=green +main.text=white +input.text=green +main.time=red +main.splash=red +online=green +away=yellow +chat=green +dnd=green +xa=yellow +offline=grey +typing=green +gone=red +error=red +incoming=yellow +roominfo=green +me=green +them=yellow +titlebar.unencrypted=red +titlebar.encrypted=green +titlebar.untrusted=red +titlebar.trusted=green +otr.started.trusted=green +otr.started.untrusted=red +otr.ended=yellow +otr.trusted=green +otr.untrusted=red From 2fafcf001344f85965a0d1984860f092b7e19b7e Mon Sep 17 00:00:00 2001 From: James Booth Date: Sat, 12 Apr 2014 15:20:19 +0100 Subject: [PATCH 2/3] Revert "Added ui_already_connected" This reverts commit e97ec56fce641554ff7aa2ff9f0583e1fb9fc364. --- src/command/commands.c | 2 +- src/ui/core.c | 7 ------- src/ui/ui.h | 1 - tests/test_cmd_connect.c | 4 +++- tests/ui/mock_ui.c | 11 ----------- tests/ui/mock_ui.h | 4 +--- 6 files changed, 5 insertions(+), 24 deletions(-) diff --git a/src/command/commands.c b/src/command/commands.c index 2dcb4a0e..a7deb17a 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -65,7 +65,7 @@ cmd_connect(gchar **args, struct cmd_help_t help) jabber_conn_status_t conn_status = jabber_get_connection_status(); if ((conn_status != JABBER_DISCONNECTED) && (conn_status != JABBER_STARTED)) { - ui_already_connected(); + cons_show("You are either connected already, or a login is in process."); result = TRUE; } else { char *user = args[0]; diff --git a/src/ui/core.c b/src/ui/core.c index b3b4eadb..3cb05fe8 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -544,12 +544,6 @@ _ui_unknown_command(const char * const input) cons_show("Unknown command: %s", input); } -static void -_ui_already_connected(void) -{ - cons_show("You are either connected already, or a login is in process."); -} - static void _ui_disconnected(void) { @@ -1928,5 +1922,4 @@ ui_init_module(void) ui_replace_input = _ui_replace_input; ui_invalid_command_usage = _ui_invalid_command_usage; ui_unknown_command = _ui_unknown_command; - ui_already_connected = _ui_already_connected; } diff --git a/src/ui/ui.h b/src/ui/ui.h index 7543e6a8..fc689305 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -161,7 +161,6 @@ void (*ui_replace_input)(char *input, const char * const new_input, int *size); void (*ui_invalid_command_usage)(const char * const usage, void (**setting_func)(void)); void (*ui_unknown_command)(const char * const input); -void (*ui_already_connected)(void); // console window actions void (*cons_show)(const char * const msg, ...); diff --git a/tests/test_cmd_connect.c b/tests/test_cmd_connect.c index 76493115..33f49164 100644 --- a/tests/test_cmd_connect.c +++ b/tests/test_cmd_connect.c @@ -19,11 +19,13 @@ static void test_with_connection_status(jabber_conn_status_t status) { - stub_ui_already_connected(); + mock_cons_show(); CommandHelp *help = malloc(sizeof(CommandHelp)); mock_connection_status(status); + expect_cons_show("You are either connected already, or a login is in process."); + gboolean result = cmd_connect(NULL, *help); assert_true(result); diff --git a/tests/ui/mock_ui.c b/tests/ui/mock_ui.c index 0e01be25..94f8e3c3 100644 --- a/tests/ui/mock_ui.c +++ b/tests/ui/mock_ui.c @@ -82,11 +82,6 @@ char * _stub_ui_ask_password(void) return NULL; } -static -void _stub_ui_already_connected(void) -{ -} - static win_type_t _mock_ui_current_win_type(void) { @@ -263,12 +258,6 @@ stub_cons_show(void) cons_show = _stub_cons_show; } -void -stub_ui_already_connected(void) -{ - ui_already_connected = _stub_ui_already_connected; -} - void stub_ui_handle_recipient_not_found(void) { diff --git a/tests/ui/mock_ui.h b/tests/ui/mock_ui.h index 70c9f3b3..5b984615 100644 --- a/tests/ui/mock_ui.h +++ b/tests/ui/mock_ui.h @@ -66,6 +66,4 @@ void cons_show_roster_expect(GSList *list); void ui_switch_win_expect_and_return(int given_i, gboolean result); -void stub_ui_already_connected(void); - -#endif \ No newline at end of file +#endif From 132976d85e5ef18c2ce3bbe97aa46050048270dc Mon Sep 17 00:00:00 2001 From: James Booth Date: Sat, 12 Apr 2014 15:20:31 +0100 Subject: [PATCH 3/3] Revert "Added ui_unknown_command" This reverts commit 714ee2486353361898df7f5bb339e9be3f456830. --- src/command/command.c | 2 +- src/ui/core.c | 7 ------- src/ui/ui.h | 1 - 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/command/command.c b/src/command/command.c index ea5db13b..4174f8a8 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -1367,7 +1367,7 @@ cmd_execute_default(const char * const inp) break; case WIN_CONSOLE: - ui_unknown_command(inp); + cons_show("Unknown command: %s", inp); break; case WIN_DUCK: diff --git a/src/ui/core.c b/src/ui/core.c index 3cb05fe8..569425f9 100644 --- a/src/ui/core.c +++ b/src/ui/core.c @@ -538,12 +538,6 @@ _ui_invalid_command_usage(const char * const usage, void (**setting_func)(void)) } } -static void -_ui_unknown_command(const char * const input) -{ - cons_show("Unknown command: %s", input); -} - static void _ui_disconnected(void) { @@ -1921,5 +1915,4 @@ ui_init_module(void) ui_input_nonblocking = _ui_input_nonblocking; ui_replace_input = _ui_replace_input; ui_invalid_command_usage = _ui_invalid_command_usage; - ui_unknown_command = _ui_unknown_command; } diff --git a/src/ui/ui.h b/src/ui/ui.h index fc689305..a528b390 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -160,7 +160,6 @@ void (*ui_input_nonblocking)(void); void (*ui_replace_input)(char *input, const char * const new_input, int *size); void (*ui_invalid_command_usage)(const char * const usage, void (**setting_func)(void)); -void (*ui_unknown_command)(const char * const input); // console window actions void (*cons_show)(const char * const msg, ...);