| 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 24 */ |
24 */ |
| 25 #include "internal.h" |
25 #include "internal.h" |
| 26 #include "gtkgaim.h" |
26 #include "gtkgaim.h" |
| 27 #include "gtkimhtml.h" |
27 #include "gtkimhtml.h" |
| |
28 #include "gtksavedstatuses.h" |
| 28 #include "gtkstatusselector.h" |
29 #include "gtkstatusselector.h" |
| 29 #include "gtkutils.h" |
30 #include "gtkutils.h" |
| 30 |
31 |
| 31 #include "account.h" |
32 #include "account.h" |
| 32 #include "debug.h" |
33 #include "debug.h" |
| 516 |
521 |
| 517 /* |
522 /* |
| 518 * If no accounts are enabled then gray ourself out and get |
523 * If no accounts are enabled then gray ourself out and get |
| 519 * outta hee. |
524 * outta hee. |
| 520 */ |
525 */ |
| 521 for(accounts = gaim_accounts_get_all(); accounts; accounts = accounts->next) { |
526 for (accounts = gaim_accounts_get_all(); accounts != NULL; |
| |
527 accounts = accounts->next) |
| |
528 { |
| 522 GaimAccount *a = accounts->data; |
529 GaimAccount *a = accounts->data; |
| 523 if (gaim_account_get_enabled(a, GAIM_GTK_UI)) { |
530 if (gaim_account_get_enabled(a, GAIM_GTK_UI)) |
| |
531 { |
| 524 enabled = TRUE; |
532 enabled = TRUE; |
| 525 break; |
533 break; |
| 526 } |
534 } |
| 527 } |
535 } |
| 528 |
536 |
| 529 if (enabled == FALSE) |
537 if (enabled == FALSE) |
| 530 { |
538 { |
| 531 gtk_widget_set_sensitive(GTK_WIDGET(selector), FALSE); |
539 gtk_widget_set_sensitive(GTK_WIDGET(selector), FALSE); |
| 532 return; |
540 return; |
| 533 } |
541 } |
| 578 |
586 |
| 579 if (!gaim_status_type_is_user_settable(status_type)) |
587 if (!gaim_status_type_is_user_settable(status_type)) |
| 580 continue; |
588 continue; |
| 581 |
589 |
| 582 /* |
590 /* |
| 583 * TODO Find a way to fallback to the GaimStatusPrimitive |
591 * TODO: Find a way to fallback to the GaimStatusPrimitive |
| 584 * if an icon for this id does not exist. |
592 * if an icon for this id does not exist. |
| 585 */ |
593 */ |
| 586 g_snprintf(filename, sizeof(filename), "%s.png", |
594 g_snprintf(filename, sizeof(filename), "%s.png", |
| 587 gaim_status_type_get_id(status_type)); |
595 gaim_status_type_get_id(status_type)); |
| 588 |
596 |
| 592 load_icon(filename)); |
600 load_icon(filename)); |
| 593 } |
601 } |
| 594 } |
602 } |
| 595 else |
603 else |
| 596 { |
604 { |
| |
605 /* TODO: Add "online" and "offline" here? */ |
| 597 add_item(selector, "available", _("Available"), |
606 add_item(selector, "available", _("Available"), |
| 598 load_icon("online.png")); |
607 load_icon("online.png")); |
| 599 add_item(selector, "away", _("Away"), load_icon("away.png")); |
608 add_item(selector, "away", _("Away"), load_icon("away.png")); |
| 600 } |
609 } |
| 601 |
610 |