mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -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:
parent
1718083cf6
commit
f86da8c0e5
@ -145,29 +145,29 @@ void handle_key(int key)
|
||||
|
||||
static void key_send_line(void)
|
||||
{
|
||||
int add_history;
|
||||
char *str;
|
||||
char *str, *add_history;
|
||||
|
||||
str = gui_entry_get_text(active_entry);
|
||||
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);
|
||||
|
||||
add_history = TRUE;
|
||||
if (redir == NULL) {
|
||||
signal_emit("send command", 3, str,
|
||||
active_win->active_server,
|
||||
active_win->active);
|
||||
} else {
|
||||
if (redir->flags & ENTRY_REDIRECT_FLAG_HIDDEN)
|
||||
add_history = FALSE;
|
||||
g_free_and_null(add_history);
|
||||
handle_entry_redirect(str);
|
||||
}
|
||||
|
||||
if (add_history) {
|
||||
command_history_add(active_win, gui_entry_get_text(active_entry),
|
||||
FALSE);
|
||||
}
|
||||
if (add_history != NULL)
|
||||
command_history_add(active_win, add_history, FALSE);
|
||||
|
||||
gui_entry_set_text(active_entry, "");
|
||||
command_history_clear_pos(active_win);
|
||||
}
|
||||
|
@ -260,4 +260,5 @@ void statusbar_config_init(void)
|
||||
|
||||
void statusbar_config_deinit(void)
|
||||
{
|
||||
signal_remove("setup reread", (SIGNAL_FUNC) read_statusbar_config);
|
||||
}
|
||||
|
@ -290,7 +290,10 @@ static void sig_statusbar_item_destroyed(SBAR_ITEM_REC *item)
|
||||
GUI_ENTRY_REC *rec;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -921,6 +921,13 @@ static void statusbar_item_signal_destroy(void *key, GSList *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)
|
||||
{
|
||||
statusbar_groups = NULL;
|
||||
@ -942,6 +949,7 @@ void statusbar_init(void)
|
||||
signal_add("mainwindow moved", (SIGNAL_FUNC) sig_mainwindow_resized);
|
||||
signal_add("window changed", (SIGNAL_FUNC) sig_window_changed);
|
||||
signal_add("mainwindow destroyed", (SIGNAL_FUNC) sig_mainwindow_destroyed);
|
||||
signal_add_last("setup reread", (SIGNAL_FUNC) sig_setup_reload);
|
||||
}
|
||||
|
||||
void statusbar_deinit(void)
|
||||
@ -968,6 +976,7 @@ void statusbar_deinit(void)
|
||||
signal_remove("mainwindow moved", (SIGNAL_FUNC) sig_mainwindow_resized);
|
||||
signal_remove("window changed", (SIGNAL_FUNC) sig_window_changed);
|
||||
signal_remove("mainwindow destroyed", (SIGNAL_FUNC) sig_mainwindow_destroyed);
|
||||
signal_remove("setup reread", (SIGNAL_FUNC) sig_setup_reload);
|
||||
|
||||
statusbar_items_deinit();
|
||||
statusbar_config_deinit();
|
||||
|
Loading…
Reference in New Issue
Block a user