comparison src/gtkstatusselector.c @ 10447:6feef0a9098a

[gaim-migrate @ 11712] A few minor improvements and some documentation updates. Conscious evolution in the back of your mind... committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 29 Dec 2004 21:53:59 +0000
parents ce098e226486
children 6d4f02da1cef
comparison
equal deleted inserted replaced
10446:904d03bfccce 10447:6feef0a9098a
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"
260 return TRUE; 261 return TRUE;
261 #endif 262 #endif
262 return FALSE; 263 return FALSE;
263 } 264 }
264 265
266 /*
267 * TODO: Get rid of the duplication in this function and
268 * insert_text_timeout_cb()
269 */
265 static void 270 static void
266 status_switched_cb(GtkWidget *combo, GaimGtkStatusSelector *selector) 271 status_switched_cb(GtkWidget *combo, GaimGtkStatusSelector *selector)
267 { 272 {
268 const char *status_type_id = NULL; 273 const char *status_type_id = NULL;
269 const char *text = NULL; 274 const char *text = NULL;
273 278
274 if (status_type_id == NULL) 279 if (status_type_id == NULL)
275 { 280 {
276 if (!strcmp(text, _("New Status"))) 281 if (!strcmp(text, _("New Status")))
277 { 282 {
278 /* TODO */ 283 gaim_gtk_status_editor_show(NULL);
279 } 284 }
280 } 285 }
281 else 286 else
282 { 287 {
283 /* 288 /*
342 347
343 if (status_type_id == NULL) 348 if (status_type_id == NULL)
344 { 349 {
345 if (!strcmp(text, _("New Status"))) 350 if (!strcmp(text, _("New Status")))
346 { 351 {
347 /* TODO */ 352 gaim_gtk_status_editor_show(NULL);
348 } 353 }
349 } 354 }
350 else 355 else
351 { 356 {
352 gchar *message; 357 gchar *message;
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