Mercurial > pidgin.yaz
comparison gtk/gtkprefs.c @ 14885:51c51d89c114
[gaim-migrate @ 17654]
This seems good. Change prefs dialog around a bit to add docklet pref. beta5 time?
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Thu, 02 Nov 2006 21:09:12 +0000 |
parents | 0e4833acd31c |
children | 3932bdf7cc00 |
comparison
equal
deleted
inserted
replaced
14884:f2b347afd583 | 14885:51c51d89c114 |
---|---|
68 static GtkTreeRowReference *previous_smiley_row = NULL; | 68 static GtkTreeRowReference *previous_smiley_row = NULL; |
69 | 69 |
70 /* | 70 /* |
71 * PROTOTYPES | 71 * PROTOTYPES |
72 */ | 72 */ |
73 static int prefs_notebook_add_page(const char*, GdkPixbuf*, | |
74 GtkWidget*, GtkTreeIter*, | |
75 GtkTreeIter*, int); | |
76 static void delete_prefs(GtkWidget *, void *); | 73 static void delete_prefs(GtkWidget *, void *); |
77 | 74 |
78 static void | 75 static void |
79 update_spin_value(GtkWidget *w, GtkWidget *spin) | 76 update_spin_value(GtkWidget *w, GtkWidget *spin) |
80 { | 77 { |
800 else | 797 else |
801 gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE); | 798 gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE); |
802 } | 799 } |
803 | 800 |
804 static GtkWidget * | 801 static GtkWidget * |
805 conv_page() | 802 interface_page() |
806 { | 803 { |
807 GtkWidget *ret; | 804 GtkWidget *ret; |
808 GtkWidget *vbox; | 805 GtkWidget *vbox; |
806 GtkWidget *vbox2; | |
809 GtkWidget *label; | 807 GtkWidget *label; |
810 GList *names = NULL; | 808 GList *names = NULL; |
811 GtkWidget *frame; | 809 |
812 GtkWidget *imhtml; | 810 ret = gtk_vbox_new(FALSE, GAIM_HIG_BOX_SPACE); |
811 gtk_container_set_border_width(GTK_CONTAINER(ret), GAIM_HIG_BORDER); | |
812 | |
813 vbox = gaim_gtk_make_frame(ret, _("System Tray Icon")); | |
814 label = gaim_gtk_prefs_dropdown(vbox, _("_Show System Tray Icon:"), GAIM_PREF_STRING, | |
815 "/gaim/gtk/docklet/show", | |
816 _("Always"), "always", | |
817 _("Never"), "never", | |
818 _("On unread messages"), "pending", | |
819 NULL); | |
820 | |
821 vbox = gaim_gtk_make_frame(ret, _("Conversation Window Hiding")); | |
822 gaim_gtk_prefs_dropdown(vbox, _("_Hide new IM conversations"), | |
823 GAIM_PREF_STRING, "/gaim/gtk/conversations/im/hide_new", | |
824 _("Never"), "never", | |
825 _("When away"), "away", | |
826 _("Always"), "always", | |
827 NULL); | |
828 | |
829 | |
830 /* All the tab options! */ | |
831 vbox = gaim_gtk_make_frame(ret, _("Tab Options")); | |
832 | |
833 gaim_gtk_prefs_checkbox(_("Show IMs and chats in _tabbed windows"), | |
834 "/gaim/gtk/conversations/tabs", vbox); | |
835 | |
836 /* | |
837 * Connect a signal to the above preference. When conversations are not | |
838 * shown in a tabbed window then all tabbing options should be disabled. | |
839 */ | |
840 vbox2 = gtk_vbox_new(FALSE, 9); | |
841 gtk_box_pack_start(GTK_BOX(vbox), vbox2, FALSE, FALSE, 0); | |
842 gaim_prefs_connect_callback(prefs, "/gaim/gtk/conversations/tabs", | |
843 conversation_usetabs_cb, vbox2); | |
844 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/tabs")) | |
845 gtk_widget_set_sensitive(vbox2, FALSE); | |
846 | |
847 gaim_gtk_prefs_checkbox(_("Show close b_utton on tabs"), | |
848 "/gaim/gtk/conversations/close_on_tabs", vbox2); | |
849 | |
850 label = gaim_gtk_prefs_dropdown(vbox2, _("_Placement:"), GAIM_PREF_INT, | |
851 "/gaim/gtk/conversations/tab_side", | |
852 _("Top"), GTK_POS_TOP, | |
853 _("Bottom"), GTK_POS_BOTTOM, | |
854 _("Left"), GTK_POS_LEFT, | |
855 _("Right"), GTK_POS_RIGHT, | |
856 #if GTK_CHECK_VERSION(2,6,0) | |
857 _("Left Vertical"), GTK_POS_LEFT|8, | |
858 _("Right Vertical"), GTK_POS_RIGHT|8, | |
859 #endif | |
860 NULL); | |
861 | |
862 names = gaim_gtkconv_placement_get_options(); | |
863 label = gaim_gtk_prefs_dropdown_from_list(vbox2, _("N_ew conversations:"), | |
864 GAIM_PREF_STRING, "/gaim/gtk/conversations/placement", names); | |
865 g_list_free(names); | |
866 | |
867 gtk_widget_show_all(ret); | |
868 return ret; | |
869 } | |
870 | |
871 static GtkWidget * | |
872 conv_page() | |
873 { | |
874 GtkWidget *ret; | |
875 GtkWidget *vbox; | |
813 GtkWidget *toolbar; | 876 GtkWidget *toolbar; |
814 GtkWidget *hbox; | |
815 GtkWidget *vbox2; | |
816 GtkWidget *iconpref1; | 877 GtkWidget *iconpref1; |
817 GtkWidget *iconpref2; | 878 GtkWidget *iconpref2; |
879 GtkWidget *imhtml; | |
880 GtkWidget *frame; | |
818 | 881 |
819 ret = gtk_vbox_new(FALSE, GAIM_HIG_BOX_SPACE); | 882 ret = gtk_vbox_new(FALSE, GAIM_HIG_BOX_SPACE); |
820 gtk_container_set_border_width(GTK_CONTAINER(ret), GAIM_HIG_BORDER); | 883 gtk_container_set_border_width(GTK_CONTAINER(ret), GAIM_HIG_BORDER); |
821 | 884 |
822 vbox = gaim_gtk_make_frame(ret, _("Conversations")); | 885 vbox = gaim_gtk_make_frame(ret, _("Conversations")); |
886 g_signal_connect_after(G_OBJECT(imhtml), "format_function_toggle", | 949 g_signal_connect_after(G_OBJECT(imhtml), "format_function_toggle", |
887 G_CALLBACK(formatting_toggle_cb), toolbar); | 950 G_CALLBACK(formatting_toggle_cb), toolbar); |
888 g_signal_connect_after(G_OBJECT(imhtml), "format_function_clear", | 951 g_signal_connect_after(G_OBJECT(imhtml), "format_function_clear", |
889 G_CALLBACK(formatting_clear_cb), NULL); | 952 G_CALLBACK(formatting_clear_cb), NULL); |
890 | 953 |
891 /* All the tab options! */ | |
892 vbox = gaim_gtk_make_frame(ret, _("Tab Options")); | |
893 | |
894 gaim_gtk_prefs_checkbox(_("Show IMs and chats in _tabbed windows"), | |
895 "/gaim/gtk/conversations/tabs", vbox); | |
896 | |
897 /* | |
898 * Connect a signal to the above preference. When conversations are not | |
899 * shown in a tabbed window then all tabbing options should be disabled. | |
900 */ | |
901 vbox2 = gtk_vbox_new(FALSE, 9); | |
902 gtk_box_pack_start(GTK_BOX(vbox), vbox2, FALSE, FALSE, 0); | |
903 gaim_prefs_connect_callback(prefs, "/gaim/gtk/conversations/tabs", | |
904 conversation_usetabs_cb, vbox2); | |
905 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/tabs")) | |
906 gtk_widget_set_sensitive(vbox2, FALSE); | |
907 | |
908 gaim_gtk_prefs_checkbox(_("Show close b_utton on tabs"), | |
909 "/gaim/gtk/conversations/close_on_tabs", vbox2); | |
910 | |
911 hbox = gtk_hbox_new(FALSE, 9); | |
912 gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0); | |
913 | |
914 label = gaim_gtk_prefs_dropdown(hbox, _("_Placement:"), GAIM_PREF_INT, | |
915 "/gaim/gtk/conversations/tab_side", | |
916 _("Top"), GTK_POS_TOP, | |
917 _("Bottom"), GTK_POS_BOTTOM, | |
918 _("Left"), GTK_POS_LEFT, | |
919 _("Right"), GTK_POS_RIGHT, | |
920 #if GTK_CHECK_VERSION(2,6,0) | |
921 _("Left Vertical"), GTK_POS_LEFT|8, | |
922 _("Right Vertical"), GTK_POS_RIGHT|8, | |
923 #endif | |
924 NULL); | |
925 | |
926 names = gaim_gtkconv_placement_get_options(); | |
927 label = gaim_gtk_prefs_dropdown_from_list(hbox, _("N_ew conversations:"), | |
928 GAIM_PREF_STRING, "/gaim/gtk/conversations/placement", names); | |
929 g_list_free(names); | |
930 | 954 |
931 gtk_widget_show_all(ret); | 955 gtk_widget_show_all(ret); |
932 | 956 |
933 return ret; | 957 return ret; |
934 } | 958 } |
1859 gtk_widget_show_all(ret); | 1883 gtk_widget_show_all(ret); |
1860 | 1884 |
1861 return ret; | 1885 return ret; |
1862 } | 1886 } |
1863 | 1887 |
1864 int prefs_notebook_add_page(const char *text, | 1888 static int |
1865 GdkPixbuf *pixbuf, | 1889 prefs_notebook_add_page(const char *text, |
1866 GtkWidget *page, | 1890 GtkWidget *page, |
1867 GtkTreeIter *iter, | 1891 int ind) { |
1868 GtkTreeIter *parent, | |
1869 int ind) { | |
1870 GdkPixbuf *icon = NULL; | |
1871 | |
1872 if (pixbuf) | |
1873 icon = gdk_pixbuf_scale_simple (pixbuf, 18, 18, GDK_INTERP_BILINEAR); | |
1874 | |
1875 if (pixbuf) | |
1876 g_object_unref(pixbuf); | |
1877 if (icon) | |
1878 g_object_unref(icon); | |
1879 | 1892 |
1880 #if GTK_CHECK_VERSION(2,4,0) | 1893 #if GTK_CHECK_VERSION(2,4,0) |
1881 return gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); | 1894 return gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); |
1882 #else | 1895 #else |
1883 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); | 1896 gtk_notebook_append_page(GTK_NOTEBOOK(prefsnotebook), page, gtk_label_new(text)); |
1884 return gtk_notebook_page_num(GTK_NOTEBOOK(prefsnotebook), page); | 1897 return gtk_notebook_page_num(GTK_NOTEBOOK(prefsnotebook), page); |
1885 #endif | 1898 #endif |
1886 } | 1899 } |
1887 | 1900 |
1888 static void prefs_notebook_init() { | 1901 static void prefs_notebook_init() { |
1889 GtkTreeIter p, c, c2; | 1902 prefs_notebook_add_page(_("Interface"), interface_page(), notebook_page++); |
1890 prefs_notebook_add_page(_("Conversations"), NULL, conv_page(), &c, &p, notebook_page++); | 1903 prefs_notebook_add_page(_("Conversations"), conv_page(), notebook_page++); |
1891 prefs_notebook_add_page(_("Smiley Themes"), NULL, theme_page(), &c2, &c, notebook_page++); | 1904 prefs_notebook_add_page(_("Smiley Themes"), theme_page(), notebook_page++); |
1892 prefs_notebook_add_page(_("Sounds"), NULL, sound_page(), &c, &p, notebook_page++); | 1905 prefs_notebook_add_page(_("Sounds"), sound_page(), notebook_page++); |
1893 prefs_notebook_add_page(_("Network"), NULL, network_page(), &p, NULL, notebook_page++); | 1906 prefs_notebook_add_page(_("Network"), network_page(), notebook_page++); |
1894 #ifndef _WIN32 | 1907 #ifndef _WIN32 |
1895 /* We use the registered default browser in windows */ | 1908 /* We use the registered default browser in windows */ |
1896 /* if the user is running gnome 2.x or Mac OS X, hide the browsers tab */ | 1909 /* if the user is running gnome 2.x or Mac OS X, hide the browsers tab */ |
1897 if ((gaim_running_gnome() == FALSE) && (gaim_running_osx() == FALSE)) { | 1910 if ((gaim_running_gnome() == FALSE) && (gaim_running_osx() == FALSE)) { |
1898 prefs_notebook_add_page(_("Browser"), NULL, browser_page(), &p, NULL, notebook_page++); | 1911 prefs_notebook_add_page(_("Browser"), browser_page(), notebook_page++); |
1899 } | 1912 } |
1900 #endif | 1913 #endif |
1901 prefs_notebook_add_page(_("Logging"), NULL, logging_page(), &p, NULL, notebook_page++); | 1914 prefs_notebook_add_page(_("Logging"), logging_page(), notebook_page++); |
1902 prefs_notebook_add_page(_("Status / Idle"), NULL, away_page(), &p, NULL, notebook_page++); | 1915 prefs_notebook_add_page(_("Status / Idle"), away_page(), notebook_page++); |
1903 } | 1916 } |
1904 | 1917 |
1905 void gaim_gtk_prefs_show(void) | 1918 void gaim_gtk_prefs_show(void) |
1906 { | 1919 { |
1907 GtkWidget *vbox; | 1920 GtkWidget *vbox; |