Mercurial > pidgin.yaz
comparison src/prefs.c @ 617:50f7a0bc76fc
[gaim-migrate @ 627]
part ][ of a serious code reduction thanx to eric's picture_button() call
committer: Tailor Script <tailor@pidgin.im>
author | Todd Kulesza <fflewddur> |
---|---|
date | Sat, 05 Aug 2000 06:35:50 +0000 |
parents | 874ed877c854 |
children | faa7603ae02e |
comparison
equal
deleted
inserted
replaced
616:874ed877c854 | 617:50f7a0bc76fc |
---|---|
36 #include "proxy.h" | 36 #include "proxy.h" |
37 #include "gnome_applet_mgr.h" | 37 #include "gnome_applet_mgr.h" |
38 #include "pixmaps/cancel.xpm" | 38 #include "pixmaps/cancel.xpm" |
39 #include "pixmaps/fontface2.xpm" | 39 #include "pixmaps/fontface2.xpm" |
40 #include "pixmaps/refresh.xpm" | 40 #include "pixmaps/refresh.xpm" |
41 #include "pixmaps/gnome_add.xpm" | |
42 #include "pixmaps/gnome_remove.xpm" | |
41 | 43 |
42 struct prefs_data *pd = NULL; | 44 struct prefs_data *pd = NULL; |
43 struct debug_window *dw = NULL; | 45 struct debug_window *dw = NULL; |
44 | 46 |
45 GtkWidget *debugbutton; | 47 GtkWidget *debugbutton; |
344 GtkWidget *sw; | 346 GtkWidget *sw; |
345 GtkWidget *sw2; | 347 GtkWidget *sw2; |
346 GtkWidget *away_page; | 348 GtkWidget *away_page; |
347 GtkWidget *select_font; | 349 GtkWidget *select_font; |
348 GtkWidget *font_face_for_text; | 350 GtkWidget *font_face_for_text; |
349 GtkWidget *button_box, *icon_i, *button_label; | |
350 GdkBitmap *mask; | |
351 GdkPixmap *icon; | |
352 | |
353 GtkWidget *list_item; | 351 GtkWidget *list_item; |
354 | |
355 gchar buffer[64]; | 352 gchar buffer[64]; |
356 | 353 |
357 if (!pd) | 354 if (!pd) |
358 pd = g_new0(struct prefs_data, 1); | 355 pd = g_new0(struct prefs_data, 1); |
359 | 356 |
625 gtk_container_add(GTK_CONTAINER(sw), pd->away_text); | 622 gtk_container_add(GTK_CONTAINER(sw), pd->away_text); |
626 gtk_box_pack_start(GTK_BOX(away_topbox), sw, TRUE, TRUE, 0); | 623 gtk_box_pack_start(GTK_BOX(away_topbox), sw, TRUE, TRUE, 0); |
627 gtk_text_set_word_wrap(GTK_TEXT(pd->away_text), TRUE); | 624 gtk_text_set_word_wrap(GTK_TEXT(pd->away_text), TRUE); |
628 gtk_text_set_editable(GTK_TEXT(pd->away_text), TRUE ); | 625 gtk_text_set_editable(GTK_TEXT(pd->away_text), TRUE ); |
629 | 626 |
630 add_away = gtk_button_new_with_label(_("Create Message")); | 627 add_away = picture_button(pd->window, _("Add Message"), gnome_add_xpm); |
631 if (display_options & OPT_DISP_COOL_LOOK) | |
632 gtk_button_set_relief(GTK_BUTTON(add_away), GTK_RELIEF_NONE); | |
633 gtk_signal_connect(GTK_OBJECT(add_away), "clicked", GTK_SIGNAL_FUNC(create_away_mess), NULL); | 628 gtk_signal_connect(GTK_OBJECT(add_away), "clicked", GTK_SIGNAL_FUNC(create_away_mess), NULL); |
634 gtk_box_pack_start(GTK_BOX(away_botbox), add_away, TRUE, FALSE, 5); | 629 gtk_box_pack_start(GTK_BOX(away_botbox), add_away, TRUE, FALSE, 5); |
635 | 630 |
636 remove_away = gtk_button_new_with_label(_("Remove Message")); | 631 remove_away = picture_button(pd->window, _("Remove Message"), gnome_remove_xpm); |
637 if (display_options & OPT_DISP_COOL_LOOK) | |
638 gtk_button_set_relief(GTK_BUTTON(remove_away), GTK_RELIEF_NONE); | |
639 gtk_signal_connect(GTK_OBJECT(remove_away), "clicked", GTK_SIGNAL_FUNC(remove_away_message), NULL); | 632 gtk_signal_connect(GTK_OBJECT(remove_away), "clicked", GTK_SIGNAL_FUNC(remove_away_message), NULL); |
640 gtk_box_pack_start(GTK_BOX(away_botbox), remove_away, TRUE, FALSE, 5); | 633 gtk_box_pack_start(GTK_BOX(away_botbox), remove_away, TRUE, FALSE, 5); |
641 | 634 |
635 if (display_options & OPT_DISP_COOL_LOOK) | |
636 { | |
637 gtk_button_set_relief(GTK_BUTTON(remove_away), GTK_RELIEF_NONE); | |
638 gtk_button_set_relief(GTK_BUTTON(add_away), GTK_RELIEF_NONE); | |
639 } | |
640 | |
642 gtk_box_pack_start(GTK_BOX(away_page), away_topbox, TRUE, TRUE, 0); | 641 gtk_box_pack_start(GTK_BOX(away_page), away_topbox, TRUE, TRUE, 0); |
643 gtk_box_pack_start(GTK_BOX(away_page), away_botbox, FALSE, FALSE, 0); | 642 gtk_box_pack_start(GTK_BOX(away_page), away_botbox, FALSE, FALSE, 0); |
644 | 643 |
645 gtk_widget_show(add_away); | 644 gtk_widget_show(add_away); |
646 gtk_widget_show(remove_away); | 645 gtk_widget_show(remove_away); |
792 gaim_button(_("Underlined Text"), &font_options, OPT_FONT_UNDERLINE, fontbox); | 791 gaim_button(_("Underlined Text"), &font_options, OPT_FONT_UNDERLINE, fontbox); |
793 gaim_button(_("Strike Text"), &font_options, OPT_FONT_STRIKE, fontbox); | 792 gaim_button(_("Strike Text"), &font_options, OPT_FONT_STRIKE, fontbox); |
794 font_face_for_text = gaim_button(_("Font Face for Text"), &font_options, OPT_FONT_FACE, fontbox); | 793 font_face_for_text = gaim_button(_("Font Face for Text"), &font_options, OPT_FONT_FACE, fontbox); |
795 | 794 |
796 /* Build font button */ | 795 /* Build font button */ |
797 select_font = gtk_button_new(); | 796 select_font = picture_button(pd->window, _("Select Font Face"), fontface2_xpm); |
798 button_box = gtk_hbox_new(FALSE, 5); | 797 gtk_box_pack_start(GTK_BOX(fontbox), select_font, FALSE, FALSE, 0); |
799 icon = gdk_pixmap_create_from_xpm_d (pd->window->window, &mask, NULL, fontface2_xpm); | 798 gtk_signal_connect(GTK_OBJECT(select_font), "clicked", GTK_SIGNAL_FUNC(show_font_dialog), NULL); |
800 icon_i = gtk_pixmap_new(icon, mask); | |
801 button_label = gtk_label_new(_("Select Font Face")); | |
802 gtk_box_pack_start(GTK_BOX(button_box), icon_i, FALSE, FALSE, 2); | |
803 gtk_box_pack_end(GTK_BOX(button_box), button_label, FALSE, FALSE, 2); | |
804 gtk_widget_show(button_label); | |
805 gtk_widget_show(icon_i); | |
806 if (display_options & OPT_DISP_COOL_LOOK) | 799 if (display_options & OPT_DISP_COOL_LOOK) |
807 gtk_button_set_relief(GTK_BUTTON(select_font), GTK_RELIEF_NONE); | 800 gtk_button_set_relief(GTK_BUTTON(select_font), GTK_RELIEF_NONE); |
808 gtk_widget_show(button_box); | |
809 gtk_container_add(GTK_CONTAINER(select_font), button_box); | |
810 gtk_box_pack_start(GTK_BOX(fontbox), select_font, FALSE, FALSE, 0); | |
811 gtk_signal_connect(GTK_OBJECT(select_font), "clicked", GTK_SIGNAL_FUNC(show_font_dialog), NULL); | |
812 if (!(font_options & OPT_FONT_FACE)) | 801 if (!(font_options & OPT_FONT_FACE)) |
813 gtk_widget_set_sensitive(GTK_WIDGET(select_font), FALSE); | 802 gtk_widget_set_sensitive(GTK_WIDGET(select_font), FALSE); |
814 gtk_widget_show(select_font); | 803 gtk_widget_show(select_font); |
815 gtk_signal_connect(GTK_OBJECT(font_face_for_text), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select_font); | 804 gtk_signal_connect(GTK_OBJECT(font_face_for_text), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), select_font); |
816 /* end of font button */ | |
817 | 805 |
818 gtk_widget_show(appearance_page); | 806 gtk_widget_show(appearance_page); |
819 gtk_widget_show(fontbox); | 807 gtk_widget_show(fontbox); |
820 gtk_widget_show(fontframe); | 808 gtk_widget_show(fontframe); |
821 gtk_widget_show(appbox); | 809 gtk_widget_show(appbox); |
832 gtk_widget_show(chat_page); | 820 gtk_widget_show(chat_page); |
833 | 821 |
834 bbox = gtk_hbox_new(FALSE, 5); | 822 bbox = gtk_hbox_new(FALSE, 5); |
835 | 823 |
836 /* Build close button */ | 824 /* Build close button */ |
837 | 825 close = picture_button(pd->window, _("Close"), cancel_xpm); |
838 close = gtk_button_new(); | |
839 | |
840 button_box = gtk_hbox_new(FALSE, 5); | |
841 icon = gdk_pixmap_create_from_xpm_d ( pd->window->window, &mask, NULL, cancel_xpm); | |
842 | |
843 icon_i = gtk_pixmap_new(icon, mask); | |
844 | |
845 button_label = gtk_label_new(_("Close")); | |
846 | |
847 gtk_box_pack_start(GTK_BOX(button_box), icon_i, FALSE, FALSE, 2); | |
848 gtk_box_pack_end(GTK_BOX(button_box), button_label, FALSE, FALSE, 2); | |
849 | |
850 gtk_widget_show(button_label); | |
851 gtk_widget_show(icon_i); | |
852 | |
853 gtk_widget_show(button_box); | |
854 | |
855 gtk_container_add(GTK_CONTAINER(close), button_box); | |
856 gtk_widget_set_usize(close, 75, 30); | 826 gtk_widget_set_usize(close, 75, 30); |
857 | |
858 /* End of close button */ | 827 /* End of close button */ |
859 | 828 |
860 | 829 |
861 if (display_options & OPT_DISP_COOL_LOOK) | 830 if (display_options & OPT_DISP_COOL_LOOK) |
862 gtk_button_set_relief(GTK_BUTTON(close), GTK_RELIEF_NONE); | 831 gtk_button_set_relief(GTK_BUTTON(close), GTK_RELIEF_NONE); |
1030 GtkWidget *rem_button, *add_button, *ref_button; | 999 GtkWidget *rem_button, *add_button, *ref_button; |
1031 GtkWidget *list1, *list2; | 1000 GtkWidget *list1, *list2; |
1032 GtkWidget *label; | 1001 GtkWidget *label; |
1033 GtkWidget *sw1, *sw2; | 1002 GtkWidget *sw1, *sw2; |
1034 GtkWidget *item; | 1003 GtkWidget *item; |
1035 GtkWidget *button_box, *icon_i, *button_label; | |
1036 GdkPixmap *icon; | |
1037 GdkBitmap *mask; | |
1038 struct chat_page *cp = g_new0(struct chat_page, 1); | 1004 struct chat_page *cp = g_new0(struct chat_page, 1); |
1039 GList *crs = chat_rooms; | 1005 GList *crs = chat_rooms; |
1040 GList *items = NULL; | 1006 GList *items = NULL; |
1041 struct chat_room *cr; | 1007 struct chat_room *cr; |
1042 | 1008 |
1043 table = gtk_table_new(4, 2, FALSE); | 1009 table = gtk_table_new(4, 2, FALSE); |
1044 gtk_widget_show(table); | 1010 gtk_widget_show(table); |
1045 | 1011 |
1046 | |
1047 gtk_box_pack_start(GTK_BOX(page), table, TRUE, TRUE, 0); | 1012 gtk_box_pack_start(GTK_BOX(page), table, TRUE, TRUE, 0); |
1048 | |
1049 | 1013 |
1050 list1 = gtk_list_new(); | 1014 list1 = gtk_list_new(); |
1051 list2 = gtk_list_new(); | 1015 list2 = gtk_list_new(); |
1052 sw1 = gtk_scrolled_window_new(NULL, NULL); | 1016 sw1 = gtk_scrolled_window_new(NULL, NULL); |
1053 sw2 = gtk_scrolled_window_new(NULL, NULL); | 1017 sw2 = gtk_scrolled_window_new(NULL, NULL); |
1054 | 1018 |
1055 /* Build refresh button */ | 1019 ref_button = picture_button(pd->window, _("Refresh"), refresh_xpm); |
1056 ref_button = gtk_button_new(); | 1020 add_button = picture_button(pd->window, _("Add"), gnome_add_xpm); |
1057 button_box = gtk_hbox_new(FALSE, 5); | 1021 rem_button = picture_button(pd->window, _("Remove"), gnome_remove_xpm); |
1058 icon = gdk_pixmap_create_from_xpm_d ( pd->window->window, &mask, NULL, refresh_xpm); | |
1059 icon_i = gtk_pixmap_new(icon, mask); | |
1060 button_label = gtk_label_new(_("Refresh List")); | |
1061 gtk_box_pack_start(GTK_BOX(button_box), icon_i, FALSE, FALSE, 2); | |
1062 gtk_box_pack_end(GTK_BOX(button_box), button_label, FALSE, FALSE, 2); | |
1063 gtk_widget_show(button_label); | |
1064 gtk_widget_show(icon_i); | |
1065 if (display_options & OPT_DISP_COOL_LOOK) | |
1066 gtk_button_set_relief(GTK_BUTTON(ref_button), GTK_RELIEF_NONE); | |
1067 gtk_widget_show(button_box); | |
1068 gtk_container_add(GTK_CONTAINER(ref_button), button_box); | |
1069 /* End of refresh button */ | |
1070 | |
1071 add_button = gtk_button_new_with_label(_("Add")); | |
1072 rem_button = gtk_button_new_with_label(_("Remove")); | |
1073 if (display_options & OPT_DISP_COOL_LOOK) | 1022 if (display_options & OPT_DISP_COOL_LOOK) |
1074 { | 1023 { |
1075 gtk_button_set_relief(GTK_BUTTON(ref_button), GTK_RELIEF_NONE); | 1024 gtk_button_set_relief(GTK_BUTTON(ref_button), GTK_RELIEF_NONE); |
1076 gtk_button_set_relief(GTK_BUTTON(add_button), GTK_RELIEF_NONE); | 1025 gtk_button_set_relief(GTK_BUTTON(add_button), GTK_RELIEF_NONE); |
1077 gtk_button_set_relief(GTK_BUTTON(rem_button), GTK_RELIEF_NONE); | 1026 gtk_button_set_relief(GTK_BUTTON(rem_button), GTK_RELIEF_NONE); |