Mercurial > pidgin
comparison src/gtkstatusbox.c @ 13079:896d6c305429
[gaim-migrate @ 15441]
Fix the bug where available and other stuff in the status box had the
disk icon on it.
Also, if the user selected a status that is not in the status box,
then don't select anything in the status menu
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Tue, 31 Jan 2006 04:40:30 +0000 |
parents | 0afb445a3433 |
children | 0aa231ebbfd5 |
comparison
equal
deleted
inserted
replaced
13078:55c1e5cec4dc | 13079:896d6c305429 |
---|---|
426 (primitive == GAIM_STATUS_INVISIBLE) || (primitive == GAIM_STATUS_OFFLINE)) && | 426 (primitive == GAIM_STATUS_INVISIBLE) || (primitive == GAIM_STATUS_OFFLINE)) && |
427 (!gaim_savedstatus_has_substatuses(saved_status))) | 427 (!gaim_savedstatus_has_substatuses(saved_status))) |
428 { | 428 { |
429 index = get_statusbox_index(status_box, saved_status); | 429 index = get_statusbox_index(status_box, saved_status); |
430 gtk_combo_box_set_active(GTK_COMBO_BOX(status_box), index); | 430 gtk_combo_box_set_active(GTK_COMBO_BOX(status_box), index); |
431 | |
432 } | 431 } |
433 else | 432 else |
434 { | 433 { |
435 GtkTreeIter iter; | 434 GtkTreeIter iter; |
436 gpointer data; | 435 gpointer data; |
489 static void | 488 static void |
490 add_popular_statuses(GtkGaimStatusBox *statusbox) | 489 add_popular_statuses(GtkGaimStatusBox *statusbox) |
491 { | 490 { |
492 GList *list, *cur; | 491 GList *list, *cur; |
493 GtkIconSize icon_size; | 492 GtkIconSize icon_size; |
493 const GdkPixbuf *orig; | |
494 GdkPixbuf *pixbuf, *emblem; | 494 GdkPixbuf *pixbuf, *emblem; |
495 int width, height; | 495 int width, height; |
496 | 496 |
497 list = gaim_savedstatuses_get_popular(6); | 497 list = gaim_savedstatuses_get_popular(6); |
498 if (list == NULL) | 498 if (list == NULL) |
503 icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS); | 503 icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS); |
504 else | 504 else |
505 icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS_SMALL); | 505 icon_size = gtk_icon_size_from_name(GAIM_ICON_SIZE_STATUS_SMALL); |
506 | 506 |
507 /* Create the icon to use for non-transient saved-statuses */ | 507 /* Create the icon to use for non-transient saved-statuses */ |
508 pixbuf = gtk_widget_render_icon(GTK_WIDGET(statusbox->vbox), | 508 orig = gtk_widget_render_icon(GTK_WIDGET(statusbox->vbox), |
509 GAIM_STOCK_STATUS_ONLINE, icon_size, "GtkGaimStatusBox"); | 509 GAIM_STOCK_STATUS_ONLINE, icon_size, "GtkGaimStatusBox"); |
510 pixbuf = gdk_pixbuf_copy(orig); | |
511 g_object_unref(G_OBJECT(orig)); | |
510 | 512 |
511 emblem = gtk_widget_render_icon(GTK_WIDGET(statusbox->vbox), | 513 emblem = gtk_widget_render_icon(GTK_WIDGET(statusbox->vbox), |
512 GTK_STOCK_SAVE, icon_size, "GtkGaimStatusBox"); | 514 GTK_STOCK_SAVE, icon_size, "GtkGaimStatusBox"); |
513 width = gdk_pixbuf_get_width(pixbuf) / 2; | 515 width = gdk_pixbuf_get_width(pixbuf) / 2; |
514 height = gdk_pixbuf_get_height(pixbuf) / 2; | 516 height = gdk_pixbuf_get_height(pixbuf) / 2; |
542 message = gaim_savedstatus_get_message(saved); | 544 message = gaim_savedstatus_get_message(saved); |
543 stripped = gaim_markup_strip_html(message); | 545 stripped = gaim_markup_strip_html(message); |
544 gaim_util_chrreplace(stripped, '\n', ' '); | 546 gaim_util_chrreplace(stripped, '\n', ' '); |
545 } | 547 } |
546 gtk_gaim_status_box_add(statusbox, GTK_GAIM_STATUS_BOX_TYPE_POPULAR, | 548 gtk_gaim_status_box_add(statusbox, GTK_GAIM_STATUS_BOX_TYPE_POPULAR, |
547 pixbuf, gaim_savedstatus_get_title(saved), stripped, | 549 pixbuf, gaim_savedstatus_get_title(saved), stripped, |
548 GINT_TO_POINTER(gaim_savedstatus_get_creation_time(saved))); | 550 GINT_TO_POINTER(gaim_savedstatus_get_creation_time(saved))); |
549 g_free(stripped); | 551 g_free(stripped); |
550 } | 552 } |
551 | 553 |
552 g_list_free(list); | 554 g_list_free(list); |
1432 break; | 1434 break; |
1433 case GAIM_STATUS_OFFLINE: | 1435 case GAIM_STATUS_OFFLINE: |
1434 index = 3; | 1436 index = 3; |
1435 break; | 1437 break; |
1436 default: | 1438 default: |
1437 /* | 1439 index = -1; |
1438 * TODO: This is very bad! I believe it's causing the infinite | |
1439 * windows bug. Need to do something better here. | |
1440 */ | |
1441 /* index = GTK_LIST_STORE(box->dropdown_store)->length - 2; */ | |
1442 index = 0; | |
1443 break; | 1440 break; |
1444 } | 1441 } |
1445 | 1442 |
1446 return index; | 1443 return index; |
1447 } | 1444 } |