changeset 14873:3a23706f9f4b

[gaim-migrate @ 17642] Show icon pref. No way to change it yet (other than your editor) committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Wed, 01 Nov 2006 00:57:39 +0000
parents a73b2b332ec2
children 71149a751439
files gtk/gtkdocklet-x11.c gtk/gtkdocklet.c
diffstat 2 files changed, 26 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/gtkdocklet-x11.c	Tue Oct 31 23:01:39 2006 +0000
+++ b/gtk/gtkdocklet-x11.c	Wed Nov 01 00:57:39 2006 +0000
@@ -208,8 +208,11 @@
 {
 	g_return_if_fail(docklet != NULL);
 
+	if (embed_timeout)
+		g_source_remove(embed_timeout);
+	
 	gaim_gtk_docklet_remove();
-
+	
 	g_signal_handlers_disconnect_by_func(G_OBJECT(docklet), G_CALLBACK(docklet_x11_destroyed_cb), NULL);
 	gtk_widget_destroy(GTK_WIDGET(docklet));
 
--- a/gtk/gtkdocklet.c	Tue Oct 31 23:01:39 2006 +0000
+++ b/gtk/gtkdocklet.c	Wed Nov 01 00:57:39 2006 +0000
@@ -120,6 +120,18 @@
 	/* determine if any ims have unseen messages */
 	convs = get_pending_list(DOCKLET_TOOLTIP_LINE_LIMIT);
 
+	if (!strcmp(gaim_prefs_get_string("/gaim/gtk/docklet/show"), "pending")) {
+		if (convs && ui_ops->create && !visibility_manager) {
+	 		ui_ops->create();
+	   		return FALSE;
+		} else if (!convs && ui_ops->destroy && visibility_manager) {
+	  		ui_ops->destroy();
+	  	 	return FALSE;
+	  	} else if (!visibility_manager) {
+			return FALSE;
+		}
+	}
+
 	if (convs != NULL) {
 		pending = TRUE;
 
@@ -561,7 +573,8 @@
 gaim_gtk_docklet_embedded()
 {
 	if (!visibility_manager) {
-		gaim_gtk_blist_visibility_manager_add();
+		if (strcmp(gaim_prefs_get_string("/gaim/gtk/docklet/show"),"pending"))
+			gaim_gtk_blist_visibility_manager_add();
 		visibility_manager = TRUE;
 	}
 	docklet_update_status();
@@ -574,7 +587,12 @@
 {
 	if (visibility_manager) {
 		gaim_gtk_blist_visibility_manager_remove();
+		if (docklet_blinking_timer) {
+			g_source_remove(docklet_blinking_timer);
+			docklet_blinking_timer = 0;
+		}
 		visibility_manager = FALSE;
+		status = DOCKLET_STATUS_OFFLINE;
 	}
 }
 
@@ -604,8 +622,9 @@
         gaim_prefs_add_string("/gaim/gtk/docklet/show", "always");
 
 	docklet_ui_init();
-	if (ui_ops && ui_ops->create)
+	if (!strcmp(gaim_prefs_get_string("/gaim/gtk/docklet/show"), "always") && ui_ops && ui_ops->create)
 		ui_ops->create();
+	
 	gaim_signal_connect(conn_handle, "signed-on",
 			    docklet_handle, GAIM_CALLBACK(docklet_signed_on_cb), NULL);
 	gaim_signal_connect(conn_handle, "signed-off",
@@ -631,6 +650,6 @@
 void
 gaim_gtk_docklet_uninit()
 {
-	if (ui_ops && ui_ops->destroy)
+	if (visibility_manager && ui_ops && ui_ops->destroy)
 		ui_ops->destroy();
 }