Mercurial > pidgin
comparison src/gtkstatusbox.c @ 13316:41c4b4aa523a
[gaim-migrate @ 15682]
SF Patch #1435980 from Sadrul
"A few fixes for per-account statusboxes:
1. Add properly so that the right status is set when a
status is selected from the dropdown.
2. Use the prpl-icon for per-account statusboxes.
3. Show the correct active status in the cell-view."
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Wed, 22 Feb 2006 02:25:15 +0000 |
parents | 4dcd0fba99a9 |
children | 708baf7cfee8 |
comparison
equal
deleted
inserted
replaced
13315:d65250edebe0 | 13316:41c4b4aa523a |
---|---|
350 primary = g_strdup(gaim_primitive_get_name_from_type(GPOINTER_TO_INT(data))); | 350 primary = g_strdup(gaim_primitive_get_name_from_type(GPOINTER_TO_INT(data))); |
351 else | 351 else |
352 /* This should never happen, but just in case... */ | 352 /* This should never happen, but just in case... */ |
353 primary = g_strdup("New status"); | 353 primary = g_strdup("New status"); |
354 } | 354 } |
355 else if (status_box->account != NULL) | |
356 { | |
357 primary = g_strdup(gaim_status_get_name(gaim_account_get_active_status(status_box->account))); | |
358 } | |
355 else if (gaim_savedstatus_is_transient(saved_status)) | 359 else if (gaim_savedstatus_is_transient(saved_status)) |
356 primary = g_strdup(gaim_primitive_get_name_from_type(gaim_savedstatus_get_type(saved_status))); | 360 primary = g_strdup(gaim_primitive_get_name_from_type(gaim_savedstatus_get_type(saved_status))); |
357 else | 361 else |
358 primary = g_markup_escape_text(gaim_savedstatus_get_title(saved_status), -1); | 362 primary = g_markup_escape_text(gaim_savedstatus_get_title(saved_status), -1); |
359 | 363 |
385 pixbuf = status_box->typing_pixbufs[status_box->typing_index]; | 389 pixbuf = status_box->typing_pixbufs[status_box->typing_index]; |
386 else if (status_box->connecting) | 390 else if (status_box->connecting) |
387 pixbuf = status_box->connecting_pixbufs[status_box->connecting_index]; | 391 pixbuf = status_box->connecting_pixbufs[status_box->connecting_index]; |
388 else | 392 else |
389 { | 393 { |
390 pixbuf = gaim_gtk_create_gaim_icon_with_status( | 394 if (status_box->account != NULL) |
391 gaim_savedstatus_get_type(saved_status), | 395 pixbuf = gaim_gtk_create_prpl_icon_with_status(status_box->account, |
392 show_buddy_icons ? 1.0 : 0.5); | 396 gaim_status_get_type(gaim_account_get_active_status(status_box->account)), |
397 show_buddy_icons ? 1.0 : 0.5); | |
398 else | |
399 pixbuf = gaim_gtk_create_gaim_icon_with_status( | |
400 gaim_savedstatus_get_type(saved_status), | |
401 show_buddy_icons ? 1.0 : 0.5); | |
393 | 402 |
394 if (!gaim_savedstatus_is_transient(saved_status)) | 403 if (!gaim_savedstatus_is_transient(saved_status)) |
395 { | 404 { |
396 GdkPixbuf *emblem; | 405 GdkPixbuf *emblem; |
397 | 406 |
410 } | 419 } |
411 } | 420 } |
412 } | 421 } |
413 | 422 |
414 if (status_box->account != NULL) { | 423 if (status_box->account != NULL) { |
415 text = g_strdup_printf("%s\n<span size=\"smaller\">%s</span>", | 424 text = g_strdup_printf("%s%s<span size=\"smaller\" color=\"%s\">%s</span>", |
416 gaim_account_get_username(status_box->account), | 425 gaim_account_get_username(status_box->account), |
426 show_buddy_icons ? "\n" : " - ", aa_color, | |
417 secondary ? secondary : primary); | 427 secondary ? secondary : primary); |
418 } else if (secondary != NULL) { | 428 } else if (secondary != NULL) { |
419 char *separator; | 429 char *separator; |
420 separator = show_buddy_icons ? "\n" : " - "; | 430 separator = show_buddy_icons ? "\n" : " - "; |
421 text = g_strdup_printf("%s<span size=\"smaller\" color=\"%s\">%s%s</span>", | 431 text = g_strdup_printf("%s<span size=\"smaller\" color=\"%s\">%s%s</span>", |
686 continue; | 696 continue; |
687 | 697 |
688 tmp = gaim_gtk_create_prpl_icon_with_status(account, status_type, | 698 tmp = gaim_gtk_create_prpl_icon_with_status(account, status_type, |
689 show_buddy_icons ? 1.0 : 0.5); | 699 show_buddy_icons ? 1.0 : 0.5); |
690 gtk_gaim_status_box_add(GTK_GAIM_STATUS_BOX(status_box), | 700 gtk_gaim_status_box_add(GTK_GAIM_STATUS_BOX(status_box), |
691 gaim_status_type_get_primitive(status_type), | 701 GTK_GAIM_STATUS_BOX_TYPE_PRIMITIVE, tmp, |
692 tmp, | |
693 gaim_status_type_get_name(status_type), | 702 gaim_status_type_get_name(status_type), |
694 NULL, NULL); | 703 NULL, |
704 GINT_TO_POINTER(gaim_status_type_get_primitive(status_type))); | |
695 if (tmp != NULL) | 705 if (tmp != NULL) |
696 g_object_unref(tmp); | 706 g_object_unref(tmp); |
697 } | 707 } |
698 gtk_combo_box_set_model(GTK_COMBO_BOX(status_box), GTK_TREE_MODEL(status_box->dropdown_store)); | 708 gtk_combo_box_set_model(GTK_COMBO_BOX(status_box), GTK_TREE_MODEL(status_box->dropdown_store)); |
699 update_to_reflect_account_status(status_box, account, gaim_account_get_active_status(account)); | 709 update_to_reflect_account_status(status_box, account, gaim_account_get_active_status(account)); |