| 656 gtk_container_add(GTK_CONTAINER(button), image); |
656 gtk_container_add(GTK_CONTAINER(button), image); |
| 657 |
657 |
| 658 g_object_set_data(G_OBJECT(button), "smiley_text", face); |
658 g_object_set_data(G_OBJECT(button), "smiley_text", face); |
| 659 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(insert_smiley_text), toolbar); |
659 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(insert_smiley_text), toolbar); |
| 660 |
660 |
| |
661 #if GTK_CHECK_VERSION(2,12,0) |
| |
662 gtk_widget_set_tooltip_text(button, face); |
| |
663 #else |
| 661 gtk_tooltips_set_tip(toolbar->tooltips, button, face, NULL); |
664 gtk_tooltips_set_tip(toolbar->tooltips, button, face, NULL); |
| |
665 #endif |
| 662 |
666 |
| 663 /* these look really weird with borders */ |
667 /* these look really weird with borders */ |
| 664 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); |
668 gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); |
| 665 |
669 |
| 666 psmiley = purple_smileys_find_by_shortcut(smiley->smile); |
670 psmiley = purple_smileys_find_by_shortcut(smiley->smile); |
| 670 if (supports_custom && psmiley && !(smiley->flags & GTK_IMHTML_SMILEY_CUSTOM)) { |
674 if (supports_custom && psmiley && !(smiley->flags & GTK_IMHTML_SMILEY_CUSTOM)) { |
| 671 gchar tip[128]; |
675 gchar tip[128]; |
| 672 g_snprintf(tip, sizeof(tip), |
676 g_snprintf(tip, sizeof(tip), |
| 673 _("This smiley is disabled because a custom smiley exists for this shortcut:\n %s"), |
677 _("This smiley is disabled because a custom smiley exists for this shortcut:\n %s"), |
| 674 face); |
678 face); |
| |
679 #if GTK_CHECK_VERSION(2,12,0) |
| |
680 gtk_widget_set_tooltip_text(button, tip); |
| |
681 #else |
| 675 gtk_tooltips_set_tip(toolbar->tooltips, button, tip, NULL); |
682 gtk_tooltips_set_tip(toolbar->tooltips, button, tip, NULL); |
| |
683 #endif |
| 676 gtk_widget_set_sensitive(button, FALSE); |
684 gtk_widget_set_sensitive(button, FALSE); |
| 677 } else if (psmiley) { |
685 } else if (psmiley) { |
| 678 /* Remove the button if the smiley is destroyed */ |
686 /* Remove the button if the smiley is destroyed */ |
| 679 g_signal_connect_object(G_OBJECT(psmiley), "destroy", G_CALLBACK(gtk_widget_destroy), |
687 g_signal_connect_object(G_OBJECT(psmiley), "destroy", G_CALLBACK(gtk_widget_destroy), |
| 680 button, G_CONNECT_SWAPPED); |
688 button, G_CONNECT_SWAPPED); |
| 1153 G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, |
1161 G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, |
| 1154 toolbar); |
1162 toolbar); |
| 1155 } |
1163 } |
| 1156 |
1164 |
| 1157 g_free(toolbar->sml); |
1165 g_free(toolbar->sml); |
| |
1166 #if !GTK_CHECK_VERSION(2,12,0) |
| 1158 gtk_object_sink(GTK_OBJECT(toolbar->tooltips)); |
1167 gtk_object_sink(GTK_OBJECT(toolbar->tooltips)); |
| |
1168 #endif |
| 1159 |
1169 |
| 1160 menu = g_object_get_data(object, "font_menu"); |
1170 menu = g_object_get_data(object, "font_menu"); |
| 1161 if (menu) |
1171 if (menu) |
| 1162 gtk_widget_destroy(menu); |
1172 gtk_widget_destroy(menu); |
| 1163 menu = g_object_get_data(object, "insert_menu"); |
1173 menu = g_object_get_data(object, "insert_menu"); |
| 1250 button = pidgin_pixbuf_toolbar_button_from_stock(buttons[iter].stock); |
1260 button = pidgin_pixbuf_toolbar_button_from_stock(buttons[iter].stock); |
| 1251 g_signal_connect(G_OBJECT(button), "button-press-event", G_CALLBACK(gtk_imhtmltoolbar_popup_menu), toolbar); |
1261 g_signal_connect(G_OBJECT(button), "button-press-event", G_CALLBACK(gtk_imhtmltoolbar_popup_menu), toolbar); |
| 1252 g_signal_connect(G_OBJECT(button), "clicked", |
1262 g_signal_connect(G_OBJECT(button), "clicked", |
| 1253 G_CALLBACK(buttons[iter].callback), toolbar); |
1263 G_CALLBACK(buttons[iter].callback), toolbar); |
| 1254 *(buttons[iter].button) = button; |
1264 *(buttons[iter].button) = button; |
| |
1265 #if GTK_CHECK_VERSION(2,12,0) |
| |
1266 gtk_widget_set_tooltip_text(button, buttons[iter].tooltip); |
| |
1267 #else |
| 1255 gtk_tooltips_set_tip(toolbar->tooltips, button, buttons[iter].tooltip, NULL); |
1268 gtk_tooltips_set_tip(toolbar->tooltips, button, buttons[iter].tooltip, NULL); |
| |
1269 #endif |
| 1256 } else |
1270 } else |
| 1257 button = gtk_vseparator_new(); |
1271 button = gtk_vseparator_new(); |
| 1258 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1272 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
| 1259 } |
1273 } |
| 1260 /* create the attention button (this is a bit hacky to not break ABI) */ |
1274 /* create the attention button (this is a bit hacky to not break ABI) */ |
| 1261 button = pidgin_pixbuf_toolbar_button_from_stock(PIDGIN_STOCK_TOOLBAR_SEND_ATTENTION); |
1275 button = pidgin_pixbuf_toolbar_button_from_stock(PIDGIN_STOCK_TOOLBAR_SEND_ATTENTION); |
| 1262 g_signal_connect(G_OBJECT(button), "button-press-event", G_CALLBACK(gtk_imhtmltoolbar_popup_menu), toolbar); |
1276 g_signal_connect(G_OBJECT(button), "button-press-event", G_CALLBACK(gtk_imhtmltoolbar_popup_menu), toolbar); |
| 1263 g_signal_connect(G_OBJECT(button), "clicked", |
1277 g_signal_connect(G_OBJECT(button), "clicked", |
| 1264 G_CALLBACK(send_attention_cb), toolbar); |
1278 G_CALLBACK(send_attention_cb), toolbar); |
| 1265 g_object_set_data(G_OBJECT(toolbar), "attention", button); |
1279 g_object_set_data(G_OBJECT(toolbar), "attention", button); |
| |
1280 #if GTK_CHECK_VERSION(2,12,0) |
| |
1281 gtk_widget_set_tooltip_text(button, _("Send Attention")); |
| |
1282 #else |
| 1266 gtk_tooltips_set_tip(toolbar->tooltips, button, _("Send Attention"), NULL); |
1283 gtk_tooltips_set_tip(toolbar->tooltips, button, _("Send Attention"), NULL); |
| |
1284 #endif |
| 1267 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
1285 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
| 1268 |
1286 |
| 1269 gtk_box_pack_start(GTK_BOX(toolbar), hbox, FALSE, FALSE, 0); |
1287 gtk_box_pack_start(GTK_BOX(toolbar), hbox, FALSE, FALSE, 0); |
| 1270 g_object_set_data(G_OBJECT(toolbar), "wide-view", hbox); |
1288 g_object_set_data(G_OBJECT(toolbar), "wide-view", hbox); |
| 1271 } |
1289 } |
| 1359 toolbar->bgcolor_dialog = NULL; |
1377 toolbar->bgcolor_dialog = NULL; |
| 1360 toolbar->link_dialog = NULL; |
1378 toolbar->link_dialog = NULL; |
| 1361 toolbar->smiley_dialog = NULL; |
1379 toolbar->smiley_dialog = NULL; |
| 1362 toolbar->image_dialog = NULL; |
1380 toolbar->image_dialog = NULL; |
| 1363 |
1381 |
| |
1382 #if !GTK_CHECK_VERSION(2,12,0) |
| 1364 toolbar->tooltips = gtk_tooltips_new(); |
1383 toolbar->tooltips = gtk_tooltips_new(); |
| |
1384 #endif |
| 1365 |
1385 |
| 1366 gtk_box_set_spacing(GTK_BOX(toolbar), 3); |
1386 gtk_box_set_spacing(GTK_BOX(toolbar), 3); |
| 1367 |
1387 |
| 1368 gtk_imhtmltoolbar_create_old_buttons(toolbar); |
1388 gtk_imhtmltoolbar_create_old_buttons(toolbar); |
| 1369 |
1389 |