static void sig_setup_changed(void) { static int firsttime = TRUE; static int status_window = FALSE, msgs_window = FALSE; int changed = FALSE; if (settings_get_bool("use_status_window") != status_window) { status_window = !status_window; changed = TRUE; } if (settings_get_bool("use_msgs_window") != msgs_window) { msgs_window = !msgs_window; changed = TRUE; } if (firsttime) { firsttime = FALSE; changed = TRUE; windows_layout_restore(); if (windows != NULL) return; } if (changed) create_windows(); }
static void create_windows(void) { WINDOW_REC *window; windows_layout_restore(); if (windows != NULL) return; if (settings_get_bool("use_status_window")) { window = window_create(NULL, TRUE); window_set_name(window, "(status)"); window_set_level(window, MSGLEVEL_ALL ^ (settings_get_bool("use_msgs_window") ? (MSGLEVEL_MSGS|MSGLEVEL_DCCMSGS) : 0)); } if (settings_get_bool("use_msgs_window")) { window = window_create(NULL, TRUE); window_set_name(window, "(msgs)"); window_set_level(window, MSGLEVEL_MSGS|MSGLEVEL_DCCMSGS); } if (windows == NULL) { /* we have to have at least one window.. */ window = window_create(NULL, TRUE); } }