Mercurial > pidgin
diff gtk/gtkdocklet.c @ 14885:51c51d89c114
[gaim-migrate @ 17654]
This seems good. Change prefs dialog around a bit to add docklet pref. beta5 time?
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Thu, 02 Nov 2006 21:09:12 +0000 |
parents | 3a23706f9f4b |
children | 621e798f435c |
line wrap: on
line diff
--- a/gtk/gtkdocklet.c Thu Nov 02 02:57:25 2006 +0000 +++ b/gtk/gtkdocklet.c Thu Nov 02 21:09:12 2006 +0000 @@ -127,11 +127,12 @@ } else if (!convs && ui_ops->destroy && visibility_manager) { ui_ops->destroy(); return FALSE; - } else if (!visibility_manager) { - return FALSE; } } + if (!visibility_manager) + return FALSE; + if (convs != NULL) { pending = TRUE; @@ -292,6 +293,23 @@ docklet_update_status(); } +static void +docklet_show_pref_changed_cb(const char *name, GaimPrefType type, + gconstpointer value, gpointer data) +{ + const char *val = value; + if (!strcmp(val, "always")) { + if (!visibility_manager && ui_ops->create) + ui_ops->create(); + } else if (!strcmp(val, "never")) { + if (visibility_manager && ui_ops->destroy) + ui_ops->destroy(); + } else { + docklet_update_status(); + } + +} + /************************************************************************** * docklet pop-up menu **************************************************************************/ @@ -620,6 +638,8 @@ gaim_prefs_add_none("/gaim/gtk/docklet"); gaim_prefs_add_bool("/gaim/gtk/docklet/blink", FALSE); gaim_prefs_add_string("/gaim/gtk/docklet/show", "always"); + gaim_prefs_connect_callback(docklet_handle, "/gaim/gtk/docklet/show", + docklet_show_pref_changed_cb, NULL); docklet_ui_init(); if (!strcmp(gaim_prefs_get_string("/gaim/gtk/docklet/show"), "always") && ui_ops && ui_ops->create)