From 7063406d6caf42f61d87e42db6ce46df9e64ffef Mon Sep 17 00:00:00 2001 From: TingPing Date: Wed, 11 Feb 2015 17:58:44 -0500 Subject: [PATCH] Remove input_balloon_time setting This setting doesn't work on most platforms including some notification daemons on linux. Where it does work I think it is bad behavior to default overriding their defaults anyway. It's most valuable use was likely win32 tray balloons which no longer exist. --- src/common/cfgfiles.c | 2 -- src/common/hexchat.h | 1 - src/fe-gtk/notifications/notification-backend.h | 2 +- src/fe-gtk/notifications/notification-dummy.c | 2 +- src/fe-gtk/notifications/notification-libnotify.c | 3 +-- src/fe-gtk/notifications/notification-osx.m | 2 +- src/fe-gtk/notifications/notification-windows.c | 6 +++--- src/fe-gtk/notifications/notification-winrt.cpp | 2 +- src/fe-gtk/plugin-notification.c | 12 +----------- 9 files changed, 9 insertions(+), 23 deletions(-) diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c index 87375565..d0007b93 100644 --- a/src/common/cfgfiles.c +++ b/src/common/cfgfiles.c @@ -482,7 +482,6 @@ const struct prefs vars[] = {"input_balloon_chans", P_OFFINT (hex_input_balloon_chans), TYPE_BOOL}, {"input_balloon_hilight", P_OFFINT (hex_input_balloon_hilight), TYPE_BOOL}, {"input_balloon_priv", P_OFFINT (hex_input_balloon_priv), TYPE_BOOL}, - {"input_balloon_time", P_OFFINT (hex_input_balloon_time), TYPE_INT}, {"input_beep_chans", P_OFFINT (hex_input_beep_chans), TYPE_BOOL}, {"input_beep_hilight", P_OFFINT (hex_input_beep_hilight), TYPE_BOOL}, {"input_beep_priv", P_OFFINT (hex_input_beep_priv), TYPE_BOOL}, @@ -828,7 +827,6 @@ load_default_config(void) prefs.hex_gui_ulist_pos = 3; prefs.hex_gui_win_height = 400; prefs.hex_gui_win_width = 640; - prefs.hex_input_balloon_time = 20; prefs.hex_irc_ban_type = 1; prefs.hex_irc_join_delay = 5; prefs.hex_net_reconnect_delay = 10; diff --git a/src/common/hexchat.h b/src/common/hexchat.h index a30a4a13..652dcf1d 100644 --- a/src/common/hexchat.h +++ b/src/common/hexchat.h @@ -265,7 +265,6 @@ struct hexchatprefs int hex_gui_win_top; int hex_gui_win_width; int hex_identd_port; - int hex_input_balloon_time; int hex_irc_ban_type; int hex_irc_join_delay; int hex_irc_notice_pos; diff --git a/src/fe-gtk/notifications/notification-backend.h b/src/fe-gtk/notifications/notification-backend.h index 98686d73..b60ced4e 100644 --- a/src/fe-gtk/notifications/notification-backend.h +++ b/src/fe-gtk/notifications/notification-backend.h @@ -20,7 +20,7 @@ #define HEXCHAT_PLUGIN_NOTIFICATION_BACKEND_H int notification_backend_supported (void); -void notification_backend_show (const char *title, const char *text, int timeout); +void notification_backend_show (const char *title, const char *text); int notification_backend_init (void); void notification_backend_deinit (void); diff --git a/src/fe-gtk/notifications/notification-dummy.c b/src/fe-gtk/notifications/notification-dummy.c index 1b719cfa..022443bf 100644 --- a/src/fe-gtk/notifications/notification-dummy.c +++ b/src/fe-gtk/notifications/notification-dummy.c @@ -17,7 +17,7 @@ */ void -notification_backend_show (const char *title, const char *text, int timeout) +notification_backend_show (const char *title, const char *text) { } diff --git a/src/fe-gtk/notifications/notification-libnotify.c b/src/fe-gtk/notifications/notification-libnotify.c index d3e3a992..94f9679d 100644 --- a/src/fe-gtk/notifications/notification-libnotify.c +++ b/src/fe-gtk/notifications/notification-libnotify.c @@ -23,7 +23,7 @@ static gboolean strip_markup = FALSE; void -notification_backend_show (const char *title, const char *text, int timeout) +notification_backend_show (const char *title, const char *text) { NotifyNotification *notification; @@ -33,7 +33,6 @@ notification_backend_show (const char *title, const char *text, int timeout) notification = notify_notification_new (title, text, "hexchat"); notify_notification_set_hint (notification, "desktop-entry", g_variant_new_string ("hexchat")); - notify_notification_set_timeout (notification, timeout); notify_notification_show (notification, NULL); g_object_unref (notification); diff --git a/src/fe-gtk/notifications/notification-osx.m b/src/fe-gtk/notifications/notification-osx.m index c97c6629..c9ad72d0 100644 --- a/src/fe-gtk/notifications/notification-osx.m +++ b/src/fe-gtk/notifications/notification-osx.m @@ -20,7 +20,7 @@ #include void -notification_backend_show (const char *title, const char *text, int timeout) +notification_backend_show (const char *title, const char *text) { NSString *str_title = [[NSString alloc] initWithUTF8String:title]; NSString *str_text = [[NSString alloc] initWithUTF8String:text]; diff --git a/src/fe-gtk/notifications/notification-windows.c b/src/fe-gtk/notifications/notification-windows.c index 16cf3412..3fade306 100644 --- a/src/fe-gtk/notifications/notification-windows.c +++ b/src/fe-gtk/notifications/notification-windows.c @@ -23,20 +23,20 @@ #include -void (*winrt_notification_backend_show) (const char *title, const char *text, int timeout) = NULL; +void (*winrt_notification_backend_show) (const char *title, const char *text) = NULL; int (*winrt_notification_backend_init) (void) = NULL; void (*winrt_notification_backend_deinit) (void) = NULL; int (*winrt_notification_backend_supported) (void) = NULL; void -notification_backend_show (const char *title, const char *text, int timeout) +notification_backend_show (const char *title, const char *text) { if (winrt_notification_backend_show == NULL) { return; } - winrt_notification_backend_show (title, text, timeout); + winrt_notification_backend_show (title, text); } int diff --git a/src/fe-gtk/notifications/notification-winrt.cpp b/src/fe-gtk/notifications/notification-winrt.cpp index 74cc2e78..663f9c08 100644 --- a/src/fe-gtk/notifications/notification-winrt.cpp +++ b/src/fe-gtk/notifications/notification-winrt.cpp @@ -41,7 +41,7 @@ widen(const std::string & to_widen) extern "C" { __declspec (dllexport) void - notification_backend_show (const char *title, const char *text, int timeout) + notification_backend_show (const char *title, const char *text) { try { diff --git a/src/fe-gtk/plugin-notification.c b/src/fe-gtk/plugin-notification.c index 43ceeece..04a64213 100644 --- a/src/fe-gtk/plugin-notification.c +++ b/src/fe-gtk/plugin-notification.c @@ -60,16 +60,6 @@ should_alert (void) return TRUE; } -/* Returns timeout in ms */ -static int -get_timeout (void) -{ - int timeout = 0; - hexchat_get_prefs (ph, "input_balloon_time", NULL, &timeout); - - return timeout * 1000; -} - static gboolean is_ignored (char *nick) { @@ -91,7 +81,7 @@ show_notification (const char *title, const char *text) stripped_title = hexchat_strip (ph, title, -1, 7); stripped_text = hexchat_strip (ph, text, -1, 7); - notification_backend_show (stripped_title, stripped_text, get_timeout ()); + notification_backend_show (stripped_title, stripped_text); hexchat_free (ph, stripped_title); hexchat_free (ph, stripped_text);