Added parameter to /close

2,3,4,5,6,7,8,9,0 will close specified window.
'all' will close all windows.

closes #159
This commit is contained in:
James Booth
2013-05-12 22:57:36 +01:00
parent c1ee75da40
commit 57e64bebe5
3 changed files with 114 additions and 26 deletions

View File

@@ -205,6 +205,11 @@ ui_windows_full(void)
return TRUE;
}
gboolean ui_win_exists(int index)
{
return (windows[index] != NULL);
}
gboolean
ui_duck_exists(void)
{
@@ -550,12 +555,46 @@ ui_close_current(void)
current_win_dirty = TRUE;
}
void ui_close_win(int index)
{
win_free(windows[index]);
windows[index] = NULL;
status_bar_inactive(index);
if (index == current_index) {
_set_current(0);
}
status_bar_active(0);
title_bar_title();
current_win_dirty = TRUE;
}
win_type_t
ui_current_win_type(void)
{
return current->type;
}
int
ui_current_win_index(void)
{
return current_index;
}
win_type_t
ui_win_type(int index)
{
return windows[index]->type;
}
char *
ui_recipient(int index)
{
return strdup(windows[index]->from);
}
char *
ui_current_recipient(void)
{