summaryrefslogtreecommitdiff
path: root/src/fe-text
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-02-16 15:10:27 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-02-16 15:10:27 +0000
commit81c2e557d18844a1e73e222c57851316fb85a359 (patch)
treea2306d981cc27a3ff399400b436162186ce70f0d /src/fe-text
parent2df4eadbfa8cd32c0fa3f29a8e59aac2132cc59b (diff)
downloadirssi-81c2e557d18844a1e73e222c57851316fb85a359.zip
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
Diffstat (limited to 'src/fe-text')
-rw-r--r--src/fe-text/statusbar-config.c15
1 files changed, 15 insertions, 0 deletions
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 <name> 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 <name> 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);