changeset 10649:3353656c119e

[gaim-migrate @ 12167] Killed Napster. Some status changes. I may be making some status API changes CVS : ---------------------------------------------------------------------- committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Wed, 02 Mar 2005 20:36:52 +0000
parents 78720741ae3d
children 4f54e273affd
files src/gtkaccount.c src/gtkstatusbox.c src/gtkstatusbox.h src/protocols/napster/napster.c
diffstat 4 files changed, 33 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkaccount.c	Wed Mar 02 11:54:08 2005 +0000
+++ b/src/gtkaccount.c	Wed Mar 02 20:36:52 2005 +0000
@@ -43,6 +43,7 @@
 #include "gtkblist.h"
 #include "gtkdialogs.h"
 #include "gtkutils.h"
+#include "gtkstatusbox.h"
 #include "gtkstock.h"
 
 enum
@@ -2038,6 +2039,14 @@
 					   COLUMN_DATA, &account,
 					   COLUMN_ENABLED, &enabled,
 					   -1);
+	if (enabled) {
+		gaim_account_disconnect(account);
+	} else {
+		GaimGtkBuddyList *gtkblist = gaim_gtk_blist_get_default_gtk_blist();
+		const char *type = gtk_gaim_status_box_get_active_type(GTK_GAIM_STATUS_BOX(gtkblist->statusbox));
+		const char *message = gtk_gaim_status_box_get_message(GTK_GAIM_STATUS_BOX(gtkblist->statusbox));
+		gaim_account_set_status(account, type, TRUE, "message", message, NULL);
+	}
 
 	gaim_account_set_enabled(account, GAIM_GTK_UI, !enabled);
 
--- a/src/gtkstatusbox.c	Wed Mar 02 11:54:08 2005 +0000
+++ b/src/gtkstatusbox.c	Wed Mar 02 20:36:52 2005 +0000
@@ -473,3 +473,21 @@
 	box->typing = g_timeout_add(3000, (GSourceFunc)remove_typing_cb, box);
 	gtk_gaim_status_box_refresh(box);
 }
+
+const char *gtk_gaim_status_box_get_active_type(GtkGaimStatusBox *status_box)
+{
+	GtkTreeIter iter;
+	char *type;
+	gtk_combo_box_get_active_iter(GTK_COMBO_BOX(status_box), &iter);
+	gtk_tree_model_get(GTK_TREE_MODEL(status_box->dropdown_store), &iter, 
+			   TYPE_COLUMN, &type, -1);
+	return type;
+}
+
+const char *gtk_gaim_status_box_get_message(GtkGaimStatusBox *status_box)
+{
+	if (status_box->imhtml_visible)
+		return gtk_imhtml_get_markup(GTK_IMHTML(status_box->imhtml));
+	else
+		return NULL;
+}
--- a/src/gtkstatusbox.h	Wed Mar 02 11:54:08 2005 +0000
+++ b/src/gtkstatusbox.h	Wed Mar 02 20:36:52 2005 +0000
@@ -106,6 +106,11 @@
 void
 gtk_gaim_status_box_pulse_connecting(GtkGaimStatusBox *status_box);
 
+
+const char *gtk_gaim_status_box_get_active_type(GtkGaimStatusBox *status_box);
+
+const char *gtk_gaim_status_box_get_message(GtkGaimStatusBox *status_box);
+
 G_END_DECLS
 
 #endif /* __GTK_GAIM_GTK_STATUS_COMBO_BOX_H__ */
--- a/src/protocols/napster/napster.c	Wed Mar 02 11:54:08 2005 +0000
+++ b/src/protocols/napster/napster.c	Wed Mar 02 20:36:52 2005 +0000
@@ -656,7 +656,7 @@
 static GaimPluginInfo info =
 {
 	GAIM_PLUGIN_MAGIC,
-	GAIM_MAJOR_VERSION,
+	0,
 	GAIM_MINOR_VERSION,
 	GAIM_PLUGIN_PROTOCOL,                             /**< type           */
 	NULL,                                             /**< ui_requirement */