From 1cc5353697ddf3e5b441238ffe2d814d5d2e95b9 Mon Sep 17 00:00:00 2001 From: James Booth Date: Fri, 11 Jan 2013 01:05:59 +0000 Subject: [PATCH] Added win_current_is_console() --- src/command.c | 3 +-- src/ui.h | 1 + src/windows.c | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/command.c b/src/command.c index 6fbcb6c5..9310c7d9 100644 --- a/src/command.c +++ b/src/command.c @@ -1661,8 +1661,7 @@ _cmd_close(gchar **args, struct cmd_help_t help) jabber_conn_status_t conn_status = jabber_get_connection_status(); // cannot close console window - if (!win_current_is_chat() && !win_current_is_groupchat() - && !win_current_is_private()) { + if (win_current_is_console()) { cons_show("Cannot close console window."); return TRUE; } diff --git a/src/ui.h b/src/ui.h index 22b78893..77e51ed7 100644 --- a/src/ui.h +++ b/src/ui.h @@ -97,6 +97,7 @@ void title_bar_draw(void); // current window actions void win_current_close(void); +int win_current_is_console(void); int win_current_is_chat(void); int win_current_is_groupchat(void); int win_current_is_private(void); diff --git a/src/windows.c b/src/windows.c index 0ceab11c..addae801 100644 --- a/src/windows.c +++ b/src/windows.c @@ -549,6 +549,12 @@ win_current_close(void) dirty = TRUE; } +int +win_current_is_console(void) +{ + return (current->type == WIN_CONSOLE); +} + int win_current_is_chat(void) {