From 81c2e557d18844a1e73e222c57851316fb85a359 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 16 Feb 2002 15:10:27 +0000 Subject: [PATCH] Added /STATUSBAR # RESET command for removing the whole statusbar block from config file. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2487 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/statusbar-config.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/fe-text/statusbar-config.c b/src/fe-text/statusbar-config.c index 715f8c38..81638d99 100644 --- a/src/fe-text/statusbar-config.c +++ b/src/fe-text/statusbar-config.c @@ -361,6 +361,19 @@ static void cmd_statusbar_disable(const char *data, void *server, iconfig_node_set_bool(node, "disabled", TRUE); } +/* SYNTAX: STATUSBAR RESET */ +static void cmd_statusbar_reset(const char *data, void *server, + void *item, CONFIG_NODE *node) +{ + CONFIG_NODE *parent; + + parent = iconfig_node_traverse("statusbar", TRUE); + parent = config_node_section(parent, active_statusbar_group->name, + NODE_TYPE_BLOCK); + + iconfig_node_set_str(parent, node->key, NULL); +} + /* SYNTAX: STATUSBAR TYPE window|root */ static void cmd_statusbar_type(const char *data, void *server, void *item, CONFIG_NODE *node) @@ -558,6 +571,7 @@ void statusbar_config_init(void) command_bind("statusbar", NULL, (SIGNAL_FUNC) cmd_statusbar); command_bind("statusbar enable", NULL, (SIGNAL_FUNC) cmd_statusbar_enable); command_bind("statusbar disable", NULL, (SIGNAL_FUNC) cmd_statusbar_disable); + command_bind("statusbar reset", NULL, (SIGNAL_FUNC) cmd_statusbar_reset); command_bind("statusbar add", NULL, (SIGNAL_FUNC) cmd_statusbar_add); command_bind("statusbar remove", NULL, (SIGNAL_FUNC) cmd_statusbar_remove); command_bind("statusbar type", NULL, (SIGNAL_FUNC) cmd_statusbar_type); @@ -576,6 +590,7 @@ void statusbar_config_deinit(void) command_unbind("statusbar", (SIGNAL_FUNC) cmd_statusbar); command_unbind("statusbar enable", (SIGNAL_FUNC) cmd_statusbar_enable); command_unbind("statusbar disable", (SIGNAL_FUNC) cmd_statusbar_disable); + command_unbind("statusbar reset", (SIGNAL_FUNC) cmd_statusbar_reset); command_unbind("statusbar add", (SIGNAL_FUNC) cmd_statusbar_add); command_unbind("statusbar remove", (SIGNAL_FUNC) cmd_statusbar_remove); command_unbind("statusbar type", (SIGNAL_FUNC) cmd_statusbar_type);