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

Window-statusbars are created correctly with /RELOAD, some input line

fixes related to /RELOAD.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1831 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-10-14 11:17:13 +00:00 committed by cras
parent 1718083cf6
commit f86da8c0e5
4 changed files with 22 additions and 9 deletions

View File

@ -145,29 +145,29 @@ void handle_key(int key)
static void key_send_line(void) static void key_send_line(void)
{ {
int add_history; char *str, *add_history;
char *str;
str = gui_entry_get_text(active_entry); str = gui_entry_get_text(active_entry);
if (*str == '\0') return; if (*str == '\0') return;
/* we can't use gui_entry_get_text() later, since the entry might
have been destroyed after we get back */
add_history = g_strdup(str);
translate_output(str); translate_output(str);
add_history = TRUE;
if (redir == NULL) { if (redir == NULL) {
signal_emit("send command", 3, str, signal_emit("send command", 3, str,
active_win->active_server, active_win->active_server,
active_win->active); active_win->active);
} else { } else {
if (redir->flags & ENTRY_REDIRECT_FLAG_HIDDEN) if (redir->flags & ENTRY_REDIRECT_FLAG_HIDDEN)
add_history = FALSE; g_free_and_null(add_history);
handle_entry_redirect(str); handle_entry_redirect(str);
} }
if (add_history) { if (add_history != NULL)
command_history_add(active_win, gui_entry_get_text(active_entry), command_history_add(active_win, add_history, FALSE);
FALSE);
}
gui_entry_set_text(active_entry, ""); gui_entry_set_text(active_entry, "");
command_history_clear_pos(active_win); command_history_clear_pos(active_win);
} }

View File

@ -260,4 +260,5 @@ void statusbar_config_init(void)
void statusbar_config_deinit(void) void statusbar_config_deinit(void)
{ {
signal_remove("setup reread", (SIGNAL_FUNC) read_statusbar_config);
} }

View File

@ -290,7 +290,10 @@ static void sig_statusbar_item_destroyed(SBAR_ITEM_REC *item)
GUI_ENTRY_REC *rec; GUI_ENTRY_REC *rec;
rec = g_hash_table_lookup(input_entries, item); rec = g_hash_table_lookup(input_entries, item);
if (rec != NULL) gui_entry_destroy(rec); if (rec != NULL) {
gui_entry_destroy(rec);
g_hash_table_remove(input_entries, item);
}
} }
} }

View File

@ -921,6 +921,13 @@ static void statusbar_item_signal_destroy(void *key, GSList *value)
g_slist_free(value); g_slist_free(value);
} }
static void sig_setup_reload(void)
{
/* statusbar-config.c recreates root statusbars,
we need to create window-statusbars */
g_slist_foreach(mainwindows, (GFunc) statusbars_add_visible, NULL);
}
void statusbar_init(void) void statusbar_init(void)
{ {
statusbar_groups = NULL; statusbar_groups = NULL;
@ -942,6 +949,7 @@ void statusbar_init(void)
signal_add("mainwindow moved", (SIGNAL_FUNC) sig_mainwindow_resized); signal_add("mainwindow moved", (SIGNAL_FUNC) sig_mainwindow_resized);
signal_add("window changed", (SIGNAL_FUNC) sig_window_changed); signal_add("window changed", (SIGNAL_FUNC) sig_window_changed);
signal_add("mainwindow destroyed", (SIGNAL_FUNC) sig_mainwindow_destroyed); signal_add("mainwindow destroyed", (SIGNAL_FUNC) sig_mainwindow_destroyed);
signal_add_last("setup reread", (SIGNAL_FUNC) sig_setup_reload);
} }
void statusbar_deinit(void) void statusbar_deinit(void)
@ -968,6 +976,7 @@ void statusbar_deinit(void)
signal_remove("mainwindow moved", (SIGNAL_FUNC) sig_mainwindow_resized); signal_remove("mainwindow moved", (SIGNAL_FUNC) sig_mainwindow_resized);
signal_remove("window changed", (SIGNAL_FUNC) sig_window_changed); signal_remove("window changed", (SIGNAL_FUNC) sig_window_changed);
signal_remove("mainwindow destroyed", (SIGNAL_FUNC) sig_mainwindow_destroyed); signal_remove("mainwindow destroyed", (SIGNAL_FUNC) sig_mainwindow_destroyed);
signal_remove("setup reread", (SIGNAL_FUNC) sig_setup_reload);
statusbar_items_deinit(); statusbar_items_deinit();
statusbar_config_deinit(); statusbar_config_deinit();