changeset 5905:dbe2a2174be9

[gaim-migrate @ 6337] Some stuff from Robot101. It puts some docklet functionality back in, fixes a bug where connected accounts was being listed as connecting accounts, and something I'm not allowed to say, because it's just that cool. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 16 Jun 2003 04:15:35 +0000
parents ad8497bee878
children 390d32a6b130
files plugins/docklet/docklet.c src/connection.c
diffstat 2 files changed, 25 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/docklet/docklet.c	Mon Jun 16 02:25:40 2003 +0000
+++ b/plugins/docklet/docklet.c	Mon Jun 16 04:15:35 2003 +0000
@@ -79,6 +79,10 @@
 	gaim_prefs_set_bool(key, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)));
 }
 
+static void docklet_auto_login() {
+	gaim_accounts_auto_login(GAIM_GTK_UI);
+}
+
 static void docklet_flush_queue() {
 	if (unread_message_queue) {
 		purge_away_queue(&unread_message_queue);
@@ -98,10 +102,7 @@
 	switch (status) {
 		case offline:
 		case offline_connecting:
-/* XXX CHIP KILLED AUTO CONNECTING */
-#if 0
-			gaim_new_item_from_stock(menu, _("Auto-login"), GAIM_STOCK_SIGN_ON, G_CALLBACK(auto_login), NULL, 0, 0, NULL);
-#endif
+			gaim_new_item_from_stock(menu, _("Auto-login"), GAIM_STOCK_SIGN_ON, G_CALLBACK(docklet_auto_login), NULL, 0, 0, NULL);
 			break;
 		default:
 			gaim_new_item_from_stock(menu, _("New Message.."), GAIM_STOCK_IM, G_CALLBACK(show_im_dialog), NULL, 0, 0, NULL);
@@ -194,6 +195,14 @@
 			}
 			break;
 		case 2:
+			switch (status) {
+				case offline:
+				case offline_connecting:
+					docklet_auto_login();
+					break;
+				default:
+					break;
+			}
 			break;
 		case 3:
 			docklet_menu(event);
@@ -270,26 +279,17 @@
 			} else {
 				status = away;
 			}
-/* XXX Chip killed my dog... */
-#if 0
-		} else if (connecting_count) {
+		} else if (gaim_connections_get_connecting()) {
 			status = online_connecting;
-#endif
 		} else {
 			status = online;
 		}
 	} else {
-/* XXX ... and my pet goldfish ... */
-#if 0
-		if (connecting_count) {
+		if (gaim_connections_get_connecting()) {
 			status = offline_connecting;
 		} else {
-#endif
 			status = offline;
-/* XXX ... both of them. */
-#if 0
 		}
-#endif
 	}
 
 	/* update the icon if we changed status */
@@ -378,7 +378,10 @@
 	/* do this when idle so that if the prpl was connecting
 	   and was cancelled, we register that connecting_count
 	   has returned to 0 */
-	g_idle_add(docklet_update_status, &docklet);
+	/* no longer necessary because Chip decided that us plugins
+	 * didn't need to know if an account was connecting or not
+	 * g_idle_add(docklet_update_status, &docklet); */
+	docklet_update_status();
 }
 
 static void gaim_connecting(GaimAccount *account, void *data) {
@@ -452,7 +455,7 @@
 	g_object_unref(G_OBJECT(docklet));
 	docklet = NULL;
 
-	/* do this while gaim has no other way to toggle the global mute */
+	/* XXX: do this while gaim has no other way to toggle the global mute */
 	gaim_gtk_sound_set_mute(FALSE);
 
 	gaim_debug(GAIM_DEBUG_INFO, "docklet", "Tray Icon: removed\n");
--- a/src/connection.c	Mon Jun 16 02:25:40 2003 +0000
+++ b/src/connection.c	Mon Jun 16 04:15:35 2003 +0000
@@ -179,8 +179,12 @@
 
 	ops = gaim_get_connection_ui_ops();
 
-	if (gc->state != GAIM_CONNECTED)
+	if (gc->state == GAIM_CONNECTING) {
+		connections_connecting = g_list_append(connections_connecting, gc);
+	}
+	else {
 		connections_connecting = g_list_remove(connections_connecting, gc);
+	}
 
 	if (gc->state == GAIM_CONNECTED) {
 		GaimBlistNode *gnode,*bnode;
@@ -190,8 +194,6 @@
 		/* Set the time the account came online */
 		time(&gc->login_time);
 
-		connections_connecting = g_list_append(connections_connecting, gc);
-
 		if (ops != NULL && ops->connected != NULL)
 			ops->connected(gc);