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