mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 04:13:32 +02:00
Added /SET reuse_unused_windows setting, default is OFF
If window_close_on_part is ON, we don't anymore close the window if we get kicked or connection gets lost. Also don't close DCC chat window if the other side disconnects. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@357 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
234e95ef94
commit
8ea2400269
7 changed files with 30 additions and 10 deletions
|
|
@ -264,6 +264,7 @@ static void sig_dcc_destroyed(DCC_REC *dcc)
|
|||
|
||||
if (query != NULL) {
|
||||
/* DCC chat closed, close the query with it. */
|
||||
if (dcc->connection_lost) query->unwanted = TRUE;
|
||||
query_destroy(query);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#include "commands.h"
|
||||
#include "levels.h"
|
||||
#include "misc.h"
|
||||
#include "settings.h"
|
||||
|
||||
#include "irc.h"
|
||||
#include "channels.h"
|
||||
|
|
@ -54,7 +55,14 @@ static void signal_channel_destroyed(CHANNEL_REC *channel)
|
|||
g_return_if_fail(channel != NULL);
|
||||
|
||||
window = window_item_window((WI_ITEM_REC *) channel);
|
||||
if (window != NULL) window_remove_item(window, (WI_ITEM_REC *) channel);
|
||||
if (window != NULL) {
|
||||
window_remove_item(window, (WI_ITEM_REC *) channel);
|
||||
|
||||
if (windows->next != NULL && (!channel->joined || channel->left) &&
|
||||
settings_get_bool("window_close_on_part")) {
|
||||
window_destroy(window);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void signal_window_item_removed(WINDOW_REC *window, WI_ITEM_REC *item)
|
||||
|
|
@ -235,6 +243,8 @@ static void cmd_channel_remove(const char *data)
|
|||
|
||||
void fe_channels_init(void)
|
||||
{
|
||||
settings_add_bool("lookandfeel", "window_close_on_part", TRUE);
|
||||
|
||||
signal_add("channel created", (SIGNAL_FUNC) signal_channel_created);
|
||||
signal_add("channel destroyed", (SIGNAL_FUNC) signal_channel_destroyed);
|
||||
signal_add("window item remove", (SIGNAL_FUNC) signal_window_item_removed);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,13 @@ static void signal_query_destroyed(QUERY_REC *query)
|
|||
g_return_if_fail(query != NULL);
|
||||
|
||||
window = window_item_window((WI_ITEM_REC *) query);
|
||||
if (window != NULL) window_remove_item(window, (WI_ITEM_REC *) query);
|
||||
if (window != NULL) {
|
||||
window_remove_item(window, (WI_ITEM_REC *) query);
|
||||
|
||||
if (windows->next != NULL && !query->unwanted &&
|
||||
settings_get_bool("window_close_on_part"))
|
||||
window_destroy(window);
|
||||
}
|
||||
}
|
||||
|
||||
static void signal_window_item_removed(WINDOW_REC *window, WI_ITEM_REC *item)
|
||||
|
|
@ -78,7 +84,7 @@ static void signal_window_item_removed(WINDOW_REC *window, WI_ITEM_REC *item)
|
|||
g_return_if_fail(window != NULL);
|
||||
|
||||
query = irc_item_query(item);
|
||||
if (query != NULL) query_destroy(query);
|
||||
if (query != NULL) query_destroy(query);
|
||||
}
|
||||
|
||||
static void sig_server_connected(IRC_SERVER_REC *server)
|
||||
|
|
@ -169,7 +175,7 @@ static int sig_query_autoclose(void)
|
|||
window = window_item_window((WI_ITEM_REC *) rec);
|
||||
if (window != active_win && rec->new_data == 0 &&
|
||||
now-window->last_line > query_auto_close)
|
||||
query_destroy(rec);
|
||||
query_destroy(rec);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue