# HG changeset patch
# Node ID fabb6b9cef3b
# Parent  b44cb2532f9b
diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -405,6 +405,8 @@
 		* purple_connection_new_unregister
 		* purple_connection_destroy
 		* purple_connection_set_account
+		* PurpleConnectionUiOps->connect_progress
+		* purple_connection_update_progress
 		* purple_connections_get_connecting
 		* purple_contact_set_alias
 		* purple_conv_chat_set_users
diff --git a/finch/gntconn.c b/finch/gntconn.c
--- a/finch/gntconn.c
+++ b/finch/gntconn.c
@@ -123,7 +123,6 @@
 
 static PurpleConnectionUiOps ops =
 {
-	NULL, /* connect_progress */
 	NULL, /* connected */
 	NULL, /* disconnected */
 	NULL, /* notice */
diff --git a/libpurple/connection.h b/libpurple/connection.h
--- a/libpurple/connection.h
+++ b/libpurple/connection.h
@@ -218,11 +218,6 @@
 
 /**
  * PurpleConnectionUiOps:
- * @connect_progress: When an account is connecting, this operation is called to
- *                    notify the UI of what is happening, as well as which @step
- *                    out of @step_count has been reached (which might be
- *                    displayed as a progress bar).
- *                    <sbr/>See purple_connection_update_progress().
  * @connected: Called when a connection is established (just before the
  *   <link linkend="connections-signed-on"><literal>"signed-on"</literal></link>
  *             signal).
@@ -257,11 +252,6 @@
  */
 struct _PurpleConnectionUiOps
 {
-	void (*connect_progress)(PurpleConnection *gc,
-	                         const char *text,
-	                         size_t step,
-	                         size_t step_count);
-
 	void (*connected)(PurpleConnection *gc);
 	void (*disconnected)(PurpleConnection *gc);
 
@@ -469,18 +459,6 @@
 void *purple_connection_get_protocol_data(PurpleConnection *gc);
 
 /**
- * purple_connection_update_progress:
- * @gc:    The connection.
- * @text:  Information on the current step.
- * @step:  The current step.
- * @count: The total number of steps.
- *
- * Updates the connection progress.
- */
-void purple_connection_update_progress(PurpleConnection *gc, const char *text,
-									 size_t step, size_t count);
-
-/**
  * purple_connection_notice:
  * @gc:   The connection.
  * @text: The notice text.
diff --git a/libpurple/connection.c b/libpurple/connection.c
--- a/libpurple/connection.c
+++ b/libpurple/connection.c
@@ -337,24 +337,6 @@
 }
 
 void
-purple_connection_update_progress(PurpleConnection *gc, const char *text,
-                                  size_t step, size_t count)
-{
-	PurpleConnectionUiOps *ops;
-
-	g_return_if_fail(PURPLE_IS_CONNECTION(gc));
-	g_return_if_fail(text != NULL);
-	g_return_if_fail(step < count);
-	g_return_if_fail(count > 1);
-
-	ops = purple_connections_get_ui_ops();
-
-	if(ops != NULL && ops->connect_progress != NULL) {
-		ops->connect_progress(gc, text, step, count);
-	}
-}
-
-void
 purple_connection_notice(PurpleConnection *gc, const char *text) {
 	PurpleConnectionUiOps *ops;
 
diff --git a/libpurple/protocols/facebook/facebook.c b/libpurple/protocols/facebook/facebook.c
--- a/libpurple/protocols/facebook/facebook.c
+++ b/libpurple/protocols/facebook/facebook.c
@@ -100,11 +100,7 @@
 fb_cb_api_auth(FbApi *api, gpointer data)
 {
 	FbData *fata = data;
-	PurpleConnection *gc;
 
-	gc = fb_data_get_connection(fata);
-
-	purple_connection_update_progress(gc, _("Fetching contacts"), 2, 4);
 	fb_data_save(fata);
 	fb_api_contacts(api);
 }
@@ -295,7 +291,6 @@
 		type = purple_status_get_status_type(status);
 		pstat = purple_status_type_get_primitive(type);
 
-		purple_connection_update_progress(gc, _("Connecting"), 3, 4);
 		fb_api_connect(api, pstat == PURPLE_STATUS_INVISIBLE);
 	}
 
@@ -1110,13 +1105,10 @@
 	if (!fb_data_load(fata) || !purple_account_get_remember_password(acct)) {
 		user = purple_account_get_username(acct);
 		pass = purple_connection_get_password(gc);
-		purple_connection_update_progress(gc, _("Authenticating"),
-		                                  1, 4);
 		fb_api_auth(api, user, pass);
 		return;
 	}
 
-	purple_connection_update_progress(gc, _("Fetching contacts"), 2, 4);
 	fb_api_contacts(api);
 }
 
diff --git a/libpurple/protocols/gg/gg.c b/libpurple/protocols/gg/gg.c
--- a/libpurple/protocols/gg/gg.c
+++ b/libpurple/protocols/gg/gg.c
@@ -531,7 +531,6 @@
 					PURPLE_INPUT_READ,
 					ggp_callback_recv, gc);
 
-				purple_connection_update_progress(gc, _("Connected"), 1, 2);
 				purple_connection_set_state(gc, PURPLE_CONNECTION_CONNECTED);
 
 				ggp_buddylist_send(gc);
@@ -893,7 +892,6 @@
 	purple_str_wipe(glp->password);
 	g_free(glp);
 
-	purple_connection_update_progress(gc, _("Connecting"), 0, 2);
 	if (info->session == NULL) {
 		purple_connection_error (gc,
 			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
diff --git a/libpurple/protocols/irc/irc.c b/libpurple/protocols/irc/irc.c
--- a/libpurple/protocols/irc/irc.c
+++ b/libpurple/protocols/irc/irc.c
@@ -560,8 +560,6 @@
 	irc->msgs = g_hash_table_new(g_str_hash, g_str_equal);
 	irc_msg_table_build(irc);
 
-	purple_connection_update_progress(gc, _("Connecting"), 1, 2);
-
 	client = purple_gio_socket_client_new(account, &error);
 
 	if (client == NULL) {
diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c
--- a/libpurple/protocols/jabber/jabber.c
+++ b/libpurple/protocols/jabber/jabber.c
@@ -1623,55 +1623,17 @@
 
 void jabber_stream_set_state(JabberStream *js, JabberStreamState state)
 {
-#define JABBER_CONNECT_STEPS \
-	((G_IS_TLS_CONNECTION(js->stream) || \
-	  js->state == JABBER_STREAM_INITIALIZING_ENCRYPTION) \
-	         ? 9 \
-	         : 5)
-
 	js->state = state;
-	switch(state) {
-		case JABBER_STREAM_OFFLINE:
-			break;
-		case JABBER_STREAM_CONNECTING:
-			purple_connection_update_progress(js->gc, _("Connecting"), 1,
-					JABBER_CONNECT_STEPS);
-			break;
-		case JABBER_STREAM_INITIALIZING:
-			purple_connection_update_progress(
-			        js->gc, _("Initializing Stream"),
-			        G_IS_TLS_CONNECTION(js->stream) ? 5 : 2,
-			        JABBER_CONNECT_STEPS);
-			jabber_stream_init(js);
-			break;
-		case JABBER_STREAM_INITIALIZING_ENCRYPTION:
-			purple_connection_update_progress(js->gc, _("Initializing SSL/TLS"),
-											  6, JABBER_CONNECT_STEPS);
-			break;
-		case JABBER_STREAM_AUTHENTICATING:
-			purple_connection_update_progress(
-			        js->gc, _("Authenticating"),
-			        G_IS_TLS_CONNECTION(js->stream) ? 7 : 3,
-			        JABBER_CONNECT_STEPS);
-			break;
-		case JABBER_STREAM_POST_AUTH:
-			purple_connection_update_progress(
-			        js->gc, _("Re-initializing Stream"),
-			        (G_IS_TLS_CONNECTION(js->stream) ? 8 : 4),
-			        JABBER_CONNECT_STEPS);
-
-			break;
-		case JABBER_STREAM_CONNECTED:
-			/* Send initial presence */
-			jabber_presence_send(js, TRUE);
-			/* Start up the inactivity timer */
-			jabber_stream_restart_inactivity_timer(js);
-
-			purple_connection_set_state(js->gc, PURPLE_CONNECTION_CONNECTED);
-			break;
+	if(state == JABBER_STREAM_INITIALIZING) {
+		jabber_stream_init(js);
+	} else if(state == JABBER_STREAM_CONNECTED) {
+		/* Send initial presence */
+		jabber_presence_send(js, TRUE);
+		/* Start up the inactivity timer */
+		jabber_stream_restart_inactivity_timer(js);
+
+		purple_connection_set_state(js->gc, PURPLE_CONNECTION_CONNECTED);
 	}
-
-#undef JABBER_CONNECT_STEPS
 }
 
 char *jabber_get_next_id(JabberStream *js)
diff --git a/libpurple/protocols/novell/novell.c b/libpurple/protocols/novell/novell.c
--- a/libpurple/protocols/novell/novell.c
+++ b/libpurple/protocols/novell/novell.c
@@ -1734,9 +1734,6 @@
 	if ((user == NULL) || (conn = user->conn) == NULL)
 		return;
 
-	purple_connection_update_progress(gc, _("Authenticating..."),
-									2, NOVELL_CONNECT_STEPS);
-
 	conn->stream = G_IO_STREAM(sockconn);
 	conn->input =
 	        g_data_input_stream_new(g_io_stream_get_input_stream(conn->stream));
@@ -1764,9 +1761,6 @@
 			_("Unable to connect"));
 	}
 
-	purple_connection_update_progress(gc, _("Waiting for response..."),
-									3, NOVELL_CONNECT_STEPS);
-
 	g_free(ua);
 	g_free(my_addr);
 }
@@ -2229,9 +2223,6 @@
 		purple_connection_set_protocol_data(gc, user);
 
 		/* connect to the server */
-		purple_connection_update_progress(gc, _("Connecting"),
-										1, NOVELL_CONNECT_STEPS);
-
 		user->conn->client = purple_gio_socket_client_new(account, &error);
 		if (user->conn->client == NULL) {
 			purple_connection_take_error(gc, error);
diff --git a/libpurple/protocols/sametime/sametime.c b/libpurple/protocols/sametime/sametime.c
--- a/libpurple/protocols/sametime/sametime.c
+++ b/libpurple/protocols/sametime/sametime.c
@@ -1467,56 +1467,19 @@
 				   gpointer info) {
   struct mwPurpleProtocolData *pd;
   PurpleConnection *gc;
-  const char *msg = NULL;
 
   pd = mwSession_getClientData(session);
   gc = pd->gc;
 
   switch(state) {
-  case mwSession_STARTING:
-    msg = _("Sending Handshake");
-    purple_connection_update_progress(gc, msg, 2, MW_CONNECT_STEPS);
-    break;
-
-  case mwSession_HANDSHAKE:
-    msg = _("Waiting for Handshake Acknowledgement");
-    purple_connection_update_progress(gc, msg, 3, MW_CONNECT_STEPS);
-    break;
-
-  case mwSession_HANDSHAKE_ACK:
-    msg = _("Handshake Acknowledged, Sending Login");
-    purple_connection_update_progress(gc, msg, 4, MW_CONNECT_STEPS);
-    break;
-
-  case mwSession_LOGIN:
-    msg = _("Waiting for Login Acknowledgement");
-    purple_connection_update_progress(gc, msg, 5, MW_CONNECT_STEPS);
-    break;
 
   case mwSession_LOGIN_REDIR:
-    msg = _("Login Redirected");
-    purple_connection_update_progress(gc, msg, 6, MW_CONNECT_STEPS);
     session_loginRedirect(session, info);
     break;
 
-  case mwSession_LOGIN_CONT:
-    msg = _("Forcing Login");
-    purple_connection_update_progress(gc, msg, 7, MW_CONNECT_STEPS);
-    break;
-
-  case mwSession_LOGIN_ACK:
-    msg = _("Login Acknowledged");
-    purple_connection_update_progress(gc, msg, 8, MW_CONNECT_STEPS);
-    break;
-
   case mwSession_STARTED:
-    msg = _("Starting Services");
-    purple_connection_update_progress(gc, msg, 9, MW_CONNECT_STEPS);
-
     session_started(pd);
 
-    msg = _("Connected");
-    purple_connection_update_progress(gc, msg, 10, MW_CONNECT_STEPS);
     purple_connection_set_state(gc, PURPLE_CONNECTION_CONNECTED);
     break;
 
@@ -3635,8 +3598,6 @@
 			  GUINT_TO_POINTER(minor), NULL);
   }
 
-  purple_connection_update_progress(gc, _("Connecting"), 1, MW_CONNECT_STEPS);
-
   pd->client = purple_gio_socket_client_new(account, &error);
   if (pd->client == NULL) {
     purple_connection_take_error(gc, error);
diff --git a/libpurple/protocols/silc/ops.c b/libpurple/protocols/silc/ops.c
--- a/libpurple/protocols/silc/ops.c
+++ b/libpurple/protocols/silc/ops.c
@@ -1695,12 +1695,6 @@
 	SilcPurpleAskPassphrase internal;
 	const char *password;
 
-	/* Progress */
-	if (sg->resuming)
-		purple_connection_update_progress(gc, _("Resuming session"), 4, 5);
-	else
-		purple_connection_update_progress(gc, _("Authenticating connection"), 4, 5);
-
 	/* Check configuration if we have this connection configured. */
 	if (auth_method == SILC_AUTH_PUBLIC_KEY &&
 	    purple_account_get_bool(sg->account, "pubkey-auth", FALSE)) {
@@ -1741,19 +1735,6 @@
 		       SilcPublicKey public_key,
 		       SilcVerifyPublicKey completion, void *context)
 {
-	PurpleConnection *gc = client->application;
-	SilcPurple sg = purple_connection_get_protocol_data(gc);
-
-	if (!sg->conn && (conn_type == SILC_CONN_SERVER ||
-			  conn_type == SILC_CONN_ROUTER)) {
-		/* Progress */
-		if (sg->resuming)
-			purple_connection_update_progress(gc, _("Resuming session"), 3, 5);
-		else
-			purple_connection_update_progress(gc, _("Verifying server public key"),
-							  3, 5);
-	}
-
 	/* Verify public key */
 	silcpurple_verify_public_key(client, conn, NULL, conn_type,
 				     public_key, completion, context);
diff --git a/libpurple/protocols/silc/silc.c b/libpurple/protocols/silc/silc.c
--- a/libpurple/protocols/silc/silc.c
+++ b/libpurple/protocols/silc/silc.c
@@ -402,10 +402,7 @@
 
 	/* Progress */
 	if (params.detach_data) {
-		purple_connection_update_progress(gc, _("Resuming session"), 2, 5);
 		sg->resuming = TRUE;
-	} else {
-		purple_connection_update_progress(gc, _("Performing key exchange"), 2, 5);
 	}
 
 	/* Perform SILC Key Exchange. */
@@ -556,9 +553,6 @@
 	char pkd[256], prd[256];
 
 
-	/* Progress */
-	purple_connection_update_progress(gc, _("Connecting to SILC Server"), 1, 5);
-
 	/* Load SILC key pair */
 	g_snprintf(pkd, sizeof(pkd), "%s" G_DIR_SEPARATOR_S "public_key.pub", silcpurple_silcdir());
 	g_snprintf(prd, sizeof(prd), "%s" G_DIR_SEPARATOR_S "private_key.prv", silcpurple_silcdir());
diff --git a/libpurple/protocols/silc/util.c b/libpurple/protocols/silc/util.c
--- a/libpurple/protocols/silc/util.c
+++ b/libpurple/protocols/silc/util.c
@@ -180,7 +180,6 @@
 	if ((g_stat(file_public_key, &st)) == -1) {
 		/* If file doesn't exist */
 		if (errno == ENOENT) {
-			purple_connection_update_progress(gc, _("Creating SILC key pair..."), 1, 5);
 			if (!silc_create_key_pair(SILCPURPLE_DEF_PKCS,
 						  SILCPURPLE_DEF_PKCS_LEN,
 						  file_public_key,
@@ -222,7 +221,6 @@
 	} else {
 		/* If file doesn't exist */
 		if (errno == ENOENT) {
-			purple_connection_update_progress(gc, _("Creating SILC key pair..."), 1, 5);
 			if (!silc_create_key_pair(SILCPURPLE_DEF_PKCS,
 						  SILCPURPLE_DEF_PKCS_LEN,
 						  file_public_key,
diff --git a/libpurple/protocols/zephyr/zephyr.c b/libpurple/protocols/zephyr/zephyr.c
--- a/libpurple/protocols/zephyr/zephyr.c
+++ b/libpurple/protocols/zephyr/zephyr.c
@@ -715,7 +715,6 @@
 	}
 
 	zephyr->encoding = (char *)purple_account_get_string(account, "encoding", ZEPHYR_FALLBACK_CHARSET);
-	purple_connection_update_progress(gc, _("Connecting"), 0, 8);
 
 	if (!login(zephyr)) {
 		return;
diff --git a/pidgin/gtkconn.c b/pidgin/gtkconn.c
--- a/pidgin/gtkconn.c
+++ b/pidgin/gtkconn.c
@@ -169,7 +169,6 @@
 
 static PurpleConnectionUiOps conn_ui_ops =
 {
-	NULL,
 	pidgin_connection_connected,
 	pidgin_connection_disconnected,
 	pidgin_connection_notice,
