| 81 static GtkWidget *sample_imhtml = NULL; |
82 static GtkWidget *sample_imhtml = NULL; |
| 82 |
83 |
| 83 /* Themes page */ |
84 /* Themes page */ |
| 84 static GtkWidget *prefs_sound_themes_combo_box; |
85 static GtkWidget *prefs_sound_themes_combo_box; |
| 85 static GtkWidget *prefs_blist_themes_combo_box; |
86 static GtkWidget *prefs_blist_themes_combo_box; |
| |
87 static GtkWidget *prefs_conv_themes_combo_box; |
| |
88 static GtkWidget *prefs_conv_variants_combo_box; |
| 86 static GtkWidget *prefs_status_themes_combo_box; |
89 static GtkWidget *prefs_status_themes_combo_box; |
| 87 static GtkWidget *prefs_smiley_themes_combo_box; |
90 static GtkWidget *prefs_smiley_themes_combo_box; |
| 88 |
91 |
| 89 /* Sound theme specific */ |
92 /* Sound theme specific */ |
| 90 static GtkWidget *sound_entry = NULL; |
93 static GtkWidget *sound_entry = NULL; |
| 92 static gboolean prefs_sound_themes_loading; |
95 static gboolean prefs_sound_themes_loading; |
| 93 |
96 |
| 94 /* These exist outside the lifetime of the prefs dialog */ |
97 /* These exist outside the lifetime of the prefs dialog */ |
| 95 static GtkListStore *prefs_sound_themes; |
98 static GtkListStore *prefs_sound_themes; |
| 96 static GtkListStore *prefs_blist_themes; |
99 static GtkListStore *prefs_blist_themes; |
| |
100 static GtkListStore *prefs_conv_themes; |
| |
101 static GtkListStore *prefs_conv_variants; |
| 97 static GtkListStore *prefs_status_icon_themes; |
102 static GtkListStore *prefs_status_icon_themes; |
| 98 static GtkListStore *prefs_smiley_themes; |
103 static GtkListStore *prefs_smiley_themes; |
| 99 |
104 |
| 100 /* |
105 /* |
| 101 * PROTOTYPES |
106 * PROTOTYPES |
| 116 GtkWidget * |
121 GtkWidget * |
| 117 pidgin_prefs_labeled_spin_button(GtkWidget *box, const gchar *title, |
122 pidgin_prefs_labeled_spin_button(GtkWidget *box, const gchar *title, |
| 118 const char *key, int min, int max, GtkSizeGroup *sg) |
123 const char *key, int min, int max, GtkSizeGroup *sg) |
| 119 { |
124 { |
| 120 GtkWidget *spin; |
125 GtkWidget *spin; |
| 121 GtkAdjustment *adjust; |
126 GtkObject *adjust; |
| 122 int val; |
127 int val; |
| 123 |
128 |
| 124 val = purple_prefs_get_int(key); |
129 val = purple_prefs_get_int(key); |
| 125 |
130 |
| 126 adjust = gtk_adjustment_new(val, min, max, 1, 1, 0); |
131 adjust = gtk_adjustment_new(val, min, max, 1, 1, 0); |
| 239 int stored_int = 0; |
244 int stored_int = 0; |
| 240 gboolean stored_bool = FALSE; |
245 gboolean stored_bool = FALSE; |
| 241 int int_value = 0; |
246 int int_value = 0; |
| 242 const char *str_value = NULL; |
247 const char *str_value = NULL; |
| 243 gboolean bool_value = FALSE; |
248 gboolean bool_value = FALSE; |
| 244 GtkListStore *store; |
249 GtkListStore *store = NULL; |
| 245 GtkTreeIter iter; |
250 GtkTreeIter iter; |
| 246 GtkTreeIter active; |
251 GtkTreeIter active; |
| 247 GtkCellRenderer *renderer; |
252 GtkCellRenderer *renderer; |
| 248 |
253 |
| 249 g_return_val_if_fail(menuitems != NULL, NULL); |
254 g_return_val_if_fail(menuitems != NULL, NULL); |
| 255 store = gtk_list_store_new(PREF_DROPDOWN_COUNT, G_TYPE_STRING, G_TYPE_STRING); |
260 store = gtk_list_store_new(PREF_DROPDOWN_COUNT, G_TYPE_STRING, G_TYPE_STRING); |
| 256 stored_str = purple_prefs_get_string(key); |
261 stored_str = purple_prefs_get_string(key); |
| 257 } else if (type == PURPLE_PREF_BOOLEAN) { |
262 } else if (type == PURPLE_PREF_BOOLEAN) { |
| 258 store = gtk_list_store_new(PREF_DROPDOWN_COUNT, G_TYPE_STRING, G_TYPE_BOOLEAN); |
263 store = gtk_list_store_new(PREF_DROPDOWN_COUNT, G_TYPE_STRING, G_TYPE_BOOLEAN); |
| 259 stored_bool = purple_prefs_get_bool(key); |
264 stored_bool = purple_prefs_get_bool(key); |
| |
265 } else { |
| |
266 g_warn_if_reached(); |
| |
267 return NULL; |
| 260 } |
268 } |
| 261 |
269 |
| 262 dropdown = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store)); |
270 dropdown = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store)); |
| 263 g_object_set_data(G_OBJECT(dropdown), "type", GINT_TO_POINTER(type)); |
271 g_object_set_data(G_OBJECT(dropdown), "type", GINT_TO_POINTER(type)); |
| 264 |
272 |
| 374 sound_row_sel = 0; |
382 sound_row_sel = 0; |
| 375 prefs_sound_themes_loading = FALSE; |
383 prefs_sound_themes_loading = FALSE; |
| 376 |
384 |
| 377 prefs_sound_themes_combo_box = NULL; |
385 prefs_sound_themes_combo_box = NULL; |
| 378 prefs_blist_themes_combo_box = NULL; |
386 prefs_blist_themes_combo_box = NULL; |
| |
387 prefs_conv_themes_combo_box = NULL; |
| |
388 prefs_conv_variants_combo_box = NULL; |
| 379 prefs_status_themes_combo_box = NULL; |
389 prefs_status_themes_combo_box = NULL; |
| 380 prefs_smiley_themes_combo_box = NULL; |
390 prefs_smiley_themes_combo_box = NULL; |
| 381 |
391 |
| 382 sample_imhtml = NULL; |
392 sample_imhtml = NULL; |
| 383 |
393 |
| 525 gtk_list_store_set(store, &iter, 0, pixbuf, 1, markup, 2, name, -1); |
535 gtk_list_store_set(store, &iter, 0, pixbuf, 1, markup, 2, name, -1); |
| 526 |
536 |
| 527 g_free(markup); |
537 g_free(markup); |
| 528 if (pixbuf != NULL) |
538 if (pixbuf != NULL) |
| 529 g_object_unref(G_OBJECT(pixbuf)); |
539 g_object_unref(G_OBJECT(pixbuf)); |
| |
540 |
| |
541 } else if (PIDGIN_IS_CONV_THEME(theme)) { |
| |
542 /* No image available? */ |
| |
543 |
| |
544 name = purple_theme_get_name(theme); |
| |
545 /* No author available */ |
| |
546 /* No description available */ |
| |
547 |
| |
548 markup = get_theme_markup(name, FALSE, NULL, NULL); |
| |
549 |
| |
550 gtk_list_store_append(prefs_conv_themes, &iter); |
| |
551 gtk_list_store_set(prefs_conv_themes, &iter, 1, markup, 2, name, -1); |
| 530 } |
552 } |
| 531 } |
553 } |
| 532 |
554 |
| 533 static void |
555 static void |
| 534 prefs_set_active_theme_combo(GtkWidget *combo_box, GtkListStore *store, const gchar *current_theme) |
556 prefs_set_active_theme_combo(GtkWidget *combo_box, GtkListStore *store, const gchar *current_theme) |
| 579 gtk_list_store_append(prefs_blist_themes, &iter); |
601 gtk_list_store_append(prefs_blist_themes, &iter); |
| 580 tmp = get_theme_markup(_("Default"), FALSE, _("Penguin Pimps"), |
602 tmp = get_theme_markup(_("Default"), FALSE, _("Penguin Pimps"), |
| 581 _("The default Pidgin buddy list theme")); |
603 _("The default Pidgin buddy list theme")); |
| 582 gtk_list_store_set(prefs_blist_themes, &iter, 0, pixbuf, 1, tmp, 2, "", -1); |
604 gtk_list_store_set(prefs_blist_themes, &iter, 0, pixbuf, 1, tmp, 2, "", -1); |
| 583 g_free(tmp); |
605 g_free(tmp); |
| |
606 |
| |
607 /* conversation themes */ |
| |
608 gtk_list_store_clear(prefs_conv_themes); |
| |
609 gtk_list_store_append(prefs_conv_themes, &iter); |
| |
610 tmp = get_theme_markup(_("Default"), FALSE, _("Penguin Pimps"), |
| |
611 _("The default Pidgin conversation theme")); |
| |
612 gtk_list_store_set(prefs_conv_themes, &iter, 0, pixbuf, 1, tmp, 2, "", -1); |
| |
613 g_free(tmp); |
| |
614 |
| |
615 /* conversation theme variants */ |
| |
616 gtk_list_store_clear(prefs_conv_variants); |
| 584 |
617 |
| 585 /* status icon themes */ |
618 /* status icon themes */ |
| 586 gtk_list_store_clear(prefs_status_icon_themes); |
619 gtk_list_store_clear(prefs_status_icon_themes); |
| 587 gtk_list_store_append(prefs_status_icon_themes, &iter); |
620 gtk_list_store_append(prefs_status_icon_themes, &iter); |
| 588 tmp = get_theme_markup(_("Default"), FALSE, _("Penguin Pimps"), |
621 tmp = get_theme_markup(_("Default"), FALSE, _("Penguin Pimps"), |
| 600 smileys_refresh_theme_list(); |
633 smileys_refresh_theme_list(); |
| 601 |
634 |
| 602 /* set active */ |
635 /* set active */ |
| 603 prefs_set_active_theme_combo(prefs_sound_themes_combo_box, prefs_sound_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme")); |
636 prefs_set_active_theme_combo(prefs_sound_themes_combo_box, prefs_sound_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/theme")); |
| 604 prefs_set_active_theme_combo(prefs_blist_themes_combo_box, prefs_blist_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme")); |
637 prefs_set_active_theme_combo(prefs_blist_themes_combo_box, prefs_blist_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/blist/theme")); |
| |
638 prefs_set_active_theme_combo(prefs_conv_themes_combo_box, prefs_conv_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/theme")); |
| 605 prefs_set_active_theme_combo(prefs_status_themes_combo_box, prefs_status_icon_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/status/icon-theme")); |
639 prefs_set_active_theme_combo(prefs_status_themes_combo_box, prefs_status_icon_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/status/icon-theme")); |
| 606 prefs_set_active_theme_combo(prefs_smiley_themes_combo_box, prefs_smiley_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/smileys/theme")); |
640 prefs_set_active_theme_combo(prefs_smiley_themes_combo_box, prefs_smiley_themes, purple_prefs_get_string(PIDGIN_PREFS_ROOT "/smileys/theme")); |
| 607 prefs_sound_themes_loading = FALSE; |
641 prefs_sound_themes_loading = FALSE; |
| 608 } |
642 } |
| 609 |
643 |
| 612 prefs_themes_init(void) |
646 prefs_themes_init(void) |
| 613 { |
647 { |
| 614 prefs_sound_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); |
648 prefs_sound_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); |
| 615 |
649 |
| 616 prefs_blist_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); |
650 prefs_blist_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); |
| |
651 |
| |
652 prefs_conv_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); |
| |
653 |
| |
654 prefs_conv_variants = gtk_list_store_new(1, G_TYPE_STRING); |
| 617 |
655 |
| 618 prefs_status_icon_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); |
656 prefs_status_icon_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); |
| 619 |
657 |
| 620 prefs_smiley_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); |
658 prefs_smiley_themes = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING); |
| 621 } |
659 } |
| 862 |
900 |
| 863 static void |
901 static void |
| 864 theme_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, |
902 theme_dnd_recv(GtkWidget *widget, GdkDragContext *dc, guint x, guint y, |
| 865 GtkSelectionData *sd, guint info, guint t, gpointer user_data) |
903 GtkSelectionData *sd, guint info, guint t, gpointer user_data) |
| 866 { |
904 { |
| 867 gchar *name = g_strchomp((gchar *)gtk_selection_data_get_data(sd)); |
905 gchar *name = g_strchomp((gchar *)sd->data); |
| 868 |
906 |
| 869 if ((gtk_selection_data_get_length(sd) >= 0) |
907 if ((sd->length >= 0) && (sd->format == 8)) { |
| 870 && (gtk_selection_data_get_format(sd) == 8)) { |
|
| 871 /* Well, it looks like the drag event was cool. |
908 /* Well, it looks like the drag event was cool. |
| 872 * Let's do something with it */ |
909 * Let's do something with it */ |
| 873 gchar *temp; |
910 gchar *temp; |
| 874 struct theme_info *info = g_new0(struct theme_info, 1); |
911 struct theme_info *info = g_new0(struct theme_info, 1); |
| 875 info->type = g_strdup((gchar *)user_data); |
912 info->type = g_strdup((gchar *)user_data); |
| 892 theme_install_theme(tmp, info); |
929 theme_install_theme(tmp, info); |
| 893 g_free(tmp); |
930 g_free(tmp); |
| 894 } else if (!g_ascii_strncasecmp(name, "http://", 7)) { |
931 } else if (!g_ascii_strncasecmp(name, "http://", 7)) { |
| 895 /* Oo, a web drag and drop. This is where things |
932 /* Oo, a web drag and drop. This is where things |
| 896 * will start to get interesting */ |
933 * will start to get interesting */ |
| 897 purple_util_fetch_url(name, TRUE, NULL, FALSE, theme_got_url, info); |
934 purple_util_fetch_url(name, TRUE, NULL, FALSE, -1, theme_got_url, info); |
| 898 } else if (!g_ascii_strncasecmp(name, "https://", 8)) { |
935 } else if (!g_ascii_strncasecmp(name, "https://", 8)) { |
| 899 /* purple_util_fetch_url() doesn't support HTTPS, but we want users |
936 /* purple_util_fetch_url() doesn't support HTTPS, but we want users |
| 900 * to be able to drag and drop links from the SF trackers, so |
937 * to be able to drag and drop links from the SF trackers, so |
| 901 * we'll try it as an HTTP URL. */ |
938 * we'll try it as an HTTP URL. */ |
| 902 char *tmp = g_strdup(name + 1); |
939 char *tmp = g_strdup(name + 1); |
| 903 tmp[0] = 'h'; |
940 tmp[0] = 'h'; |
| 904 tmp[1] = 't'; |
941 tmp[1] = 't'; |
| 905 tmp[2] = 't'; |
942 tmp[2] = 't'; |
| 906 tmp[3] = 'p'; |
943 tmp[3] = 'p'; |
| 907 |
944 |
| 908 purple_util_fetch_url(tmp, TRUE, NULL, FALSE, theme_got_url, info); |
945 purple_util_fetch_url(tmp, TRUE, NULL, FALSE, -1, theme_got_url, info); |
| 909 g_free(tmp); |
946 g_free(tmp); |
| 910 } else |
947 } else |
| 911 free_theme_info(info); |
948 free_theme_info(info); |
| 912 |
949 |
| 913 gtk_drag_finish(dc, TRUE, FALSE, t); |
950 gtk_drag_finish(dc, TRUE, FALSE, t); |
| 1055 |
1092 |
| 1056 pidgin_blist_set_theme(theme); |
1093 pidgin_blist_set_theme(theme); |
| 1057 } |
1094 } |
| 1058 } |
1095 } |
| 1059 |
1096 |
| |
1097 /* sets the current conversation theme */ |
| |
1098 static void |
| |
1099 prefs_set_conv_theme_cb(GtkComboBox *combo_box, gpointer user_data) |
| |
1100 { |
| |
1101 PidginConvTheme *theme = NULL; |
| |
1102 GtkTreeIter iter; |
| |
1103 gchar *name = NULL; |
| |
1104 |
| |
1105 if (gtk_combo_box_get_active_iter(combo_box, &iter)) { |
| |
1106 const GList *variants; |
| |
1107 const char *current_variant; |
| |
1108 gboolean unset = TRUE; |
| |
1109 |
| |
1110 gtk_tree_model_get(GTK_TREE_MODEL(prefs_conv_themes), &iter, 2, &name, -1); |
| |
1111 if (!name || !*name) { |
| |
1112 g_free(name); |
| |
1113 return; |
| |
1114 } |
| |
1115 |
| |
1116 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/theme", name); |
| |
1117 |
| |
1118 /* Update list of variants */ |
| |
1119 gtk_list_store_clear(prefs_conv_variants); |
| |
1120 |
| |
1121 theme = PIDGIN_CONV_THEME(purple_theme_manager_find_theme(name, "conversation")); |
| |
1122 current_variant = pidgin_conversation_theme_get_variant(theme); |
| |
1123 |
| |
1124 variants = pidgin_conversation_theme_get_variants(theme); |
| |
1125 for (; variants && current_variant; variants = g_list_next(variants)) { |
| |
1126 gtk_list_store_append(prefs_conv_variants, &iter); |
| |
1127 gtk_list_store_set(prefs_conv_variants, &iter, 0, variants->data, -1); |
| |
1128 |
| |
1129 if (g_str_equal(variants->data, current_variant)) { |
| |
1130 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(prefs_conv_variants_combo_box), &iter); |
| |
1131 unset = FALSE; |
| |
1132 } |
| |
1133 } |
| |
1134 |
| |
1135 if (unset) |
| |
1136 gtk_combo_box_set_active(GTK_COMBO_BOX(prefs_conv_variants_combo_box), 0); |
| |
1137 |
| |
1138 g_free(name); |
| |
1139 } |
| |
1140 } |
| |
1141 |
| |
1142 /* sets the current conversation theme variant */ |
| |
1143 static void |
| |
1144 prefs_set_conv_variant_cb(GtkComboBox *combo_box, gpointer user_data) |
| |
1145 { |
| |
1146 PidginConvTheme *theme = NULL; |
| |
1147 GtkTreeIter iter; |
| |
1148 gchar *name = NULL; |
| |
1149 |
| |
1150 if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(prefs_conv_themes_combo_box), &iter)) { |
| |
1151 gtk_tree_model_get(GTK_TREE_MODEL(prefs_conv_themes), &iter, 2, &name, -1); |
| |
1152 theme = PIDGIN_CONV_THEME(purple_theme_manager_find_theme(name, "conversation")); |
| |
1153 g_free(name); |
| |
1154 |
| |
1155 if (gtk_combo_box_get_active_iter(combo_box, &iter)) { |
| |
1156 gtk_tree_model_get(GTK_TREE_MODEL(prefs_conv_variants), &iter, 0, &name, -1); |
| |
1157 pidgin_conversation_theme_set_variant(theme, name); |
| |
1158 g_free(name); |
| |
1159 } |
| |
1160 } |
| |
1161 } |
| |
1162 |
| 1060 /* sets the current icon theme */ |
1163 /* sets the current icon theme */ |
| 1061 static void |
1164 static void |
| 1062 prefs_set_status_icon_theme_cb(GtkComboBox *combo_box, gpointer user_data) |
1165 prefs_set_status_icon_theme_cb(GtkComboBox *combo_box, gpointer user_data) |
| 1063 { |
1166 { |
| 1064 PidginStatusIconTheme *theme = NULL; |
1167 PidginStatusIconTheme *theme = NULL; |
| 1108 |
1211 |
| 1109 return combo_box; |
1212 return combo_box; |
| 1110 } |
1213 } |
| 1111 |
1214 |
| 1112 static GtkWidget * |
1215 static GtkWidget * |
| |
1216 add_child_theme_prefs_combo(GtkWidget *vbox, GtkSizeGroup *combo_sg, |
| |
1217 GtkSizeGroup *label_sg, GtkListStore *theme_store, |
| |
1218 GCallback combo_box_cb, gpointer combo_box_cb_user_data, |
| |
1219 const char *label_str) |
| |
1220 { |
| |
1221 GtkWidget *label; |
| |
1222 GtkWidget *combo_box; |
| |
1223 GtkWidget *themesel_hbox; |
| |
1224 GtkCellRenderer *cell_rend; |
| |
1225 |
| |
1226 themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
| |
1227 gtk_box_pack_start(GTK_BOX(vbox), themesel_hbox, FALSE, FALSE, 0); |
| |
1228 |
| |
1229 label = gtk_label_new(label_str); |
| |
1230 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); |
| |
1231 gtk_size_group_add_widget(label_sg, label); |
| |
1232 gtk_box_pack_start(GTK_BOX(themesel_hbox), label, FALSE, FALSE, 0); |
| |
1233 |
| |
1234 combo_box = gtk_combo_box_new_with_model(GTK_TREE_MODEL(theme_store)); |
| |
1235 |
| |
1236 cell_rend = gtk_cell_renderer_text_new(); |
| |
1237 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo_box), cell_rend, TRUE); |
| |
1238 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "text", 0, NULL); |
| |
1239 g_object_set(cell_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL); |
| |
1240 |
| |
1241 g_signal_connect(G_OBJECT(combo_box), "changed", |
| |
1242 (GCallback)combo_box_cb, combo_box_cb_user_data); |
| |
1243 gtk_size_group_add_widget(combo_sg, combo_box); |
| |
1244 gtk_box_pack_start(GTK_BOX(themesel_hbox), combo_box, TRUE, TRUE, 0); |
| |
1245 |
| |
1246 return combo_box; |
| |
1247 } |
| |
1248 |
| |
1249 static GtkWidget * |
| 1113 theme_page(void) |
1250 theme_page(void) |
| 1114 { |
1251 { |
| 1115 GtkWidget *label; |
1252 GtkWidget *label; |
| 1116 GtkWidget *ret, *vbox; |
1253 GtkWidget *ret, *vbox; |
| 1117 GtkSizeGroup *label_sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
1254 GtkSizeGroup *label_sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
| 1136 /* Buddy List Themes */ |
1273 /* Buddy List Themes */ |
| 1137 prefs_blist_themes_combo_box = add_theme_prefs_combo( |
1274 prefs_blist_themes_combo_box = add_theme_prefs_combo( |
| 1138 vbox, combo_sg, label_sg, prefs_blist_themes, |
1275 vbox, combo_sg, label_sg, prefs_blist_themes, |
| 1139 (GCallback)prefs_set_blist_theme_cb, NULL, |
1276 (GCallback)prefs_set_blist_theme_cb, NULL, |
| 1140 _("Buddy List Theme:"), PIDGIN_PREFS_ROOT "/blist/theme", "blist"); |
1277 _("Buddy List Theme:"), PIDGIN_PREFS_ROOT "/blist/theme", "blist"); |
| |
1278 |
| |
1279 /* Conversation Themes */ |
| |
1280 prefs_conv_themes_combo_box = add_theme_prefs_combo( |
| |
1281 vbox, combo_sg, label_sg, prefs_conv_themes, |
| |
1282 (GCallback)prefs_set_conv_theme_cb, NULL, |
| |
1283 _("Conversation Theme:"), PIDGIN_PREFS_ROOT "/conversations/theme", "conversation"); |
| |
1284 |
| |
1285 /* Conversation Theme Variants */ |
| |
1286 prefs_conv_variants_combo_box = add_child_theme_prefs_combo( |
| |
1287 vbox, combo_sg, label_sg, prefs_conv_variants, |
| |
1288 (GCallback)prefs_set_conv_variant_cb, NULL, _("\tVariant:")); |
| |
1289 |
| |
1290 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(prefs_conv_variants), |
| |
1291 0, GTK_SORT_ASCENDING); |
| 1141 |
1292 |
| 1142 /* Status Icon Themes */ |
1293 /* Status Icon Themes */ |
| 1143 prefs_status_themes_combo_box = add_theme_prefs_combo( |
1294 prefs_status_themes_combo_box = add_theme_prefs_combo( |
| 1144 vbox, combo_sg, label_sg, prefs_status_icon_themes, |
1295 vbox, combo_sg, label_sg, prefs_status_icon_themes, |
| 1145 (GCallback)prefs_set_status_icon_theme_cb, NULL, |
1296 (GCallback)prefs_set_status_icon_theme_cb, NULL, |
| 2072 gtk_container_add(GTK_CONTAINER(vbox), hbox); |
2223 gtk_container_add(GTK_CONTAINER(vbox), hbox); |
| 2073 |
2224 |
| 2074 path = g_find_program_in_path("gnome-network-properties"); |
2225 path = g_find_program_in_path("gnome-network-properties"); |
| 2075 if (path == NULL) |
2226 if (path == NULL) |
| 2076 path = g_find_program_in_path("gnome-network-preferences"); |
2227 path = g_find_program_in_path("gnome-network-preferences"); |
| |
2228 if (path == NULL) { |
| |
2229 path = g_find_program_in_path("gnome-control-center"); |
| |
2230 if (path != NULL) { |
| |
2231 char *tmp = g_strdup_printf("%s network", path); |
| |
2232 g_free(path); |
| |
2233 path = tmp; |
| |
2234 } |
| |
2235 } |
| 2077 |
2236 |
| 2078 if (path == NULL) { |
2237 if (path == NULL) { |
| 2079 label = gtk_label_new(NULL); |
2238 label = gtk_label_new(NULL); |
| 2080 gtk_label_set_markup(GTK_LABEL(label), |
2239 gtk_label_set_markup(GTK_LABEL(label), |
| 2081 _("<b>Proxy configuration program was not found.</b>")); |
2240 _("<b>Proxy configuration program was not found.</b>")); |
| 2466 |
2625 |
| 2467 static GtkWidget * |
2626 static GtkWidget * |
| 2468 sound_page(void) |
2627 sound_page(void) |
| 2469 { |
2628 { |
| 2470 GtkWidget *ret; |
2629 GtkWidget *ret; |
| 2471 GtkWidget *vbox, *vbox2, *sw, *button, *parent, *parent_parent, *parent_parent_parent; |
2630 GtkWidget *vbox, *vbox2, *sw, *button; |
| 2472 GtkSizeGroup *sg; |
2631 GtkSizeGroup *sg; |
| 2473 GtkTreeIter iter; |
2632 GtkTreeIter iter; |
| 2474 GtkWidget *event_view; |
2633 GtkWidget *event_view; |
| 2475 GtkListStore *event_store; |
2634 GtkListStore *event_store; |
| 2476 GtkCellRenderer *rend; |
2635 GtkCellRenderer *rend; |
| 2563 strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), "none")); |
2722 strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/sound/method"), "none")); |
| 2564 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
2723 purple_prefs_connect_callback(prefs, PIDGIN_PREFS_ROOT "/sound/method", |
| 2565 sound_changed2_cb, vbox); |
2724 sound_changed2_cb, vbox); |
| 2566 #endif |
2725 #endif |
| 2567 vbox = pidgin_make_frame(ret, _("Sound Events")); |
2726 vbox = pidgin_make_frame(ret, _("Sound Events")); |
| 2568 parent = gtk_widget_get_parent(vbox); |
|
| 2569 parent_parent = gtk_widget_get_parent(parent); |
|
| 2570 parent_parent_parent = gtk_widget_get_parent(parent_parent); |
|
| 2571 |
2727 |
| 2572 /* The following is an ugly hack to make the frame expand so the |
2728 /* The following is an ugly hack to make the frame expand so the |
| 2573 * sound events list is big enough to be usable */ |
2729 * sound events list is big enough to be usable */ |
| 2574 gtk_box_set_child_packing(GTK_BOX(parent), vbox, TRUE, TRUE, 0, |
2730 gtk_box_set_child_packing(GTK_BOX(vbox->parent), vbox, TRUE, TRUE, 0, |
| 2575 GTK_PACK_START); |
2731 GTK_PACK_START); |
| 2576 gtk_box_set_child_packing(GTK_BOX(parent_parent), |
2732 gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent), vbox->parent, TRUE, |
| 2577 parent, TRUE, TRUE, 0, GTK_PACK_START); |
2733 TRUE, 0, GTK_PACK_START); |
| 2578 gtk_box_set_child_packing(GTK_BOX(parent_parent_parent), |
2734 gtk_box_set_child_packing(GTK_BOX(vbox->parent->parent->parent), |
| 2579 parent_parent, TRUE, TRUE, 0, GTK_PACK_START); |
2735 vbox->parent->parent, TRUE, TRUE, 0, GTK_PACK_START); |
| 2580 |
2736 |
| 2581 /* SOUND SELECTION */ |
2737 /* SOUND SELECTION */ |
| 2582 event_store = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT); |
2738 event_store = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT); |
| 2583 |
2739 |
| 2584 for (j=0; j < PURPLE_NUM_SOUNDS; j++) { |
2740 for (j=0; j < PURPLE_NUM_SOUNDS; j++) { |
| 2905 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_icon_folder", ""); |
3061 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_icon_folder", ""); |
| 2906 |
3062 |
| 2907 /* Themes */ |
3063 /* Themes */ |
| 2908 prefs_themes_init(); |
3064 prefs_themes_init(); |
| 2909 |
3065 |
| |
3066 /* Conversation Themes */ |
| |
3067 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations"); |
| |
3068 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/theme", "Default"); |
| |
3069 |
| 2910 /* Smiley Themes */ |
3070 /* Smiley Themes */ |
| 2911 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/smileys"); |
3071 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/smileys"); |
| 2912 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/smileys/theme", "Default"); |
3072 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/smileys/theme", "Default"); |
| 2913 |
3073 |
| 2914 /* Smiley Callbacks */ |
3074 /* Smiley Callbacks */ |
| 2927 purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_ims", "/purple/logging/log_ims"); |
3087 purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_ims", "/purple/logging/log_ims"); |
| 2928 purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_chats", "/purple/logging/log_chats"); |
3088 purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_chats", "/purple/logging/log_chats"); |
| 2929 purple_prefs_rename("/purple/conversations/placement", |
3089 purple_prefs_rename("/purple/conversations/placement", |
| 2930 PIDGIN_PREFS_ROOT "/conversations/placement"); |
3090 PIDGIN_PREFS_ROOT "/conversations/placement"); |
| 2931 |
3091 |
| 2932 purple_prefs_rename(PIDGIN_PREFS_ROOT "/debug/timestamps", "/purple/debug/timestamps"); |
|
| 2933 purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/im/raise_on_events", "/plugins/gtk/X11/notify/method_raise"); |
3092 purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/im/raise_on_events", "/plugins/gtk/X11/notify/method_raise"); |
| 2934 |
3093 |
| 2935 purple_prefs_rename_boolean_toggle(PIDGIN_PREFS_ROOT "/conversations/ignore_colors", |
3094 purple_prefs_rename_boolean_toggle(PIDGIN_PREFS_ROOT "/conversations/ignore_colors", |
| 2936 PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting"); |
3095 PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting"); |
| 2937 |
3096 |
| 2973 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/color_nicks"); |
3132 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/color_nicks"); |
| 2974 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/raise_on_events"); |
3133 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/raise_on_events"); |
| 2975 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ignore_fonts"); |
3134 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ignore_fonts"); |
| 2976 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ignore_font_sizes"); |
3135 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ignore_font_sizes"); |
| 2977 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/passthrough_unknown_commands"); |
3136 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/passthrough_unknown_commands"); |
| |
3137 purple_prefs_remove(PIDGIN_PREFS_ROOT "/debug/timestamps"); |
| 2978 purple_prefs_remove(PIDGIN_PREFS_ROOT "/idle"); |
3138 purple_prefs_remove(PIDGIN_PREFS_ROOT "/idle"); |
| 2979 purple_prefs_remove(PIDGIN_PREFS_ROOT "/logging/individual_logs"); |
3139 purple_prefs_remove(PIDGIN_PREFS_ROOT "/logging/individual_logs"); |
| 2980 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/signon"); |
3140 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/signon"); |
| 2981 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/silent_signon"); |
3141 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/silent_signon"); |
| 2982 |
3142 |