| 653 gtk_container_add(GTK_CONTAINER(button), image); |
653 gtk_container_add(GTK_CONTAINER(button), image); |
| 654 |
654 |
| 655 g_object_set_data(G_OBJECT(button), "smiley_text", face); |
655 g_object_set_data(G_OBJECT(button), "smiley_text", face); |
| 656 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(insert_smiley_text), toolbar); |
656 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(insert_smiley_text), toolbar); |
| 657 |
657 |
| |
658 #if GTK_CHECK_VERSION(2,12,0) |
| |
659 gtk_widget_set_tooltip_text(button, face); |
| |
660 #else |
| 658 gtk_tooltips_set_tip(toolbar->tooltips, button, face, NULL); |
661 gtk_tooltips_set_tip(toolbar->tooltips, button, face, NULL); |
| |
662 #endif |
| 659 |
663 |
| 660 /* these look really weird with borders */ |
664 /* these look really weird with borders */ |
| 661 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); |
665 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); |
| 662 |
666 |
| 663 psmiley = purple_smileys_find_by_shortcut(smiley->smile); |
667 psmiley = purple_smileys_find_by_shortcut(smiley->smile); |
| 667 if (supports_custom && psmiley && !(smiley->flags & GTK_IMHTML_SMILEY_CUSTOM)) { |
671 if (supports_custom && psmiley && !(smiley->flags & GTK_IMHTML_SMILEY_CUSTOM)) { |
| 668 gchar tip[128]; |
672 gchar tip[128]; |
| 669 g_snprintf(tip, sizeof(tip), |
673 g_snprintf(tip, sizeof(tip), |
| 670 _("This smiley is disabled because a custom smiley exists for this shortcut:\n %s"), |
674 _("This smiley is disabled because a custom smiley exists for this shortcut:\n %s"), |
| 671 face); |
675 face); |
| |
676 #if GTK_CHECK_VERSION(2,12,0) |
| |
677 gtk_widget_set_tooltip_text(button, tip); |
| |
678 #else |
| 672 gtk_tooltips_set_tip(toolbar->tooltips, button, tip, NULL); |
679 gtk_tooltips_set_tip(toolbar->tooltips, button, tip, NULL); |
| |
680 #endif |
| 673 gtk_widget_set_sensitive(button, FALSE); |
681 gtk_widget_set_sensitive(button, FALSE); |
| 674 } else if (psmiley) { |
682 } else if (psmiley) { |
| 675 /* Remove the button if the smiley is destroyed */ |
683 /* Remove the button if the smiley is destroyed */ |
| 676 g_signal_connect_object(G_OBJECT(psmiley), "destroy", G_CALLBACK(gtk_widget_destroy), |
684 g_signal_connect_object(G_OBJECT(psmiley), "destroy", G_CALLBACK(gtk_widget_destroy), |
| 677 button, G_CONNECT_SWAPPED); |
685 button, G_CONNECT_SWAPPED); |
| 1142 G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, |
1150 G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, |
| 1143 toolbar); |
1151 toolbar); |
| 1144 } |
1152 } |
| 1145 |
1153 |
| 1146 g_free(toolbar->sml); |
1154 g_free(toolbar->sml); |
| |
1155 #if !GTK_CHECK_VERSION(2,12,0) |
| 1147 gtk_object_sink(GTK_OBJECT(toolbar->tooltips)); |
1156 gtk_object_sink(GTK_OBJECT(toolbar->tooltips)); |
| |
1157 #endif |
| 1148 |
1158 |
| 1149 menu = g_object_get_data(object, "font_menu"); |
1159 menu = g_object_get_data(object, "font_menu"); |
| 1150 if (menu) |
1160 if (menu) |
| 1151 gtk_widget_destroy(menu); |
1161 gtk_widget_destroy(menu); |
| 1152 menu = g_object_get_data(object, "insert_menu"); |
1162 menu = g_object_get_data(object, "insert_menu"); |
| 1242 if (buttons[iter].stock[0]) { |
1252 if (buttons[iter].stock[0]) { |
| 1243 button = pidgin_pixbuf_toolbar_button_from_stock(buttons[iter].stock); |
1253 button = pidgin_pixbuf_toolbar_button_from_stock(buttons[iter].stock); |
| 1244 g_signal_connect(G_OBJECT(button), "clicked", |
1254 g_signal_connect(G_OBJECT(button), "clicked", |
| 1245 G_CALLBACK(buttons[iter].callback), toolbar); |
1255 G_CALLBACK(buttons[iter].callback), toolbar); |
| 1246 *(buttons[iter].button) = button; |
1256 *(buttons[iter].button) = button; |
| |
1257 #if GTK_CHECK_VERSION(2,12,0) |
| |
1258 gtk_widget_set_tooltip_text(button, buttons[iter].tooltip); |
| |
1259 #else |
| 1247 gtk_tooltips_set_tip(toolbar->tooltips, button, buttons[iter].tooltip, NULL); |
1260 gtk_tooltips_set_tip(toolbar->tooltips, button, buttons[iter].tooltip, NULL); |
| |
1261 #endif |
| 1248 } else |
1262 } else |
| 1249 button = gtk_vseparator_new(); |
1263 button = gtk_vseparator_new(); |
| 1250 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1264 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
| 1251 } |
1265 } |
| 1252 /* create the attention button (this is a bit hacky to not break ABI) */ |
1266 /* create the attention button (this is a bit hacky to not break ABI) */ |
| 1340 toolbar->bgcolor_dialog = NULL; |
1354 toolbar->bgcolor_dialog = NULL; |
| 1341 toolbar->link_dialog = NULL; |
1355 toolbar->link_dialog = NULL; |
| 1342 toolbar->smiley_dialog = NULL; |
1356 toolbar->smiley_dialog = NULL; |
| 1343 toolbar->image_dialog = NULL; |
1357 toolbar->image_dialog = NULL; |
| 1344 |
1358 |
| |
1359 #if !GTK_CHECK_VERSION(2,12,0) |
| 1345 toolbar->tooltips = gtk_tooltips_new(); |
1360 toolbar->tooltips = gtk_tooltips_new(); |
| |
1361 #endif |
| 1346 |
1362 |
| 1347 gtk_box_set_spacing(GTK_BOX(toolbar), 3); |
1363 gtk_box_set_spacing(GTK_BOX(toolbar), 3); |
| 1348 |
1364 |
| 1349 gtk_imhtmltoolbar_create_old_buttons(toolbar); |
1365 gtk_imhtmltoolbar_create_old_buttons(toolbar); |
| 1350 |
1366 |