| 758 |
741 |
| 759 gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0); |
742 gtk_box_pack_start(GTK_BOX(vbox), toolbar, FALSE, FALSE, 0); |
| 760 |
743 |
| 761 #ifndef HAVE_REGEX_H |
744 #ifndef HAVE_REGEX_H |
| 762 /* Find button */ |
745 /* Find button */ |
| 763 #if GTK_CHECK_VERSION(2,4,0) |
|
| 764 item = gtk_tool_button_new_from_stock(GTK_STOCK_FIND); |
746 item = gtk_tool_button_new_from_stock(GTK_STOCK_FIND); |
| 765 #if GTK_CHECK_VERSION(2,12,0) |
747 #if GTK_CHECK_VERSION(2,12,0) |
| 766 gtk_tool_item_set_tooltip_text(item, _("Find")); |
748 gtk_tool_item_set_tooltip_text(item, _("Find")); |
| 767 #else |
749 #else |
| 768 gtk_tool_item_set_tooltip(item, tooltips, _("Find"), NULL); |
750 gtk_tool_item_set_tooltip(item, tooltips, _("Find"), NULL); |
| 769 #endif |
751 #endif |
| 770 g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(find_cb), win); |
752 g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(find_cb), win); |
| 771 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
753 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
| 772 #else |
|
| 773 gtk_toolbar_insert_stock(GTK_TOOLBAR(toolbar), GTK_STOCK_FIND, |
|
| 774 _("Find"), NULL, G_CALLBACK(find_cb), |
|
| 775 win, -1); |
|
| 776 #endif |
|
| 777 #endif /* HAVE_REGEX_H */ |
754 #endif /* HAVE_REGEX_H */ |
| 778 |
755 |
| 779 /* Save */ |
756 /* Save */ |
| 780 #if GTK_CHECK_VERSION(2,4,0) |
|
| 781 item = gtk_tool_button_new_from_stock(GTK_STOCK_SAVE); |
757 item = gtk_tool_button_new_from_stock(GTK_STOCK_SAVE); |
| 782 #if GTK_CHECK_VERSION(2,12,0) |
758 #if GTK_CHECK_VERSION(2,12,0) |
| 783 gtk_tool_item_set_tooltip_text(item, _("Save")); |
759 gtk_tool_item_set_tooltip_text(item, _("Save")); |
| 784 #else |
760 #else |
| 785 gtk_tool_item_set_tooltip(item, tooltips, _("Save"), NULL); |
761 gtk_tool_item_set_tooltip(item, tooltips, _("Save"), NULL); |
| 786 #endif |
762 #endif |
| 787 g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(save_cb), win); |
763 g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(save_cb), win); |
| 788 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
764 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
| 789 #else |
|
| 790 gtk_toolbar_insert_stock(GTK_TOOLBAR(toolbar), GTK_STOCK_SAVE, |
|
| 791 _("Save"), NULL, G_CALLBACK(save_cb), |
|
| 792 win, -1); |
|
| 793 #endif |
|
| 794 |
765 |
| 795 /* Clear button */ |
766 /* Clear button */ |
| 796 #if GTK_CHECK_VERSION(2,4,0) |
|
| 797 item = gtk_tool_button_new_from_stock(GTK_STOCK_CLEAR); |
767 item = gtk_tool_button_new_from_stock(GTK_STOCK_CLEAR); |
| 798 #if GTK_CHECK_VERSION(2,12,0) |
768 #if GTK_CHECK_VERSION(2,12,0) |
| 799 gtk_tool_item_set_tooltip_text(item, _("Clear")); |
769 gtk_tool_item_set_tooltip_text(item, _("Clear")); |
| 800 #else |
770 #else |
| 801 gtk_tool_item_set_tooltip(item, tooltips, _("Clear"), NULL); |
771 gtk_tool_item_set_tooltip(item, tooltips, _("Clear"), NULL); |
| 802 #endif |
772 #endif |
| 803 g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(clear_cb), win); |
773 g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(clear_cb), win); |
| 804 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
774 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
| 805 #else |
775 |
| 806 gtk_toolbar_insert_stock(GTK_TOOLBAR(toolbar), GTK_STOCK_CLEAR, |
|
| 807 _("Clear"), NULL, G_CALLBACK(clear_cb), |
|
| 808 win, -1); |
|
| 809 #endif |
|
| 810 |
|
| 811 #if GTK_CHECK_VERSION(2,4,0) |
|
| 812 item = gtk_separator_tool_item_new(); |
776 item = gtk_separator_tool_item_new(); |
| 813 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
777 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
| 814 #else |
|
| 815 gtk_toolbar_insert_space(GTK_TOOLBAR(toolbar), -1); |
|
| 816 #endif |
|
| 817 |
778 |
| 818 /* Pause */ |
779 /* Pause */ |
| 819 #if GTK_CHECK_VERSION(2,4,0) |
|
| 820 item = gtk_toggle_tool_button_new_from_stock(PIDGIN_STOCK_PAUSE); |
780 item = gtk_toggle_tool_button_new_from_stock(PIDGIN_STOCK_PAUSE); |
| 821 #if GTK_CHECK_VERSION(2,12,0) |
781 #if GTK_CHECK_VERSION(2,12,0) |
| 822 gtk_tool_item_set_tooltip_text(item, _("Pause")); |
782 gtk_tool_item_set_tooltip_text(item, _("Pause")); |
| 823 #else |
783 #else |
| 824 gtk_tool_item_set_tooltip(item, tooltips, _("Pause"), NULL); |
784 gtk_tool_item_set_tooltip(item, tooltips, _("Pause"), NULL); |
| 825 #endif |
785 #endif |
| 826 g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(pause_cb), win); |
786 g_signal_connect(G_OBJECT(item), "clicked", G_CALLBACK(pause_cb), win); |
| 827 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
787 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
| 828 #else |
|
| 829 image = gtk_image_new_from_stock(PIDGIN_STOCK_PAUSE, GTK_ICON_SIZE_MENU); |
|
| 830 gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
|
| 831 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, |
|
| 832 NULL, _("Pause"), _("Pause"), |
|
| 833 NULL, image, |
|
| 834 G_CALLBACK(pause_cb), win); |
|
| 835 #endif |
|
| 836 |
788 |
| 837 #ifdef HAVE_REGEX_H |
789 #ifdef HAVE_REGEX_H |
| 838 /* regex stuff */ |
790 /* regex stuff */ |
| 839 #if GTK_CHECK_VERSION(2,4,0) |
|
| 840 item = gtk_separator_tool_item_new(); |
791 item = gtk_separator_tool_item_new(); |
| 841 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
792 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
| 842 #else |
|
| 843 gtk_toolbar_insert_space(GTK_TOOLBAR(toolbar), -1); |
|
| 844 #endif |
|
| 845 |
793 |
| 846 /* regex toggle button */ |
794 /* regex toggle button */ |
| 847 #if GTK_CHECK_VERSION(2,4,0) |
|
| 848 win->filter = GTK_WIDGET(gtk_toggle_tool_button_new_from_stock(GTK_STOCK_FIND)); |
795 win->filter = GTK_WIDGET(gtk_toggle_tool_button_new_from_stock(GTK_STOCK_FIND)); |
| 849 gtk_tool_button_set_label(GTK_TOOL_BUTTON(win->filter), _("Filter")); |
796 gtk_tool_button_set_label(GTK_TOOL_BUTTON(win->filter), _("Filter")); |
| 850 #if GTK_CHECK_VERSION(2,12,0) |
797 #if GTK_CHECK_VERSION(2,12,0) |
| 851 gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(win->filter), _("Filter")); |
798 gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(win->filter), _("Filter")); |
| 852 #else |
799 #else |
| 853 gtk_tooltips_set_tip(tooltips, win->filter, _("Filter"), NULL); |
800 gtk_tooltips_set_tip(tooltips, win->filter, _("Filter"), NULL); |
| 854 #endif |
801 #endif |
| 855 g_signal_connect(G_OBJECT(win->filter), "clicked", G_CALLBACK(regex_filter_toggled_cb), win); |
802 g_signal_connect(G_OBJECT(win->filter), "clicked", G_CALLBACK(regex_filter_toggled_cb), win); |
| 856 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(win->filter)); |
803 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(win->filter)); |
| 857 #else |
|
| 858 image = gtk_image_new_from_stock(GTK_STOCK_FIND, GTK_ICON_SIZE_MENU); |
|
| 859 win->filter = |
|
| 860 gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
|
| 861 GTK_TOOLBAR_CHILD_TOGGLEBUTTON, |
|
| 862 NULL, _("Filter"), _("Filter"), |
|
| 863 NULL, image, |
|
| 864 G_CALLBACK(regex_filter_toggled_cb), |
|
| 865 win); |
|
| 866 #endif |
|
| 867 |
804 |
| 868 /* we purposely disable the toggle button here in case |
805 /* we purposely disable the toggle button here in case |
| 869 * /purple/gtk/debug/expression has an empty string. If it does not have |
806 * /purple/gtk/debug/expression has an empty string. If it does not have |
| 870 * an empty string, the change signal will get called and make the |
807 * an empty string, the change signal will get called and make the |
| 871 * toggle button sensitive. |
808 * toggle button sensitive. |
| 872 */ |
809 */ |
| 873 gtk_widget_set_sensitive(win->filter, FALSE); |
810 gtk_widget_set_sensitive(win->filter, FALSE); |
| 874 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(win->filter), |
811 gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(win->filter), |
| 875 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/filter")); |
812 purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/filter")); |
| 876 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/debug/filter", |
813 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/debug/filter", |
| 877 regex_pref_filter_cb, win); |
814 regex_pref_filter_cb, win); |
| 878 |
815 |
| 879 /* regex entry */ |
816 /* regex entry */ |
| 880 win->expression = gtk_entry_new(); |
817 win->expression = gtk_entry_new(); |
| 881 #if GTK_CHECK_VERSION(2,4,0) |
|
| 882 item = gtk_tool_item_new(); |
818 item = gtk_tool_item_new(); |
| 883 #if GTK_CHECK_VERSION(2,12,0) |
819 #if GTK_CHECK_VERSION(2,12,0) |
| 884 gtk_widget_set_tooltip_text(win->expression, _("Right click for more options.")); |
820 gtk_widget_set_tooltip_text(win->expression, _("Right click for more options.")); |
| 885 #else |
821 #else |
| 886 gtk_tooltips_set_tip(tooltips, win->expression, _("Right click for more options."), NULL); |
822 gtk_tooltips_set_tip(tooltips, win->expression, _("Right click for more options."), NULL); |
| 887 #endif |
823 #endif |
| 888 gtk_container_add(GTK_CONTAINER(item), GTK_WIDGET(win->expression)); |
824 gtk_container_add(GTK_CONTAINER(item), GTK_WIDGET(win->expression)); |
| 889 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
825 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
| 890 #else |
826 |
| 891 gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
|
| 892 GTK_TOOLBAR_CHILD_WIDGET, win->expression, |
|
| 893 NULL, _("Right click for more options."), |
|
| 894 NULL, NULL, NULL, NULL); |
|
| 895 #endif |
|
| 896 /* this needs to be before the text is set from the pref if we want it |
827 /* this needs to be before the text is set from the pref if we want it |
| 897 * to colorize a stored expression. |
828 * to colorize a stored expression. |
| 898 */ |
829 */ |
| 899 g_signal_connect(G_OBJECT(win->expression), "changed", |
830 g_signal_connect(G_OBJECT(win->expression), "changed", |
| 900 G_CALLBACK(regex_changed_cb), win); |
831 G_CALLBACK(regex_changed_cb), win); |
| 916 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/debug/highlight", |
847 purple_prefs_connect_callback(handle, PIDGIN_PREFS_ROOT "/debug/highlight", |
| 917 regex_pref_highlight_cb, win); |
848 regex_pref_highlight_cb, win); |
| 918 |
849 |
| 919 #endif /* HAVE_REGEX_H */ |
850 #endif /* HAVE_REGEX_H */ |
| 920 |
851 |
| 921 #if GTK_CHECK_VERSION(2,4,0) |
|
| 922 item = gtk_separator_tool_item_new(); |
852 item = gtk_separator_tool_item_new(); |
| 923 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
853 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
| 924 #else |
854 |
| 925 gtk_toolbar_insert_space(GTK_TOOLBAR(toolbar), -1); |
|
| 926 #endif |
|
| 927 |
|
| 928 #if GTK_CHECK_VERSION(2,4,0) |
|
| 929 item = gtk_tool_item_new(); |
855 item = gtk_tool_item_new(); |
| 930 gtk_container_add(GTK_CONTAINER(item), gtk_label_new(_("Level "))); |
856 gtk_container_add(GTK_CONTAINER(item), gtk_label_new(_("Level "))); |
| 931 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
857 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
| 932 #else |
858 |
| 933 gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
|
| 934 GTK_TOOLBAR_CHILD_WIDGET, gtk_label_new(_("Level ")), |
|
| 935 NULL, _("Select the debug filter level."), |
|
| 936 NULL, NULL, NULL, NULL); |
|
| 937 #endif |
|
| 938 win->filterlevel = gtk_combo_box_new_text(); |
859 win->filterlevel = gtk_combo_box_new_text(); |
| 939 #if GTK_CHECK_VERSION(2,4,0) |
|
| 940 item = gtk_tool_item_new(); |
860 item = gtk_tool_item_new(); |
| 941 #if GTK_CHECK_VERSION(2,12,0) |
861 #if GTK_CHECK_VERSION(2,12,0) |
| 942 gtk_widget_set_tooltip_text(win->filterlevel, _("Select the debug filter level.")); |
862 gtk_widget_set_tooltip_text(win->filterlevel, _("Select the debug filter level.")); |
| 943 #else |
863 #else |
| 944 gtk_tooltips_set_tip(tooltips, win->filterlevel, _("Select the debug filter level."), NULL); |
864 gtk_tooltips_set_tip(tooltips, win->filterlevel, _("Select the debug filter level."), NULL); |
| 945 #endif |
865 #endif |
| 946 gtk_container_add(GTK_CONTAINER(item), win->filterlevel); |
866 gtk_container_add(GTK_CONTAINER(item), win->filterlevel); |
| 947 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
867 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(item)); |
| 948 #else |
868 |
| 949 gtk_toolbar_append_element(GTK_TOOLBAR(toolbar), |
|
| 950 GTK_TOOLBAR_CHILD_WIDGET, win->filterlevel, |
|
| 951 NULL, _("Select the debug filter level."), |
|
| 952 NULL, NULL, NULL, NULL); |
|
| 953 #endif |
|
| 954 gtk_combo_box_append_text(GTK_COMBO_BOX(win->filterlevel), _("All")); |
869 gtk_combo_box_append_text(GTK_COMBO_BOX(win->filterlevel), _("All")); |
| 955 gtk_combo_box_append_text(GTK_COMBO_BOX(win->filterlevel), _("Misc")); |
870 gtk_combo_box_append_text(GTK_COMBO_BOX(win->filterlevel), _("Misc")); |
| 956 gtk_combo_box_append_text(GTK_COMBO_BOX(win->filterlevel), _("Info")); |
871 gtk_combo_box_append_text(GTK_COMBO_BOX(win->filterlevel), _("Info")); |
| 957 gtk_combo_box_append_text(GTK_COMBO_BOX(win->filterlevel), _("Warning")); |
872 gtk_combo_box_append_text(GTK_COMBO_BOX(win->filterlevel), _("Warning")); |
| 958 gtk_combo_box_append_text(GTK_COMBO_BOX(win->filterlevel), _("Error ")); |
873 gtk_combo_box_append_text(GTK_COMBO_BOX(win->filterlevel), _("Error ")); |