changeset 14751:510da3975938

[gaim-migrate @ 17508] docklet conversion fixes from charkins. Thanks committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Wed, 18 Oct 2006 03:27:43 +0000
parents 2a7700895952
children 4124030c3f3a
files gtk/gtkdocklet-x11.c gtk/gtkdocklet.c gtk/win32/gtkdocklet-win32.c
diffstat 3 files changed, 16 insertions(+), 76 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/gtkdocklet-x11.c	Wed Oct 18 02:16:50 2006 +0000
+++ b/gtk/gtkdocklet-x11.c	Wed Oct 18 03:27:43 2006 +0000
@@ -56,7 +56,7 @@
 static void
 docklet_x11_embedded_cb(GtkWidget *widget, void *data)
 {
-	gaim_debug(GAIM_DEBUG_INFO, "tray icon", "embedded\n");
+	gaim_debug(GAIM_DEBUG_INFO, "docklet", "embedded\n");
 	
 	g_source_remove(embed_timeout);
 	embed_timeout = 0;
@@ -66,7 +66,7 @@
 static void
 docklet_x11_destroyed_cb(GtkWidget *widget, void *data)
 {
-	gaim_debug(GAIM_DEBUG_INFO, "tray icon", "destroyed\n");
+	gaim_debug(GAIM_DEBUG_INFO, "docklet", "destroyed\n");
 
 	gaim_gtk_docklet_remove();
 
@@ -222,7 +222,7 @@
 
 	image = NULL;
 
-	gaim_debug(GAIM_DEBUG_INFO, "tray icon", "destroyed\n");
+	gaim_debug(GAIM_DEBUG_INFO, "docklet", "destroyed\n");
 }
 
 static gboolean
@@ -233,7 +233,7 @@
 	 * loaded so that it can embed automatically if/when a notification
 	 * area becomes available.
 	 */
-	gaim_debug_info("tray icon", "failed to embed within timeout\n");
+	gaim_debug_info("docklet", "failed to embed within timeout\n");
 	gaim_gtk_docklet_remove();
 	
 	return FALSE;
@@ -248,7 +248,7 @@
 		/* if this is being called when a tray icon exists, it's because
 		   something messed up. try destroying it before we proceed,
 		   although docklet_refcount may be all hosed. hopefully won't happen. */
-		gaim_debug(GAIM_DEBUG_WARNING, "tray icon", "trying to create icon but it already exists?\n");
+		gaim_debug(GAIM_DEBUG_WARNING, "docklet", "trying to create icon but it already exists?\n");
 		docklet_x11_destroy();
 	}
 
@@ -281,7 +281,7 @@
 	gaim_gtk_docklet_embedded();
 	embed_timeout = g_timeout_add(EMBED_TIMEOUT, docklet_x11_embed_timeout_cb, NULL);
 
-	gaim_debug(GAIM_DEBUG_INFO, "tray icon", "created\n");
+	gaim_debug(GAIM_DEBUG_INFO, "docklet", "created\n");
 }
 
 static struct docklet_ui_ops ui_ops =
--- a/gtk/gtkdocklet.c	Wed Oct 18 02:16:50 2006 +0000
+++ b/gtk/gtkdocklet.c	Wed Oct 18 03:27:43 2006 +0000
@@ -89,30 +89,16 @@
 static GList *
 get_pending_list(guint max)
 {
-	const char *im = gaim_prefs_get_string("/plugins/gtk/docklet/blink_im");
-	const char *chat = gaim_prefs_get_string("/plugins/gtk/docklet/blink_chat");
 	GList *l_im = NULL;
 	GList *l_chat = NULL;
 
-	if (im != NULL && strcmp(im, "always") == 0) {
-		l_im = gaim_gtk_conversations_find_unseen_list(GAIM_CONV_TYPE_IM,
-													   GAIM_UNSEEN_TEXT,
-													   FALSE, max);
-	} else if (im != NULL && strcmp(im, "hidden") == 0) {
-		l_im = gaim_gtk_conversations_find_unseen_list(GAIM_CONV_TYPE_IM,
-													   GAIM_UNSEEN_TEXT,
-													   TRUE, max);
-	}
+	l_im = gaim_gtk_conversations_find_unseen_list(GAIM_CONV_TYPE_IM,
+	   					       GAIM_UNSEEN_TEXT,
+						       FALSE, max);
 
-	if (chat != NULL && strcmp(chat, "always") == 0) {
-		l_chat = gaim_gtk_conversations_find_unseen_list(GAIM_CONV_TYPE_CHAT,
-													   GAIM_UNSEEN_TEXT,
-													   FALSE, max);
-	} else if (chat != NULL && strcmp(chat, "nick") == 0) {
-		l_chat = gaim_gtk_conversations_find_unseen_list(GAIM_CONV_TYPE_CHAT,
-													   GAIM_UNSEEN_NICK,
-													   FALSE, max);
-	}
+	l_chat = gaim_gtk_conversations_find_unseen_list(GAIM_CONV_TYPE_CHAT,
+		 					 GAIM_UNSEEN_NICK,
+			    			         FALSE, max);
 
 	if (l_im != NULL && l_chat != NULL)
 		return g_list_concat(l_im, l_chat);
@@ -601,10 +587,6 @@
 	void *accounts_handle = gaim_accounts_get_handle();
 	void *docklet_handle = gaim_gtk_docklet_get_handle();
 
-	gaim_prefs_add_none("/plugins/gtk/docklet");
-	gaim_prefs_add_string("/plugins/gtk/docklet/blink_im", "hidden");
-	gaim_prefs_add_string("/plugins/gtk/docklet/blink_chat", "never");
-
 	docklet_ui_init();
 	if (ui_ops && ui_ops->create)
 		ui_ops->create();
@@ -627,11 +609,6 @@
 			    docklet_handle, GAIM_CALLBACK(gaim_quit_cb), NULL);
 #endif
 
-/*	gaim_prefs_connect_callback(plugin, "/plugins/gtk/docklet/blink_im",
-								docklet_prefs_cb, NULL);
-	gaim_prefs_connect_callback(plugin, "/plugins/gtk/docklet/blink_chat",
-								docklet_prefs_cb, NULL);
-*/
 	enable_join_chat = online_account_supports_chat();
 }
 
@@ -641,40 +618,3 @@
 	if (ui_ops && ui_ops->destroy)
 		ui_ops->destroy();
 }
-
-#if 0
-static GtkWidget *
-plugin_config_frame(GaimPlugin *plugin)
-{
-	GtkWidget *frame;
-	GtkWidget *vbox;
-	GtkSizeGroup *sg;
-	GtkWidget *dd;
-
-	frame = gtk_vbox_new(FALSE, 18);
-	gtk_container_set_border_width(GTK_CONTAINER(frame), 12);
-
-	vbox = gaim_gtk_make_frame(frame, _("Blink tray icon for unread..."));
-	sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
-
-	dd = gaim_gtk_prefs_dropdown(vbox, _("_Instant Messages:"),
-							GAIM_PREF_STRING, "/plugins/gtk/docklet/blink_im",
-							_("Never"), "never",
-							_("In hidden conversations"), "hidden",
-							_("Always"), "always",
-							NULL);
-	gtk_size_group_add_widget(sg, dd);
-
-	dd = gaim_gtk_prefs_dropdown(vbox, _("C_hat Messages:"),
-							GAIM_PREF_STRING, "/plugins/gtk/docklet/blink_chat",
-							_("Never"), "never",
-							_("When my nick is said"), "nick",
-							_("Always"), "always",
-							NULL);
-	gtk_size_group_add_widget(sg, dd);
-
-	gtk_widget_show_all(frame);
-	return frame;
-}
-#endif
-
--- a/gtk/win32/gtkdocklet-win32.c	Wed Oct 18 02:16:50 2006 +0000
+++ b/gtk/win32/gtkdocklet-win32.c	Wed Oct 18 03:27:43 2006 +0000
@@ -58,16 +58,16 @@
 
 	switch(msg) {
 	case WM_CREATE:
-		gaim_debug(GAIM_DEBUG_INFO, "tray icon", "WM_CREATE\n");
+		gaim_debug(GAIM_DEBUG_INFO, "docklet", "WM_CREATE\n");
 		taskbarRestartMsg = RegisterWindowMessage("TaskbarCreated");
 		break;
 		
 	case WM_TIMER:
-		gaim_debug(GAIM_DEBUG_INFO, "tray icon", "WM_TIMER\n");
+		gaim_debug(GAIM_DEBUG_INFO, "docklet", "WM_TIMER\n");
 		break;
 
 	case WM_DESTROY:
-		gaim_debug(GAIM_DEBUG_INFO, "tray icon", "WM_DESTROY\n");
+		gaim_debug(GAIM_DEBUG_INFO, "docklet", "WM_DESTROY\n");
 		break;
 
 	case WM_TRAYMESSAGE:
@@ -233,7 +233,7 @@
 	gaim_signal_connect(gaim_gtk_blist_get_handle(), "gtkblist-unhiding",
 			gaim_gtk_docklet_get_handle(), GAIM_CALLBACK(wgaim_tray_maximize), NULL);
 
-	gaim_debug(GAIM_DEBUG_INFO, "tray icon", "created\n");
+	gaim_debug(GAIM_DEBUG_INFO, "docklet", "created\n");
 }
 
 static void wgaim_tray_destroy() {