Mercurial > pidgin.yaz
comparison pidgin/gtkprefs.c @ 25271:6ebabe0841a0
propagate from branch 'im.pidgin.pidgin' (head 06e4830f3567955e026f3d594afcc65a07d57b26)
to branch 'im.pidgin.pidgin.next.minor' (head 22a0659074cef317fb0f96d98d9628d193dd224d)
author | Gary Kramlich <grim@reaperworld.com> |
---|---|
date | Thu, 30 Oct 2008 03:03:55 +0000 |
parents | 1c45897c79fc 9525fb966efb |
children | ff6eba605ca3 |
comparison
equal
deleted
inserted
replaced
24272:882a1c4c11b4 | 25271:6ebabe0841a0 |
---|---|
33 #include "proxy.h" | 33 #include "proxy.h" |
34 #include "prpl.h" | 34 #include "prpl.h" |
35 #include "request.h" | 35 #include "request.h" |
36 #include "savedstatuses.h" | 36 #include "savedstatuses.h" |
37 #include "sound.h" | 37 #include "sound.h" |
38 #include "sound-theme.h" | |
39 #include "theme-manager.h" | |
38 #include "util.h" | 40 #include "util.h" |
39 #include "network.h" | 41 #include "network.h" |
40 | 42 |
41 #include "gtkblist.h" | 43 #include "gtkblist.h" |
42 #include "gtkconv.h" | 44 #include "gtkconv.h" |
45 #include "gtkimhtml.h" | 47 #include "gtkimhtml.h" |
46 #include "gtkimhtmltoolbar.h" | 48 #include "gtkimhtmltoolbar.h" |
47 #include "gtkprefs.h" | 49 #include "gtkprefs.h" |
48 #include "gtksavedstatuses.h" | 50 #include "gtksavedstatuses.h" |
49 #include "gtksound.h" | 51 #include "gtksound.h" |
52 #include "gtkstatus-icon-theme.h" | |
50 #include "gtkthemes.h" | 53 #include "gtkthemes.h" |
51 #include "gtkutils.h" | 54 #include "gtkutils.h" |
52 #include "pidginstock.h" | 55 #include "pidginstock.h" |
53 | 56 |
54 #define PROXYHOST 0 | 57 #define PROXYHOST 0 |
55 #define PROXYPORT 1 | 58 #define PROXYPORT 1 |
56 #define PROXYUSER 2 | 59 #define PROXYUSER 2 |
57 #define PROXYPASS 3 | 60 #define PROXYPASS 3 |
58 | 61 |
62 #define PREFS_OPTIMAL_ICON_SIZE 32 | |
63 | |
59 static int sound_row_sel = 0; | 64 static int sound_row_sel = 0; |
60 static GtkWidget *prefsnotebook; | 65 static GtkWidget *prefsnotebook; |
61 | 66 |
62 static GtkWidget *sound_entry = NULL; | 67 static GtkWidget *sound_entry = NULL; |
63 static GtkListStore *smiley_theme_store = NULL; | 68 static GtkListStore *smiley_theme_store = NULL; |
66 | 71 |
67 static GtkWidget *prefs = NULL; | 72 static GtkWidget *prefs = NULL; |
68 static GtkWidget *debugbutton = NULL; | 73 static GtkWidget *debugbutton = NULL; |
69 static int notebook_page = 0; | 74 static int notebook_page = 0; |
70 static GtkTreeRowReference *previous_smiley_row = NULL; | 75 static GtkTreeRowReference *previous_smiley_row = NULL; |
76 | |
77 static gboolean prefs_themes_unsorted = TRUE; | |
78 static GtkListStore *prefs_sound_themes; | |
79 static GtkListStore *prefs_blist_themes; | |
80 static GtkListStore *prefs_status_icon_themes; | |
81 | |
71 | 82 |
72 /* | 83 /* |
73 * PROTOTYPES | 84 * PROTOTYPES |
74 */ | 85 */ |
75 static void delete_prefs(GtkWidget *, void *); | 86 static void delete_prefs(GtkWidget *, void *); |
544 } | 555 } |
545 | 556 |
546 gtk_drag_finish(dc, FALSE, FALSE, t); | 557 gtk_drag_finish(dc, FALSE, FALSE, t); |
547 } | 558 } |
548 | 559 |
560 /* Rebuild the markup for the sound theme selection for "(Custom)" themes */ | |
561 static void | |
562 pref_sound_generate_markup() | |
563 { | |
564 gboolean print_custom, customized; | |
565 const gchar *name, *author, *description, *current_theme; | |
566 gchar *markup; | |
567 PurpleSoundTheme *theme; | |
568 GtkTreeIter iter; | |
569 | |
570 customized = pidgin_sound_is_customized(); | |
571 current_theme = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme"); | |
572 | |
573 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(prefs_sound_themes), &iter)) { | |
574 do { | |
575 gtk_tree_model_get(GTK_TREE_MODEL(prefs_sound_themes), &iter, 2, &name, -1); | |
576 | |
577 print_custom = customized && g_str_equal(current_theme, name); | |
578 | |
579 if (g_str_equal(name, "")) | |
580 markup = g_strdup_printf("<b>(Default)</b>%s%s - None\n<span foreground='dim grey'>The default Pidgin sound theme</span>", | |
581 print_custom ? " " : "", print_custom ? "(Custom)" : ""); | |
582 else { | |
583 theme = PURPLE_SOUND_THEME(purple_theme_manager_find_theme(name, "sound")); | |
584 author = purple_theme_get_author(PURPLE_THEME(theme)); | |
585 description = purple_theme_get_description(PURPLE_THEME(theme)); | |
586 | |
587 markup = g_strdup_printf("<b>%s</b>%s%s%s%s\n<span foreground='dim grey'>%s</span>", | |
588 name, print_custom ? " " : "", print_custom ? "(Custom)" : "", | |
589 author != NULL ? " - " : "", author != NULL ? author : "", description != NULL ? description : ""); | |
590 } | |
591 | |
592 gtk_list_store_set(prefs_sound_themes, &iter, 1, markup, -1); | |
593 | |
594 g_free(markup); | |
595 | |
596 } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(prefs_sound_themes), &iter)); | |
597 } | |
598 } | |
599 | |
600 /* adds the themes to the theme list from the manager so they can be sisplayed in prefs */ | |
601 static void | |
602 prefs_themes_sort(PurpleTheme *theme) | |
603 { | |
604 GdkPixbuf *pixbuf = NULL; | |
605 GtkTreeIter iter; | |
606 gchar *image_full = NULL, *markup; | |
607 const gchar *name, *author, *description; | |
608 | |
609 if (PURPLE_IS_SOUND_THEME(theme)){ | |
610 | |
611 image_full = purple_theme_get_image_full(theme); | |
612 if (image_full != NULL){ | |
613 pixbuf = gdk_pixbuf_new_from_file_at_scale(image_full, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE, NULL); | |
614 g_free(image_full); | |
615 } else pixbuf = NULL; | |
616 | |
617 gtk_list_store_append(prefs_sound_themes, &iter); | |
618 gtk_list_store_set(prefs_sound_themes, &iter, 0, pixbuf, 2, purple_theme_get_name(theme), -1); | |
619 | |
620 if (pixbuf != NULL) | |
621 gdk_pixbuf_unref(pixbuf); | |
622 | |
623 } else if (PIDGIN_IS_BLIST_THEME(theme) || PIDGIN_IS_STATUS_ICON_THEME(theme)){ | |
624 GtkListStore *store; | |
625 | |
626 if (PIDGIN_IS_BLIST_THEME(theme)) | |
627 store = prefs_blist_themes; | |
628 else store = prefs_status_icon_themes; | |
629 | |
630 image_full = purple_theme_get_image_full(theme); | |
631 if (image_full != NULL){ | |
632 pixbuf = gdk_pixbuf_new_from_file_at_scale(image_full, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE, NULL); | |
633 g_free(image_full); | |
634 } else pixbuf = NULL; | |
635 | |
636 name = purple_theme_get_name(theme); | |
637 author = purple_theme_get_author(theme); | |
638 description = purple_theme_get_description(theme); | |
639 | |
640 markup = g_strdup_printf("<b>%s</b>%s%s\n<span foreground='dim grey'>%s</span>", name, author != NULL ? " - " : "", | |
641 author != NULL ? author : "", description != NULL ? description : ""); | |
642 | |
643 gtk_list_store_append(store, &iter); | |
644 gtk_list_store_set(store, &iter, 0, pixbuf, 1, markup, 2, name, -1); | |
645 | |
646 g_free(markup); | |
647 if (pixbuf != NULL) | |
648 gdk_pixbuf_unref(pixbuf); | |
649 } | |
650 | |
651 } | |
652 | |
653 /* init all the theme variables so that the themes can be sorted later and used by pref pages */ | |
654 static void | |
655 prefs_themes_init() | |
656 { | |
657 GdkPixbuf *pixbuf = NULL; | |
658 gchar *filename; | |
659 GtkTreeIter iter; | |
660 | |
661 filename = g_build_filename(DATADIR, "icons", "hicolor", "32x32", "apps", "pidgin.png", NULL); | |
662 pixbuf = gdk_pixbuf_new_from_file_at_scale(filename, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE, NULL); | |
663 g_free(filename); | |
664 | |
665 /* sound themes */ | |
666 prefs_sound_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); | |
667 | |
668 gtk_list_store_append(prefs_sound_themes, &iter); | |
669 gtk_list_store_set(prefs_sound_themes, &iter, 0, pixbuf, 2, "", -1); | |
670 | |
671 /* blist themes */ | |
672 prefs_blist_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); | |
673 | |
674 gtk_list_store_append(prefs_blist_themes, &iter); | |
675 gtk_list_store_set(prefs_blist_themes, &iter, 0, pixbuf, 1, "<b>(Default)</b> - None\n<span color='dim grey'>" | |
676 "The default Pidgin buddy list theme</span>", 2, "", -1); | |
677 | |
678 /* status icon themes */ | |
679 prefs_status_icon_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); | |
680 | |
681 gtk_list_store_append(prefs_status_icon_themes, &iter); | |
682 gtk_list_store_set(prefs_status_icon_themes, &iter, 0, pixbuf, 1, "<b>(Default)</b> - None\n<span color='dim grey'>" | |
683 "The default Pidgin status icon theme</span>", 2, "", -1); | |
684 | |
685 gdk_pixbuf_unref(pixbuf); | |
686 } | |
687 | |
688 /* builds a theme combo box from a list store with colums: icon preview, markup, theme name */ | |
689 static GtkWidget * | |
690 prefs_build_theme_combo_box(GtkListStore *store, const gchar *current_theme) | |
691 { | |
692 GtkWidget *combo_box; | |
693 GtkCellRenderer *cell_rend; | |
694 GtkTreeIter iter; | |
695 gchar *theme = NULL; | |
696 gboolean unset = TRUE; | |
697 | |
698 g_return_val_if_fail(store != NULL && current_theme != NULL, NULL); | |
699 | |
700 combo_box = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store)); | |
701 | |
702 cell_rend = gtk_cell_renderer_pixbuf_new(); | |
703 gtk_cell_renderer_set_fixed_size(cell_rend, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE); | |
704 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, FALSE); | |
705 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "pixbuf", 0, NULL); | |
706 | |
707 cell_rend = gtk_cell_renderer_text_new(); | |
708 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell_rend, FALSE); | |
709 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "markup", 1, NULL); | |
710 /*#if GTK_CHECK_VERSION(2,6,0) | |
711 g_object_set(cell_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL); | |
712 #endif*/ | |
713 | |
714 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter)) { | |
715 do { | |
716 gtk_tree_model_get(GTK_TREE_MODEL(store), &iter, 2, &theme, -1); | |
717 | |
718 if (g_str_equal(current_theme, theme)) { | |
719 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(combo_box), &iter); | |
720 unset = FALSE; | |
721 } | |
722 | |
723 g_free(theme); | |
724 } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter)); | |
725 } | |
726 | |
727 if (unset) | |
728 gtk_combo_box_set_active(GTK_COMBO_BOX(combo_box), 0); | |
729 | |
730 return combo_box; | |
731 } | |
732 | |
733 /* sets the current sound theme */ | |
734 static void | |
735 prefs_set_sound_theme_cb(GtkComboBox *combo_box, gpointer user_data) | |
736 { | |
737 gint i; | |
738 gchar *pref; | |
739 gchar *new_theme; | |
740 gboolean sucess; | |
741 GtkTreeIter new_iter; | |
742 | |
743 | |
744 sucess = gtk_combo_box_get_active_iter(combo_box, &new_iter); | |
745 g_return_if_fail(sucess); | |
746 | |
747 gtk_tree_model_get(GTK_TREE_MODEL(prefs_sound_themes), &new_iter, 2, &new_theme, -1); | |
748 | |
749 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/sound/theme", new_theme); | |
750 | |
751 /* New theme removes all customization */ | |
752 for(i=0; i < PURPLE_NUM_SOUNDS; i++){ | |
753 pref = g_strdup_printf(PIDGIN_PREFS_ROOT "/sound/file/%s", | |
754 pidgin_sound_get_event_option(i)); | |
755 purple_prefs_set_path(pref, ""); | |
756 g_free(pref); | |
757 } | |
758 | |
759 /* gets rid of the "(Custom)" from the last selection */ | |
760 pref_sound_generate_markup(); | |
761 | |
762 gtk_entry_set_text(GTK_ENTRY(sound_entry), _("(default)")); | |
763 | |
764 g_free(new_theme); | |
765 } | |
766 | |
549 /* Does same as normal sort, except "none" is sorted first */ | 767 /* Does same as normal sort, except "none" is sorted first */ |
550 static gint pidgin_sort_smileys (GtkTreeModel *model, | 768 static gint pidgin_sort_smileys (GtkTreeModel *model, |
551 GtkTreeIter *a, | 769 GtkTreeIter *a, |
552 GtkTreeIter *b, | 770 GtkTreeIter *b, |
553 gpointer userdata) | 771 gpointer userdata) |
920 G_CALLBACK(conversation_close_accel_changed_cb), checkbox, (GConnectFlags)0); | 1138 G_CALLBACK(conversation_close_accel_changed_cb), checkbox, (GConnectFlags)0); |
921 | 1139 |
922 gtk_box_pack_start(GTK_BOX(vbox), checkbox, FALSE, FALSE, 0); | 1140 gtk_box_pack_start(GTK_BOX(vbox), checkbox, FALSE, FALSE, 0); |
923 } | 1141 } |
924 | 1142 |
1143 /* sets the current buddy list theme */ | |
1144 static void | |
1145 prefs_set_blist_theme_cb(GtkComboBox *combo_box, gpointer user_data) | |
1146 { | |
1147 PidginBlistTheme *theme; | |
1148 GtkTreeIter iter; | |
1149 gchar *name = NULL; | |
1150 | |
1151 g_return_if_fail(gtk_combo_box_get_active_iter(combo_box, &iter)); | |
1152 gtk_tree_model_get(GTK_TREE_MODEL(prefs_blist_themes), &iter, 2, &name, -1); | |
1153 | |
1154 theme = PIDGIN_BLIST_THEME(purple_theme_manager_find_theme(name, "blist")); | |
1155 g_free(name); | |
1156 | |
1157 pidgin_blist_set_theme(theme); | |
1158 } | |
1159 | |
1160 /* sets the current icon theme */ | |
1161 static void | |
1162 prefs_set_status_icon_theme_cb(GtkComboBox *combo_box, gpointer user_data) | |
1163 { | |
1164 PidginStatusIconTheme *theme; | |
1165 GtkTreeIter iter; | |
1166 gchar *name = NULL; | |
1167 | |
1168 g_return_if_fail(gtk_combo_box_get_active_iter(combo_box, &iter)); | |
1169 gtk_tree_model_get(GTK_TREE_MODEL(prefs_status_icon_themes), &iter, 2, &name, -1); | |
1170 | |
1171 theme = PIDGIN_STATUS_ICON_THEME(purple_theme_manager_find_theme(name, "status-icon")); | |
1172 g_free(name); | |
1173 | |
1174 pidgin_stock_load_status_icon_theme(theme); | |
1175 } | |
1176 | |
925 static GtkWidget * | 1177 static GtkWidget * |
926 interface_page(void) | 1178 interface_page(void) |
927 { | 1179 { |
928 GtkWidget *ret; | 1180 GtkWidget *ret; |
929 GtkWidget *vbox; | 1181 GtkWidget *vbox; |
930 GtkWidget *vbox2; | 1182 GtkWidget *vbox2; |
931 GtkWidget *label; | 1183 GtkWidget *label; |
1184 GtkWidget *combo_box; | |
932 GtkSizeGroup *sg; | 1185 GtkSizeGroup *sg; |
933 GList *names = NULL; | 1186 GList *names = NULL; |
934 | 1187 |
935 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); | 1188 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
936 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER); | 1189 gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER); |
937 | 1190 |
938 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | 1191 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
939 | 1192 |
1193 /* Buddy List Themes */ | |
1194 vbox = pidgin_make_frame(ret, _("Buddy List Theme")); | |
1195 | |
1196 combo_box = prefs_build_theme_combo_box(prefs_blist_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme")); | |
1197 gtk_box_pack_start(GTK_BOX (vbox), combo_box, FALSE, FALSE, 0); | |
1198 g_signal_connect(G_OBJECT(combo_box), "changed", (GCallback)prefs_set_blist_theme_cb, NULL); | |
1199 | |
1200 /* Status Icon Themes */ | |
1201 combo_box = prefs_build_theme_combo_box(prefs_status_icon_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/status/icon-theme")); | |
1202 gtk_box_pack_start(GTK_BOX (vbox), combo_box, FALSE, FALSE, 0); | |
1203 g_signal_connect(G_OBJECT(combo_box), "changed", (GCallback)prefs_set_status_icon_theme_cb, NULL); | |
1204 | |
1205 /* System Tray */ | |
940 vbox = pidgin_make_frame(ret, _("System Tray Icon")); | 1206 vbox = pidgin_make_frame(ret, _("System Tray Icon")); |
941 label = pidgin_prefs_dropdown(vbox, _("_Show system tray icon:"), PURPLE_PREF_STRING, | 1207 label = pidgin_prefs_dropdown(vbox, _("_Show system tray icon:"), PURPLE_PREF_STRING, |
942 PIDGIN_PREFS_ROOT "/docklet/show", | 1208 PIDGIN_PREFS_ROOT "/docklet/show", |
943 _("Always"), "always", | 1209 _("Always"), "always", |
944 _("On unread messages"), "pending", | 1210 _("On unread messages"), "pending", |
1734 pidgin_sound_get_event_option(sound_row_sel)); | 2000 pidgin_sound_get_event_option(sound_row_sel)); |
1735 purple_prefs_set_path(pref, ""); | 2001 purple_prefs_set_path(pref, ""); |
1736 g_free(pref); | 2002 g_free(pref); |
1737 | 2003 |
1738 gtk_entry_set_text(GTK_ENTRY(sound_entry), _("(default)")); | 2004 gtk_entry_set_text(GTK_ENTRY(sound_entry), _("(default)")); |
2005 | |
2006 pref_sound_generate_markup(); | |
1739 } | 2007 } |
1740 | 2008 |
1741 static void | 2009 static void |
1742 sound_chosen_cb(void *user_data, const char *filename) | 2010 sound_chosen_cb(void *user_data, const char *filename) |
1743 { | 2011 { |
1756 * If the sound we just changed is still the currently selected | 2024 * If the sound we just changed is still the currently selected |
1757 * sound, then update the box showing the file name. | 2025 * sound, then update the box showing the file name. |
1758 */ | 2026 */ |
1759 if (sound == sound_row_sel) | 2027 if (sound == sound_row_sel) |
1760 gtk_entry_set_text(GTK_ENTRY(sound_entry), filename); | 2028 gtk_entry_set_text(GTK_ENTRY(sound_entry), filename); |
2029 | |
2030 pref_sound_generate_markup(); | |
1761 } | 2031 } |
1762 | 2032 |
1763 static void select_sound(GtkWidget *button, gpointer being_NULL_is_fun) | 2033 static void select_sound(GtkWidget *button, gpointer being_NULL_is_fun) |
1764 { | 2034 { |
1765 gchar *pref; | 2035 gchar *pref; |
1824 file = purple_prefs_get_path(pref); | 2094 file = purple_prefs_get_path(pref); |
1825 g_free(pref); | 2095 g_free(pref); |
1826 if (sound_entry) | 2096 if (sound_entry) |
1827 gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : _("(default)")); | 2097 gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : _("(default)")); |
1828 g_value_unset (&val); | 2098 g_value_unset (&val); |
2099 | |
2100 pref_sound_generate_markup(); | |
1829 } | 2101 } |
1830 | 2102 |
1831 | 2103 |
1832 static void | 2104 static void |
1833 mute_changed_cb(const char *pref_name, | 2105 mute_changed_cb(const char *pref_name, |
1849 | 2121 |
1850 static GtkWidget * | 2122 static GtkWidget * |
1851 sound_page(void) | 2123 sound_page(void) |
1852 { | 2124 { |
1853 GtkWidget *ret; | 2125 GtkWidget *ret; |
1854 GtkWidget *vbox, *sw, *button; | 2126 GtkWidget *vbox, *sw, *button, *combo_box; |
1855 GtkSizeGroup *sg; | 2127 GtkSizeGroup *sg; |
1856 GtkTreeIter iter; | 2128 GtkTreeIter iter; |
1857 GtkWidget *event_view; | 2129 GtkWidget *event_view; |
1858 GtkListStore *event_store; | 2130 GtkListStore *event_store; |
1859 GtkCellRenderer *rend; | 2131 GtkCellRenderer *rend; |
1943 gtk_widget_set_sensitive(vbox, | 2215 gtk_widget_set_sensitive(vbox, |
1944 strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), "none")); | 2216 strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), "none")); |
1945 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", | 2217 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
1946 sound_changed2_cb, vbox); | 2218 sound_changed2_cb, vbox); |
1947 #endif | 2219 #endif |
1948 | |
1949 vbox = pidgin_make_frame(ret, _("Sound Events")); | 2220 vbox = pidgin_make_frame(ret, _("Sound Events")); |
1950 | 2221 |
1951 /* The following is an ugly hack to make the frame expand so the | 2222 /* The following is an ugly hack to make the frame expand so the |
1952 * sound events list is big enough to be usable */ | 2223 * sound events list is big enough to be usable */ |
1953 gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0, | 2224 gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0, |
1955 gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent), vbox->parent, TRUE, | 2226 gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent), vbox->parent, TRUE, |
1956 TRUE, 0, GTK_PACK_START); | 2227 TRUE, 0, GTK_PACK_START); |
1957 gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent->parent), | 2228 gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent->parent), |
1958 vbox->parent->parent, TRUE, TRUE, 0, GTK_PACK_START); | 2229 vbox->parent->parent, TRUE, TRUE, 0, GTK_PACK_START); |
1959 | 2230 |
2231 /* SOUND THEMES */ | |
2232 combo_box = prefs_build_theme_combo_box(prefs_sound_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme")); | |
2233 pref_sound_generate_markup(); | |
2234 gtk_box_pack_start(GTK_BOX (vbox), combo_box, FALSE, FALSE, 0); | |
2235 | |
2236 g_signal_connect(G_OBJECT(combo_box), "changed", (GCallback)prefs_set_sound_theme_cb, NULL); | |
2237 | |
2238 /* SOUND SELECTION */ | |
1960 sw = gtk_scrolled_window_new(NULL,NULL); | 2239 sw = gtk_scrolled_window_new(NULL,NULL); |
1961 gtk_widget_set_size_request(sw, -1, 100); | 2240 gtk_widget_set_size_request(sw, -1, 100); |
1962 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); | 2241 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); |
1963 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | 2242 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); |
1964 | 2243 |
2187 | 2466 |
2188 if (prefs) { | 2467 if (prefs) { |
2189 gtk_window_present(GTK_WINDOW(prefs)); | 2468 gtk_window_present(GTK_WINDOW(prefs)); |
2190 return; | 2469 return; |
2191 } | 2470 } |
2192 | 2471 |
2472 /* add everthing in the thmeme manager before the window is loaded */ | |
2473 if (prefs_themes_unsorted) { | |
2474 purple_theme_manager_for_each_theme(prefs_themes_sort); | |
2475 prefs_themes_unsorted = FALSE; | |
2476 } | |
2193 /* copy the preferences to tmp values... | 2477 /* copy the preferences to tmp values... |
2194 * I liked "take affect immediately" Oh well :-( */ | 2478 * I liked "take affect immediately" Oh well :-( */ |
2195 /* (that should have been "effect," right?) */ | 2479 /* (that should have been "effect," right?) */ |
2196 | 2480 |
2197 /* Back to instant-apply! I win! BU-HAHAHA! */ | 2481 /* Back to instant-apply! I win! BU-HAHAHA! */ |
2281 /* File locations */ | 2565 /* File locations */ |
2282 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/filelocations"); | 2566 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/filelocations"); |
2283 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_save_folder", ""); | 2567 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_save_folder", ""); |
2284 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_open_folder", ""); | 2568 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_open_folder", ""); |
2285 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_icon_folder", ""); | 2569 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_icon_folder", ""); |
2570 | |
2571 /* Themes */ | |
2572 prefs_themes_init(); | |
2286 | 2573 |
2287 /* Smiley Themes */ | 2574 /* Smiley Themes */ |
2288 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/smileys"); | 2575 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/smileys"); |
2289 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/smileys/theme", "Default"); | 2576 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/smileys/theme", "Default"); |
2290 | 2577 |