comparison src/gtkstatusbox.c @ 11806:7584d802f0ac

[gaim-migrate @ 14097] 1. Improve "gaim -n" Using this now sets your current status to "Offline." This isn't shown in the gtkstatusbox yet. 2. Change gtkstatusbox to use gaim_savedstatus_activate() instead of having duplicate code. 3. Change gaim_savedstatus_activate() to only attempt to set the "message" attribute of a status when the status type supports the attribute. I think this'll get rid of some warnings CVS is getting good. Can you feel it? committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Tue, 25 Oct 2005 04:23:07 +0000
parents f54c680d835c
children 86cdfd6b32a6
comparison
equal deleted inserted replaced
11805:615c2fd3d72e 11806:7584d802f0ac
629 static void 629 static void
630 activate_currently_selected_status(GtkGaimStatusBox *status_box) 630 activate_currently_selected_status(GtkGaimStatusBox *status_box)
631 { 631 {
632 GtkGaimStatusBoxItemType type; 632 GtkGaimStatusBoxItemType type;
633 gchar *title; 633 gchar *title;
634 GList *l;
635 GtkTreeIter iter; 634 GtkTreeIter iter;
636 char *message; 635 char *message;
637 GaimSavedStatus *saved_status; 636 GaimSavedStatus *saved_status;
638 637
639 gtk_combo_box_get_active_iter(GTK_COMBO_BOX(status_box), &iter); 638 gtk_combo_box_get_active_iter(GTK_COMBO_BOX(status_box), &iter);
658 gaim_savedstatus_set_type(saved_status, type); 657 gaim_savedstatus_set_type(saved_status, type);
659 gaim_savedstatus_set_message(saved_status, message); 658 gaim_savedstatus_set_message(saved_status, message);
660 gaim_prefs_set_string("/core/status/current", _("Default")); 659 gaim_prefs_set_string("/core/status/current", _("Default"));
661 660
662 /* Set the status for each account */ 661 /* Set the status for each account */
663 for (l = gaim_accounts_get_all(); l != NULL; l = l->next) 662 gaim_savedstatus_activate(saved_status);
664 {
665 GaimAccount *account = (GaimAccount*)l->data;
666 GaimStatusType *status_type;
667
668 if (!gaim_account_get_enabled(account, GAIM_GTK_UI))
669 continue;
670
671 status_type = gaim_account_get_status_type_with_primitive(account, type);
672
673 if (status_type == NULL)
674 continue;
675
676 gaim_account_set_status(account,
677 gaim_status_type_get_id(status_type),
678 TRUE, "message", message, NULL);
679 }
680 663
681 g_free(title); 664 g_free(title);
682 g_free(message); 665 g_free(message);
683 } 666 }
684 667