summaryrefslogtreecommitdiff
path: root/src/fe-text/statusbar-config.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-11-15 18:57:31 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-11-15 18:57:31 +0000
commitcda63f03d417e906f369efe4c966265db2fa5159 (patch)
tree09c5f546e8094bd647b69b5d3f3009c1db07b189 /src/fe-text/statusbar-config.c
parent39f9073586b6dc72efd43fc4d0884c8335e86f96 (diff)
downloadirssi-cda63f03d417e906f369efe4c966265db2fa5159.zip
When overriding default statusbars, don't forget the
type/placement/position/visible settings if they're not specified in new statusbar config. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2022 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text/statusbar-config.c')
-rw-r--r--src/fe-text/statusbar-config.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/src/fe-text/statusbar-config.c b/src/fe-text/statusbar-config.c
index 390ce193..f9ea05f2 100644
--- a/src/fe-text/statusbar-config.c
+++ b/src/fe-text/statusbar-config.c
@@ -141,16 +141,13 @@ static void statusbar_read(STATUSBAR_GROUP_REC *group, CONFIG_NODE *node)
{
STATUSBAR_CONFIG_REC *bar;
GSList *tmp;
- int type, placement, position, visible;
+ int visible;
const char *visible_str;
bar = statusbar_config_find(group, node->key);
+ visible = bar == NULL ? STATUSBAR_VISIBLE_ALWAYS : bar->visible;
- type = STATUSBAR_TYPE_ROOT;
- placement = STATUSBAR_BOTTOM;
- position = 0;
- visible = STATUSBAR_VISIBLE_ALWAYS;
-
+ /* first make sure we want to see this statusbar */
visible_str = config_node_get_str(node, "visible", "");
if (strcmp(visible_str, "active") == 0)
visible = STATUSBAR_VISIBLE_ACTIVE;
@@ -164,20 +161,20 @@ static void statusbar_read(STATUSBAR_GROUP_REC *group, CONFIG_NODE *node)
return;
}
- if (strcmp(config_node_get_str(node, "type", ""), "window") == 0)
- type = STATUSBAR_TYPE_WINDOW;
- if (strcmp(config_node_get_str(node, "placement", ""), "top") == 0)
- placement = STATUSBAR_TOP;
- position = config_node_get_int(node, "position", 0);
-
- if (bar == NULL)
+ if (bar == NULL) {
bar = statusbar_config_create(group, node->key);
-
- bar->type = type;
- bar->placement = placement;
- bar->position = position;
+ bar->type = STATUSBAR_TYPE_ROOT;
+ bar->placement = STATUSBAR_BOTTOM;
+ bar->position = 0;
+ }
bar->visible = visible;
+ if (strcmp(config_node_get_str(node, "type", ""), "window") == 0)
+ bar->type = STATUSBAR_TYPE_WINDOW;
+ if (strcmp(config_node_get_str(node, "placement", ""), "top") == 0)
+ bar->placement = STATUSBAR_TOP;
+ bar->position = config_node_get_int(node, "position", 0);
+
node = config_node_section(node, "items", -1);
if (node != NULL) {
/* we're overriding the items - destroy the old */