1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

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
This commit is contained in:
Timo Sirainen 2001-11-15 18:57:31 +00:00 committed by cras
parent 39f9073586
commit cda63f03d4

View File

@ -141,16 +141,13 @@ static void statusbar_read(STATUSBAR_GROUP_REC *group, CONFIG_NODE *node)
{ {
STATUSBAR_CONFIG_REC *bar; STATUSBAR_CONFIG_REC *bar;
GSList *tmp; GSList *tmp;
int type, placement, position, visible; int visible;
const char *visible_str; const char *visible_str;
bar = statusbar_config_find(group, node->key); bar = statusbar_config_find(group, node->key);
visible = bar == NULL ? STATUSBAR_VISIBLE_ALWAYS : bar->visible;
type = STATUSBAR_TYPE_ROOT; /* first make sure we want to see this statusbar */
placement = STATUSBAR_BOTTOM;
position = 0;
visible = STATUSBAR_VISIBLE_ALWAYS;
visible_str = config_node_get_str(node, "visible", ""); visible_str = config_node_get_str(node, "visible", "");
if (strcmp(visible_str, "active") == 0) if (strcmp(visible_str, "active") == 0)
visible = STATUSBAR_VISIBLE_ACTIVE; visible = STATUSBAR_VISIBLE_ACTIVE;
@ -164,20 +161,20 @@ static void statusbar_read(STATUSBAR_GROUP_REC *group, CONFIG_NODE *node)
return; return;
} }
if (strcmp(config_node_get_str(node, "type", ""), "window") == 0) if (bar == NULL) {
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)
bar = statusbar_config_create(group, node->key); bar = statusbar_config_create(group, node->key);
bar->type = STATUSBAR_TYPE_ROOT;
bar->type = type; bar->placement = STATUSBAR_BOTTOM;
bar->placement = placement; bar->position = 0;
bar->position = position; }
bar->visible = visible; 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); node = config_node_section(node, "items", -1);
if (node != NULL) { if (node != NULL) {
/* we're overriding the items - destroy the old */ /* we're overriding the items - destroy the old */