mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 12:23:37 +02:00
Restoring layout for split windows works betters now. Some sticky window
changes/fixes. Renamed /WINDOW MOVE LEFT|RIGHT -> PREV|NEXT, added commands /WINDOW MOVE UP|DOWN|LEFT|RIGHT. The new LEFT|RIGHT now moves the window only inside split windows. mainwindows-save.c -> mainwindows-layout.c git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1710 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
58f52343fd
commit
45bb5c3cee
11 changed files with 415 additions and 366 deletions
|
|
@ -93,6 +93,11 @@ static void window_add_items(WINDOW_REC *window, CONFIG_NODE *node)
|
|||
}
|
||||
|
||||
void windows_layout_restore(void)
|
||||
{
|
||||
signal_emit("windows restored", 0);
|
||||
}
|
||||
|
||||
static void sig_windows_restored(void)
|
||||
{
|
||||
WINDOW_REC *window;
|
||||
CONFIG_NODE *node;
|
||||
|
|
@ -104,7 +109,10 @@ void windows_layout_restore(void)
|
|||
for (tmp = node->value; tmp != NULL; tmp = tmp->next) {
|
||||
CONFIG_NODE *node = tmp->data;
|
||||
|
||||
window = window_create(NULL, TRUE);
|
||||
window = window_find_refnum(atoi(node->key));
|
||||
if (window == NULL)
|
||||
window = window_create(NULL, TRUE);
|
||||
|
||||
window_set_refnum(window, atoi(node->key));
|
||||
window->sticky_refnum = config_node_get_bool(node, "sticky_refnum", FALSE);
|
||||
window_set_name(window, config_node_get_str(node, "name", NULL));
|
||||
|
|
@ -118,8 +126,6 @@ void windows_layout_restore(void)
|
|||
window_add_items(window, config_node_section(node, "items", -1));
|
||||
signal_emit("window restore", 2, window, node);
|
||||
}
|
||||
|
||||
signal_emit("windows restored", 0);
|
||||
}
|
||||
|
||||
static void window_save_items(WINDOW_REC *window, CONFIG_NODE *node)
|
||||
|
|
@ -204,9 +210,11 @@ void windows_layout_reset(void)
|
|||
void windows_layout_init(void)
|
||||
{
|
||||
signal_add("window restore item", (SIGNAL_FUNC) sig_window_restore_item);
|
||||
signal_add("windows restored", (SIGNAL_FUNC) sig_windows_restored);
|
||||
}
|
||||
|
||||
void windows_layout_deinit(void)
|
||||
{
|
||||
signal_remove("window restore item", (SIGNAL_FUNC) sig_window_restore_item);
|
||||
signal_remove("windows restored", (SIGNAL_FUNC) sig_windows_restored);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue