1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Changed signal / function names for /LAYOUT stuff. /LAYOUT RESET now resets

the split windows too.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1725 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-08-08 18:05:50 +00:00 committed by cras
parent 072a4c774f
commit c86333393c
2 changed files with 32 additions and 23 deletions

View File

@ -44,7 +44,7 @@ static void signal_query_created_curwin(QUERY_REC *query)
window_item_add(restore_win, (WI_ITEM_REC *) query, FALSE); window_item_add(restore_win, (WI_ITEM_REC *) query, FALSE);
} }
static void sig_window_restore_item(WINDOW_REC *window, const char *type, static void sig_layout_restore_item(WINDOW_REC *window, const char *type,
CONFIG_NODE *node) CONFIG_NODE *node)
{ {
char *name, *tag, *chat_type; char *name, *tag, *chat_type;
@ -86,7 +86,7 @@ static void window_add_items(WINDOW_REC *window, CONFIG_NODE *node)
type = config_node_get_str(node, "type", NULL); type = config_node_get_str(node, "type", NULL);
if (type != NULL) { if (type != NULL) {
signal_emit("window restore item", 3, signal_emit("layout restore item", 3,
window, type, node); window, type, node);
} }
} }
@ -94,10 +94,10 @@ static void window_add_items(WINDOW_REC *window, CONFIG_NODE *node)
void windows_layout_restore(void) void windows_layout_restore(void)
{ {
signal_emit("windows restored", 0); signal_emit("layout restore", 0);
} }
static void sig_windows_restored(void) static void sig_layout_restore(void)
{ {
WINDOW_REC *window; WINDOW_REC *window;
CONFIG_NODE *node; CONFIG_NODE *node;
@ -124,7 +124,7 @@ static void sig_windows_restored(void)
window->theme = theme_load(window->theme_name); window->theme = theme_load(window->theme_name);
window_add_items(window, config_node_section(node, "items", -1)); window_add_items(window, config_node_section(node, "items", -1));
signal_emit("window restore", 2, window, node); signal_emit("layout restore window", 2, window, node);
} }
} }
@ -183,7 +183,7 @@ static void window_save(WINDOW_REC *window, CONFIG_NODE *node)
if (window->items != NULL) if (window->items != NULL)
window_save_items(window, node); window_save_items(window, node);
signal_emit("window save", 2, window, node); signal_emit("layout save window", 2, window, node);
} }
void windows_layout_save(void) void windows_layout_save(void)
@ -194,7 +194,7 @@ void windows_layout_save(void)
node = iconfig_node_traverse("windows", TRUE); node = iconfig_node_traverse("windows", TRUE);
g_slist_foreach(windows, (GFunc) window_save, node); g_slist_foreach(windows, (GFunc) window_save, node);
signal_emit("windows saved", 0); signal_emit("layout save", 0);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
TXT_WINDOWS_LAYOUT_SAVED); TXT_WINDOWS_LAYOUT_SAVED);
@ -203,18 +203,20 @@ void windows_layout_save(void)
void windows_layout_reset(void) void windows_layout_reset(void)
{ {
iconfig_set_str(NULL, "windows", NULL); iconfig_set_str(NULL, "windows", NULL);
signal_emit("layout reset", 0);
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
TXT_WINDOWS_LAYOUT_RESET); TXT_WINDOWS_LAYOUT_RESET);
} }
void windows_layout_init(void) void windows_layout_init(void)
{ {
signal_add("window restore item", (SIGNAL_FUNC) sig_window_restore_item); signal_add("layout restore item", (SIGNAL_FUNC) sig_layout_restore_item);
signal_add("windows restored", (SIGNAL_FUNC) sig_windows_restored); signal_add("layout restore", (SIGNAL_FUNC) sig_layout_restore);
} }
void windows_layout_deinit(void) void windows_layout_deinit(void)
{ {
signal_remove("window restore item", (SIGNAL_FUNC) sig_window_restore_item); signal_remove("layout restore item", (SIGNAL_FUNC) sig_layout_restore_item);
signal_remove("windows restored", (SIGNAL_FUNC) sig_windows_restored); signal_remove("layout restore", (SIGNAL_FUNC) sig_layout_restore);
} }

View File

@ -27,7 +27,7 @@
#include "mainwindows.h" #include "mainwindows.h"
#include "gui-windows.h" #include "gui-windows.h"
static void sig_window_save(WINDOW_REC *window, CONFIG_NODE *node) static void sig_layout_window_save(WINDOW_REC *window, CONFIG_NODE *node)
{ {
WINDOW_REC *active; WINDOW_REC *active;
@ -39,7 +39,7 @@ static void sig_window_save(WINDOW_REC *window, CONFIG_NODE *node)
} }
} }
static void sig_window_restore(WINDOW_REC *window, CONFIG_NODE *node) static void sig_layout_window_restore(WINDOW_REC *window, CONFIG_NODE *node)
{ {
WINDOW_REC *parent; WINDOW_REC *parent;
@ -62,7 +62,7 @@ static void main_window_save(MAIN_WINDOW_REC *window, CONFIG_NODE *node)
iconfig_node_set_int(node, "lines", window->height); iconfig_node_set_int(node, "lines", window->height);
} }
static void sig_windows_saved(void) static void sig_layout_save(void)
{ {
CONFIG_NODE *node; CONFIG_NODE *node;
@ -93,7 +93,7 @@ static GSList *get_sorted_windows_config(CONFIG_NODE *node)
return output; return output;
} }
static void sig_windows_restored(void) static void sig_layout_restore(void)
{ {
MAIN_WINDOW_REC *lower_window; MAIN_WINDOW_REC *lower_window;
WINDOW_REC *window; WINDOW_REC *window;
@ -129,18 +129,25 @@ static void sig_windows_restored(void)
mainwindow_set_size(lower_window, lower_size); mainwindow_set_size(lower_window, lower_size);
} }
static void sig_layout_reset(void)
{
iconfig_set_str(NULL, "mainwindows", NULL);
}
void mainwindows_layout_init(void) void mainwindows_layout_init(void)
{ {
signal_add("window save", (SIGNAL_FUNC) sig_window_save); signal_add("layout window save", (SIGNAL_FUNC) sig_layout_window_save);
signal_add("window restore", (SIGNAL_FUNC) sig_window_restore); signal_add("layout window restore", (SIGNAL_FUNC) sig_layout_window_restore);
signal_add("windows saved", (SIGNAL_FUNC) sig_windows_saved); signal_add("layout save", (SIGNAL_FUNC) sig_layout_save);
signal_add_first("windows restored", (SIGNAL_FUNC) sig_windows_restored); signal_add_first("layout restore", (SIGNAL_FUNC) sig_layout_restore);
signal_add("layout reset", (SIGNAL_FUNC) sig_layout_reset);
} }
void mainwindows_layout_deinit(void) void mainwindows_layout_deinit(void)
{ {
signal_remove("window save", (SIGNAL_FUNC) sig_window_save); signal_remove("layout window save", (SIGNAL_FUNC) sig_layout_window_save);
signal_remove("window restore", (SIGNAL_FUNC) sig_window_restore); signal_remove("layout window restore", (SIGNAL_FUNC) sig_layout_window_restore);
signal_remove("windows saved", (SIGNAL_FUNC) sig_windows_saved); signal_remove("layout save", (SIGNAL_FUNC) sig_layout_save);
signal_remove("windows restored", (SIGNAL_FUNC) sig_windows_restored); signal_remove("layout restore", (SIGNAL_FUNC) sig_layout_restore);
signal_remove("layout reset", (SIGNAL_FUNC) sig_layout_reset);
} }