From: Sean E. <sea...@us...> - 2005-03-02 20:37:04
|
Update of /cvsroot/gaim/gaim/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7910/src Modified Files: gtkaccount.c gtkstatusbox.c gtkstatusbox.h Log Message: Killed Napster. Some status changes. I may be making some status API changes CVS : ---------------------------------------------------------------------- Index: gtkaccount.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkaccount.c,v retrieving revision 1.170 retrieving revision 1.171 diff -u -d -p -r1.170 -r1.171 --- gtkaccount.c 1 Mar 2005 21:15:54 -0000 1.170 +++ gtkaccount.c 2 Mar 2005 20:36:51 -0000 1.171 @@ -43,6 +43,7 @@ #include "gtkblist.h" #include "gtkdialogs.h" #include "gtkutils.h" +#include "gtkstatusbox.h" #include "gtkstock.h" enum @@ -2038,6 +2039,14 @@ enabled_cb(GtkCellRendererToggle *render 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); Index: gtkstatusbox.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkstatusbox.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- gtkstatusbox.c 27 Feb 2005 08:35:11 -0000 1.1 +++ gtkstatusbox.c 2 Mar 2005 20:36:51 -0000 1.2 @@ -473,3 +473,21 @@ static void imhtml_changed_cb(GtkTextBuf 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; +} Index: gtkstatusbox.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkstatusbox.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- gtkstatusbox.h 27 Feb 2005 08:35:11 -0000 1.1 +++ gtkstatusbox.h 2 Mar 2005 20:36:51 -0000 1.2 @@ -106,6 +106,11 @@ gtk_gaim_status_box_set_connecting(GtkGa 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__ */ |