| 79 } u; |
79 } u; |
| 80 |
80 |
| 81 } PidginRequestData; |
81 } PidginRequestData; |
| 82 |
82 |
| 83 static void |
83 static void |
| |
84 pidgin_widget_decorate_account(GtkWidget *cont, PurpleAccount *account) |
| |
85 { |
| |
86 GtkWidget *image; |
| |
87 GdkPixbuf *pixbuf; |
| |
88 GtkTooltips *tips; |
| |
89 |
| |
90 if (!account) |
| |
91 return; |
| |
92 |
| |
93 pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL); |
| |
94 image = gtk_image_new_from_pixbuf(pixbuf); |
| |
95 g_object_unref(G_OBJECT(pixbuf)); |
| |
96 |
| |
97 tips = gtk_tooltips_new(); |
| |
98 gtk_tooltips_set_tip(tips, image, purple_account_get_username(account), NULL); |
| |
99 |
| |
100 if (GTK_IS_DIALOG(cont)) { |
| |
101 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(cont)->action_area), image, FALSE, TRUE, 0); |
| |
102 gtk_box_reorder_child(GTK_BOX(GTK_DIALOG(cont)->action_area), image, 0); |
| |
103 } else if (GTK_IS_HBOX(cont)) { |
| |
104 gtk_misc_set_alignment(GTK_MISC(image), 0, 0); |
| |
105 gtk_box_pack_end(GTK_BOX(cont), image, FALSE, TRUE, 0); |
| |
106 } |
| |
107 gtk_widget_show(image); |
| |
108 } |
| |
109 |
| |
110 static void |
| 84 generic_response_start(PidginRequestData *data) |
111 generic_response_start(PidginRequestData *data) |
| 85 { |
112 { |
| 86 g_return_if_fail(data != NULL); |
113 g_return_if_fail(data != NULL); |
| 87 |
114 |
| 88 /* Tell the user we're doing something. */ |
115 /* Tell the user we're doing something. */ |
| 345 /* Vertical box */ |
372 /* Vertical box */ |
| 346 vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); |
373 vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); |
| 347 |
374 |
| 348 gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0); |
375 gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0); |
| 349 |
376 |
| |
377 pidgin_widget_decorate_account(hbox, account); |
| |
378 |
| 350 /* Descriptive label */ |
379 /* Descriptive label */ |
| 351 primary_esc = (primary != NULL) ? g_markup_escape_text(primary, -1) : NULL; |
380 primary_esc = (primary != NULL) ? g_markup_escape_text(primary, -1) : NULL; |
| 352 secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL; |
381 secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL; |
| 353 label_text = g_strdup_printf((primary ? "<span weight=\"bold\" size=\"larger\">" |
382 label_text = g_strdup_printf((primary ? "<span weight=\"bold\" size=\"larger\">" |
| 354 "%s</span>%s%s" : "%s%s%s"), |
383 "%s</span>%s%s" : "%s%s%s"), |
| 513 img = gtk_image_new_from_stock(PIDGIN_STOCK_DIALOG_QUESTION, |
542 img = gtk_image_new_from_stock(PIDGIN_STOCK_DIALOG_QUESTION, |
| 514 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE)); |
543 gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_HUGE)); |
| 515 gtk_misc_set_alignment(GTK_MISC(img), 0, 0); |
544 gtk_misc_set_alignment(GTK_MISC(img), 0, 0); |
| 516 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); |
545 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); |
| 517 |
546 |
| |
547 pidgin_widget_decorate_account(hbox, account); |
| |
548 |
| 518 /* Vertical box */ |
549 /* Vertical box */ |
| 519 vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); |
550 vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); |
| 520 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); |
551 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); |
| 521 |
552 |
| 522 /* Descriptive label */ |
553 /* Descriptive label */ |
| 636 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); |
667 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); |
| 637 |
668 |
| 638 /* Vertical box */ |
669 /* Vertical box */ |
| 639 vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); |
670 vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); |
| 640 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); |
671 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); |
| |
672 |
| |
673 pidgin_widget_decorate_account(hbox, account); |
| 641 |
674 |
| 642 /* Descriptive label */ |
675 /* Descriptive label */ |
| 643 primary_esc = (primary != NULL) ? g_markup_escape_text(primary, -1) : NULL; |
676 primary_esc = (primary != NULL) ? g_markup_escape_text(primary, -1) : NULL; |
| 644 secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL; |
677 secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL; |
| 645 label_text = g_strdup_printf((primary ? "<span weight=\"bold\" size=\"larger\">" |
678 label_text = g_strdup_printf((primary ? "<span weight=\"bold\" size=\"larger\">" |
| 1141 /* OK button */ |
1174 /* OK button */ |
| 1142 button = pidgin_dialog_add_button(GTK_DIALOG(win), text_to_stock(ok_text), G_CALLBACK(multifield_ok_cb), data); |
1175 button = pidgin_dialog_add_button(GTK_DIALOG(win), text_to_stock(ok_text), G_CALLBACK(multifield_ok_cb), data); |
| 1143 data->ok_button = button; |
1176 data->ok_button = button; |
| 1144 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); |
1177 GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); |
| 1145 gtk_window_set_default(GTK_WINDOW(win), button); |
1178 gtk_window_set_default(GTK_WINDOW(win), button); |
| |
1179 |
| |
1180 pidgin_widget_decorate_account(hbox, account); |
| 1146 |
1181 |
| 1147 /* Setup the vbox */ |
1182 /* Setup the vbox */ |
| 1148 vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); |
1183 vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); |
| 1149 gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0); |
1184 gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0); |
| 1150 gtk_widget_show(vbox); |
1185 gtk_widget_show(vbox); |