Mercurial > pidgin
comparison pidgin/gtkprefs.c @ 32743:8404c5b75e99
propagate from branch 'im.pidgin.pidgin.2.x.y' (head 09d2e29b6ff4dcc675099f74645ca2eb119ad6b5)
to branch 'im.pidgin.pidgin' (head 607e111e6c0089eb2b27a1046427c3688ee4424b)
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 10 Mar 2012 05:27:17 +0000 |
parents | fd4a16fdb7ae 2efee7ca90be |
children | fb8263d936e5 |
comparison
equal
deleted
inserted
replaced
32742:4a8f81812ba3 | 32743:8404c5b75e99 |
---|---|
43 #include "util.h" | 43 #include "util.h" |
44 #include "network.h" | 44 #include "network.h" |
45 | 45 |
46 #include "gtkblist.h" | 46 #include "gtkblist.h" |
47 #include "gtkconv.h" | 47 #include "gtkconv.h" |
48 #include "gtkconv-theme.h" | |
48 #include "gtkdebug.h" | 49 #include "gtkdebug.h" |
49 #include "gtkdialogs.h" | 50 #include "gtkdialogs.h" |
50 #include "gtkimhtml.h" | |
51 #include "gtkimhtmltoolbar.h" | |
52 #include "gtkprefs.h" | 51 #include "gtkprefs.h" |
53 #include "gtksavedstatuses.h" | 52 #include "gtksavedstatuses.h" |
54 #include "gtksound.h" | 53 #include "gtksound.h" |
55 #include "gtkstatus-icon-theme.h" | 54 #include "gtkstatus-icon-theme.h" |
56 #include "gtkthemes.h" | 55 #include "gtkthemes.h" |
57 #include "gtkutils.h" | 56 #include "gtkutils.h" |
57 #include "gtkwebview.h" | |
58 #include "gtkwebviewtoolbar.h" | |
58 #include "pidginstock.h" | 59 #include "pidginstock.h" |
59 | 60 |
60 #define PROXYHOST 0 | 61 #define PROXYHOST 0 |
61 #define PROXYPORT 1 | 62 #define PROXYPORT 1 |
62 #define PROXYUSER 2 | 63 #define PROXYUSER 2 |
76 /* Notebook */ | 77 /* Notebook */ |
77 static GtkWidget *prefsnotebook = NULL; | 78 static GtkWidget *prefsnotebook = NULL; |
78 static int notebook_page = 0; | 79 static int notebook_page = 0; |
79 | 80 |
80 /* Conversations page */ | 81 /* Conversations page */ |
81 static GtkWidget *sample_imhtml = NULL; | 82 static GtkWidget *sample_webview = 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 |
180 gtk_widget_show(entry); | 185 gtk_widget_show(entry); |
181 | 186 |
182 return pidgin_add_widget_to_vbox(GTK_BOX(page), title, sg, entry, TRUE, NULL); | 187 return pidgin_add_widget_to_vbox(GTK_BOX(page), title, sg, entry, TRUE, NULL); |
183 } | 188 } |
184 | 189 |
190 /* TODO: Maybe move this up somewheres... */ | |
191 enum { | |
192 PREF_DROPDOWN_TEXT, | |
193 PREF_DROPDOWN_VALUE, | |
194 PREF_DROPDOWN_COUNT | |
195 }; | |
185 | 196 |
186 static void | 197 static void |
187 dropdown_set(GObject *w, const char *key) | 198 dropdown_set(GObject *w, const char *key) |
188 { | 199 { |
189 const char *str_value; | 200 const char *str_value; |
190 int int_value; | 201 int int_value; |
202 gboolean bool_value; | |
191 PurplePrefType type; | 203 PurplePrefType type; |
204 GtkTreeIter iter; | |
205 GtkTreeModel *tree_model; | |
206 | |
207 tree_model = gtk_combo_box_get_model(GTK_COMBO_BOX(w)); | |
208 if (!gtk_combo_box_get_active_iter(GTK_COMBO_BOX(w), &iter)) | |
209 return; | |
192 | 210 |
193 type = GPOINTER_TO_INT(g_object_get_data(w, "type")); | 211 type = GPOINTER_TO_INT(g_object_get_data(w, "type")); |
194 | 212 |
195 if (type == PURPLE_PREF_INT) { | 213 if (type == PURPLE_PREF_INT) { |
196 int_value = GPOINTER_TO_INT(g_object_get_data(w, "value")); | 214 gtk_tree_model_get(tree_model, &iter, |
215 PREF_DROPDOWN_VALUE, &int_value, | |
216 -1); | |
197 | 217 |
198 purple_prefs_set_int(key, int_value); | 218 purple_prefs_set_int(key, int_value); |
199 } | 219 } |
200 else if (type == PURPLE_PREF_STRING) { | 220 else if (type == PURPLE_PREF_STRING) { |
201 str_value = (const char *)g_object_get_data(w, "value"); | 221 gtk_tree_model_get(tree_model, &iter, |
222 PREF_DROPDOWN_VALUE, &str_value, | |
223 -1); | |
202 | 224 |
203 purple_prefs_set_string(key, str_value); | 225 purple_prefs_set_string(key, str_value); |
204 } | 226 } |
205 else if (type == PURPLE_PREF_BOOLEAN) { | 227 else if (type == PURPLE_PREF_BOOLEAN) { |
206 purple_prefs_set_bool(key, | 228 gtk_tree_model_get(tree_model, &iter, |
207 GPOINTER_TO_INT(g_object_get_data(w, "value"))); | 229 PREF_DROPDOWN_VALUE, &bool_value, |
230 -1); | |
231 | |
232 purple_prefs_set_bool(key, bool_value); | |
208 } | 233 } |
209 } | 234 } |
210 | 235 |
211 GtkWidget * | 236 GtkWidget * |
212 pidgin_prefs_dropdown_from_list(GtkWidget *box, const gchar *title, | 237 pidgin_prefs_dropdown_from_list(GtkWidget *box, const gchar *title, |
213 PurplePrefType type, const char *key, GList *menuitems) | 238 PurplePrefType type, const char *key, GList *menuitems) |
214 { | 239 { |
215 GtkWidget *dropdown, *opt, *menu; | 240 GtkWidget *dropdown; |
216 GtkWidget *label = NULL; | 241 GtkWidget *label = NULL; |
217 gchar *text; | 242 gchar *text; |
218 const char *stored_str = NULL; | 243 const char *stored_str = NULL; |
219 int stored_int = 0; | 244 int stored_int = 0; |
245 gboolean stored_bool = FALSE; | |
220 int int_value = 0; | 246 int int_value = 0; |
221 const char *str_value = NULL; | 247 const char *str_value = NULL; |
222 int o = 0; | 248 gboolean bool_value = FALSE; |
249 GtkListStore *store = NULL; | |
250 GtkTreeIter iter; | |
251 GtkTreeIter active; | |
252 GtkCellRenderer *renderer; | |
223 | 253 |
224 g_return_val_if_fail(menuitems != NULL, NULL); | 254 g_return_val_if_fail(menuitems != NULL, NULL); |
225 | 255 |
226 dropdown = gtk_option_menu_new(); | 256 if (type == PURPLE_PREF_INT) { |
227 menu = gtk_menu_new(); | 257 store = gtk_list_store_new(PREF_DROPDOWN_COUNT, G_TYPE_STRING, G_TYPE_INT); |
228 | |
229 if (type == PURPLE_PREF_INT) | |
230 stored_int = purple_prefs_get_int(key); | 258 stored_int = purple_prefs_get_int(key); |
231 else if (type == PURPLE_PREF_STRING) | 259 } else if (type == PURPLE_PREF_STRING) { |
260 store = gtk_list_store_new(PREF_DROPDOWN_COUNT, G_TYPE_STRING, G_TYPE_STRING); | |
232 stored_str = purple_prefs_get_string(key); | 261 stored_str = purple_prefs_get_string(key); |
233 | 262 } else if (type == PURPLE_PREF_BOOLEAN) { |
234 while (menuitems != NULL && (text = (char *) menuitems->data) != NULL) { | 263 store = gtk_list_store_new(PREF_DROPDOWN_COUNT, G_TYPE_STRING, G_TYPE_BOOLEAN); |
264 stored_bool = purple_prefs_get_bool(key); | |
265 } else { | |
266 g_warn_if_reached(); | |
267 return NULL; | |
268 } | |
269 | |
270 dropdown = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store)); | |
271 g_object_set_data(G_OBJECT(dropdown), "type", GINT_TO_POINTER(type)); | |
272 | |
273 while (menuitems != NULL && (text = (char *)menuitems->data) != NULL) { | |
235 menuitems = g_list_next(menuitems); | 274 menuitems = g_list_next(menuitems); |
236 g_return_val_if_fail(menuitems != NULL, NULL); | 275 g_return_val_if_fail(menuitems != NULL, NULL); |
237 | 276 |
238 opt = gtk_menu_item_new_with_label(text); | 277 gtk_list_store_append(store, &iter); |
239 | 278 gtk_list_store_set(store, &iter, |
240 g_object_set_data(G_OBJECT(opt), "type", GINT_TO_POINTER(type)); | 279 PREF_DROPDOWN_TEXT, text, |
280 -1); | |
241 | 281 |
242 if (type == PURPLE_PREF_INT) { | 282 if (type == PURPLE_PREF_INT) { |
243 int_value = GPOINTER_TO_INT(menuitems->data); | 283 int_value = GPOINTER_TO_INT(menuitems->data); |
244 g_object_set_data(G_OBJECT(opt), "value", | 284 gtk_list_store_set(store, &iter, |
245 GINT_TO_POINTER(int_value)); | 285 PREF_DROPDOWN_VALUE, int_value, |
286 -1); | |
246 } | 287 } |
247 else if (type == PURPLE_PREF_STRING) { | 288 else if (type == PURPLE_PREF_STRING) { |
248 str_value = (const char *)menuitems->data; | 289 str_value = (const char *)menuitems->data; |
249 | 290 gtk_list_store_set(store, &iter, |
250 g_object_set_data(G_OBJECT(opt), "value", (char *)str_value); | 291 PREF_DROPDOWN_VALUE, str_value, |
292 -1); | |
251 } | 293 } |
252 else if (type == PURPLE_PREF_BOOLEAN) { | 294 else if (type == PURPLE_PREF_BOOLEAN) { |
253 g_object_set_data(G_OBJECT(opt), "value", | 295 bool_value = (gboolean)GPOINTER_TO_INT(menuitems->data); |
254 menuitems->data); | 296 gtk_list_store_set(store, &iter, |
297 PREF_DROPDOWN_VALUE, bool_value, | |
298 -1); | |
255 } | 299 } |
256 | |
257 g_signal_connect(G_OBJECT(opt), "activate", | |
258 G_CALLBACK(dropdown_set), (char *)key); | |
259 | |
260 gtk_widget_show(opt); | |
261 gtk_menu_shell_append(GTK_MENU_SHELL(menu), opt); | |
262 | 300 |
263 if ((type == PURPLE_PREF_INT && stored_int == int_value) || | 301 if ((type == PURPLE_PREF_INT && stored_int == int_value) || |
264 (type == PURPLE_PREF_STRING && stored_str != NULL && | 302 (type == PURPLE_PREF_STRING && stored_str != NULL && |
265 !strcmp(stored_str, str_value)) || | 303 !strcmp(stored_str, str_value)) || |
266 (type == PURPLE_PREF_BOOLEAN && | 304 (type == PURPLE_PREF_BOOLEAN && |
267 (purple_prefs_get_bool(key) == GPOINTER_TO_INT(menuitems->data)))) { | 305 (stored_bool == bool_value))) { |
268 | 306 |
269 gtk_menu_set_active(GTK_MENU(menu), o); | 307 active = iter; |
270 } | 308 } |
271 | 309 |
272 menuitems = g_list_next(menuitems); | 310 menuitems = g_list_next(menuitems); |
273 | 311 } |
274 o++; | 312 |
275 } | 313 renderer = gtk_cell_renderer_text_new(); |
276 | 314 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(dropdown), renderer, TRUE); |
277 gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu); | 315 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(dropdown), renderer, |
316 "text", 0, | |
317 NULL); | |
318 | |
319 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(dropdown), &active); | |
320 | |
321 g_signal_connect(G_OBJECT(dropdown), "changed", | |
322 G_CALLBACK(dropdown_set), (char *)key); | |
278 | 323 |
279 pidgin_add_widget_to_vbox(GTK_BOX(box), title, NULL, dropdown, FALSE, &label); | 324 pidgin_add_widget_to_vbox(GTK_BOX(box), title, NULL, dropdown, FALSE, &label); |
280 | 325 |
281 return label; | 326 return label; |
282 } | 327 } |
337 sound_row_sel = 0; | 382 sound_row_sel = 0; |
338 prefs_sound_themes_loading = FALSE; | 383 prefs_sound_themes_loading = FALSE; |
339 | 384 |
340 prefs_sound_themes_combo_box = NULL; | 385 prefs_sound_themes_combo_box = NULL; |
341 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; | |
342 prefs_status_themes_combo_box = NULL; | 389 prefs_status_themes_combo_box = NULL; |
343 prefs_smiley_themes_combo_box = NULL; | 390 prefs_smiley_themes_combo_box = NULL; |
344 | 391 |
345 sample_imhtml = NULL; | 392 sample_webview = NULL; |
346 | 393 |
347 notebook_page = 0; | 394 notebook_page = 0; |
348 prefsnotebook = NULL; | 395 prefsnotebook = NULL; |
349 prefs = NULL; | 396 prefs = NULL; |
350 } | 397 } |
488 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); |
489 | 536 |
490 g_free(markup); | 537 g_free(markup); |
491 if (pixbuf != NULL) | 538 if (pixbuf != NULL) |
492 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); | |
493 } | 552 } |
494 } | 553 } |
495 | 554 |
496 static void | 555 static void |
497 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) |
542 gtk_list_store_append(prefs_blist_themes, &iter); | 601 gtk_list_store_append(prefs_blist_themes, &iter); |
543 tmp = get_theme_markup(_("Default"), FALSE, _("Penguin Pimps"), | 602 tmp = get_theme_markup(_("Default"), FALSE, _("Penguin Pimps"), |
544 _("The default Pidgin buddy list theme")); | 603 _("The default Pidgin buddy list theme")); |
545 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); |
546 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); | |
547 | 617 |
548 /* status icon themes */ | 618 /* status icon themes */ |
549 gtk_list_store_clear(prefs_status_icon_themes); | 619 gtk_list_store_clear(prefs_status_icon_themes); |
550 gtk_list_store_append(prefs_status_icon_themes, &iter); | 620 gtk_list_store_append(prefs_status_icon_themes, &iter); |
551 tmp = get_theme_markup(_("Default"), FALSE, _("Penguin Pimps"), | 621 tmp = get_theme_markup(_("Default"), FALSE, _("Penguin Pimps"), |
563 smileys_refresh_theme_list(); | 633 smileys_refresh_theme_list(); |
564 | 634 |
565 /* set active */ | 635 /* set active */ |
566 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")); |
567 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")); | |
568 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")); |
569 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")); |
570 prefs_sound_themes_loading = FALSE; | 641 prefs_sound_themes_loading = FALSE; |
571 } | 642 } |
572 | 643 |
575 prefs_themes_init(void) | 646 prefs_themes_init(void) |
576 { | 647 { |
577 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); |
578 | 649 |
579 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); | |
580 | 655 |
581 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); |
582 | 657 |
583 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); |
584 } | 659 } |
854 theme_install_theme(tmp, info); | 929 theme_install_theme(tmp, info); |
855 g_free(tmp); | 930 g_free(tmp); |
856 } else if (!g_ascii_strncasecmp(name, "http://", 7)) { | 931 } else if (!g_ascii_strncasecmp(name, "http://", 7)) { |
857 /* Oo, a web drag and drop. This is where things | 932 /* Oo, a web drag and drop. This is where things |
858 * will start to get interesting */ | 933 * will start to get interesting */ |
859 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); |
860 } else if (!g_ascii_strncasecmp(name, "https://", 8)) { | 935 } else if (!g_ascii_strncasecmp(name, "https://", 8)) { |
861 /* 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 |
862 * 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 |
863 * we'll try it as an HTTP URL. */ | 938 * we'll try it as an HTTP URL. */ |
864 char *tmp = g_strdup(name + 1); | 939 char *tmp = g_strdup(name + 1); |
865 tmp[0] = 'h'; | 940 tmp[0] = 'h'; |
866 tmp[1] = 't'; | 941 tmp[1] = 't'; |
867 tmp[2] = 't'; | 942 tmp[2] = 't'; |
868 tmp[3] = 'p'; | 943 tmp[3] = 'p'; |
869 | 944 |
870 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); |
871 g_free(tmp); | 946 g_free(tmp); |
872 } else | 947 } else |
873 free_theme_info(info); | 948 free_theme_info(info); |
874 | 949 |
875 gtk_drag_finish(dc, TRUE, FALSE, t); | 950 gtk_drag_finish(dc, TRUE, FALSE, t); |
954 if (gtk_combo_box_get_active_iter(combo_box, &new_iter)) { | 1029 if (gtk_combo_box_get_active_iter(combo_box, &new_iter)) { |
955 | 1030 |
956 gtk_tree_model_get(GTK_TREE_MODEL(prefs_smiley_themes), &new_iter, 2, &new_theme, -1); | 1031 gtk_tree_model_get(GTK_TREE_MODEL(prefs_smiley_themes), &new_iter, 2, &new_theme, -1); |
957 | 1032 |
958 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/smileys/theme", new_theme); | 1033 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/smileys/theme", new_theme); |
959 pidgin_themes_smiley_themeize(sample_imhtml); | 1034 #if 0 |
1035 /* TODO: WebKit-ify smileys */ | |
1036 pidgin_themes_smiley_themeize(sample_webview); | |
1037 #endif | |
960 | 1038 |
961 g_free(new_theme); | 1039 g_free(new_theme); |
962 } | 1040 } |
963 } | 1041 } |
964 | 1042 |
1017 | 1095 |
1018 pidgin_blist_set_theme(theme); | 1096 pidgin_blist_set_theme(theme); |
1019 } | 1097 } |
1020 } | 1098 } |
1021 | 1099 |
1100 /* sets the current conversation theme variant */ | |
1101 static void | |
1102 prefs_set_conv_variant_cb(GtkComboBox *combo_box, gpointer user_data) | |
1103 { | |
1104 PidginConvTheme *theme = NULL; | |
1105 GtkTreeIter iter; | |
1106 gchar *name = NULL; | |
1107 | |
1108 if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(prefs_conv_themes_combo_box), &iter)) { | |
1109 gtk_tree_model_get(GTK_TREE_MODEL(prefs_conv_themes), &iter, 2, &name, -1); | |
1110 theme = PIDGIN_CONV_THEME(purple_theme_manager_find_theme(name, "conversation")); | |
1111 g_free(name); | |
1112 | |
1113 if (gtk_combo_box_get_active_iter(combo_box, &iter)) { | |
1114 gtk_tree_model_get(GTK_TREE_MODEL(prefs_conv_variants), &iter, 0, &name, -1); | |
1115 pidgin_conversation_theme_set_variant(theme, name); | |
1116 g_free(name); | |
1117 } | |
1118 } | |
1119 } | |
1120 | |
1121 /* sets the current conversation theme */ | |
1122 static void | |
1123 prefs_set_conv_theme_cb(GtkComboBox *combo_box, gpointer user_data) | |
1124 { | |
1125 GtkTreeIter iter; | |
1126 | |
1127 if (gtk_combo_box_get_active_iter(combo_box, &iter)) { | |
1128 gchar *name = NULL; | |
1129 | |
1130 gtk_tree_model_get(GTK_TREE_MODEL(prefs_conv_themes), &iter, 2, &name, -1); | |
1131 | |
1132 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/theme", name); | |
1133 | |
1134 g_signal_handlers_block_by_func(prefs_conv_variants_combo_box, | |
1135 prefs_set_conv_variant_cb, NULL); | |
1136 | |
1137 /* Update list of variants */ | |
1138 gtk_list_store_clear(prefs_conv_variants); | |
1139 | |
1140 if (name && *name) { | |
1141 PidginConvTheme *theme; | |
1142 const char *current_variant; | |
1143 const GList *variants; | |
1144 gboolean unset = TRUE; | |
1145 | |
1146 theme = PIDGIN_CONV_THEME(purple_theme_manager_find_theme(name, "conversation")); | |
1147 current_variant = pidgin_conversation_theme_get_variant(theme); | |
1148 | |
1149 variants = pidgin_conversation_theme_get_variants(theme); | |
1150 for (; variants && current_variant; variants = g_list_next(variants)) { | |
1151 gtk_list_store_append(prefs_conv_variants, &iter); | |
1152 gtk_list_store_set(prefs_conv_variants, &iter, 0, variants->data, -1); | |
1153 | |
1154 if (g_str_equal(variants->data, current_variant)) { | |
1155 gtk_combo_box_set_active_iter(GTK_COMBO_BOX(prefs_conv_variants_combo_box), &iter); | |
1156 unset = FALSE; | |
1157 } | |
1158 } | |
1159 | |
1160 if (unset) | |
1161 gtk_combo_box_set_active(GTK_COMBO_BOX(prefs_conv_variants_combo_box), 0); | |
1162 } | |
1163 | |
1164 g_signal_handlers_unblock_by_func(prefs_conv_variants_combo_box, | |
1165 prefs_set_conv_variant_cb, NULL); | |
1166 g_free(name); | |
1167 } | |
1168 } | |
1169 | |
1022 /* sets the current icon theme */ | 1170 /* sets the current icon theme */ |
1023 static void | 1171 static void |
1024 prefs_set_status_icon_theme_cb(GtkComboBox *combo_box, gpointer user_data) | 1172 prefs_set_status_icon_theme_cb(GtkComboBox *combo_box, gpointer user_data) |
1025 { | 1173 { |
1026 PidginStatusIconTheme *theme = NULL; | 1174 PidginStatusIconTheme *theme = NULL; |
1070 | 1218 |
1071 return combo_box; | 1219 return combo_box; |
1072 } | 1220 } |
1073 | 1221 |
1074 static GtkWidget * | 1222 static GtkWidget * |
1223 add_child_theme_prefs_combo(GtkWidget *vbox, GtkSizeGroup *combo_sg, | |
1224 GtkSizeGroup *label_sg, GtkListStore *theme_store, | |
1225 GCallback combo_box_cb, gpointer combo_box_cb_user_data, | |
1226 const char *label_str) | |
1227 { | |
1228 GtkWidget *label; | |
1229 GtkWidget *combo_box; | |
1230 GtkWidget *themesel_hbox; | |
1231 GtkCellRenderer *cell_rend; | |
1232 | |
1233 themesel_hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); | |
1234 gtk_box_pack_start(GTK_BOX(vbox), themesel_hbox, FALSE, FALSE, 0); | |
1235 | |
1236 label = gtk_label_new(label_str); | |
1237 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); | |
1238 gtk_size_group_add_widget(label_sg, label); | |
1239 gtk_box_pack_start(GTK_BOX(themesel_hbox), label, FALSE, FALSE, 0); | |
1240 | |
1241 combo_box = gtk_combo_box_new_with_model(GTK_TREE_MODEL(theme_store)); | |
1242 | |
1243 cell_rend = gtk_cell_renderer_text_new(); | |
1244 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo_box), cell_rend, TRUE); | |
1245 gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_box), cell_rend, "text", 0, NULL); | |
1246 g_object_set(cell_rend, "ellipsize", PANGO_ELLIPSIZE_END, NULL); | |
1247 | |
1248 g_signal_connect(G_OBJECT(combo_box), "changed", | |
1249 (GCallback)combo_box_cb, combo_box_cb_user_data); | |
1250 gtk_size_group_add_widget(combo_sg, combo_box); | |
1251 gtk_box_pack_start(GTK_BOX(themesel_hbox), combo_box, TRUE, TRUE, 0); | |
1252 | |
1253 return combo_box; | |
1254 } | |
1255 | |
1256 static GtkWidget * | |
1075 theme_page(void) | 1257 theme_page(void) |
1076 { | 1258 { |
1077 GtkWidget *label; | 1259 GtkWidget *label; |
1078 GtkWidget *ret, *vbox; | 1260 GtkWidget *ret, *vbox; |
1079 GtkSizeGroup *label_sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); | 1261 GtkSizeGroup *label_sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
1099 prefs_blist_themes_combo_box = add_theme_prefs_combo( | 1281 prefs_blist_themes_combo_box = add_theme_prefs_combo( |
1100 vbox, combo_sg, label_sg, prefs_blist_themes, | 1282 vbox, combo_sg, label_sg, prefs_blist_themes, |
1101 (GCallback)prefs_set_blist_theme_cb, NULL, | 1283 (GCallback)prefs_set_blist_theme_cb, NULL, |
1102 _("Buddy List Theme:"), PIDGIN_PREFS_ROOT "/blist/theme", "blist"); | 1284 _("Buddy List Theme:"), PIDGIN_PREFS_ROOT "/blist/theme", "blist"); |
1103 | 1285 |
1286 /* Conversation Themes */ | |
1287 prefs_conv_themes_combo_box = add_theme_prefs_combo( | |
1288 vbox, combo_sg, label_sg, prefs_conv_themes, | |
1289 (GCallback)prefs_set_conv_theme_cb, NULL, | |
1290 _("Conversation Theme:"), PIDGIN_PREFS_ROOT "/conversations/theme", "conversation"); | |
1291 | |
1292 /* Conversation Theme Variants */ | |
1293 prefs_conv_variants_combo_box = add_child_theme_prefs_combo( | |
1294 vbox, combo_sg, label_sg, prefs_conv_variants, | |
1295 (GCallback)prefs_set_conv_variant_cb, NULL, _("\tVariant:")); | |
1296 | |
1297 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(prefs_conv_variants), | |
1298 0, GTK_SORT_ASCENDING); | |
1299 | |
1104 /* Status Icon Themes */ | 1300 /* Status Icon Themes */ |
1105 prefs_status_themes_combo_box = add_theme_prefs_combo( | 1301 prefs_status_themes_combo_box = add_theme_prefs_combo( |
1106 vbox, combo_sg, label_sg, prefs_status_icon_themes, | 1302 vbox, combo_sg, label_sg, prefs_status_icon_themes, |
1107 (GCallback)prefs_set_status_icon_theme_cb, NULL, | 1303 (GCallback)prefs_set_status_icon_theme_cb, NULL, |
1108 _("Status Icon Theme:"), PIDGIN_PREFS_ROOT "/status/icon-theme", "icon"); | 1304 _("Status Icon Theme:"), PIDGIN_PREFS_ROOT "/status/icon-theme", "icon"); |
1129 | 1325 |
1130 return ret; | 1326 return ret; |
1131 } | 1327 } |
1132 | 1328 |
1133 static void | 1329 static void |
1134 formatting_toggle_cb(GtkIMHtml *imhtml, GtkIMHtmlButtons buttons, void *toolbar) | 1330 formatting_toggle_cb(GtkWebView *webview, GtkWebViewButtons buttons, void *toolbar) |
1135 { | 1331 { |
1136 gboolean bold, italic, uline; | 1332 gboolean bold, italic, uline, strike; |
1137 | 1333 |
1138 gtk_imhtml_get_current_format(GTK_IMHTML(imhtml), | 1334 gtk_webview_get_current_format(webview, &bold, &italic, &uline, &strike); |
1139 &bold, &italic, &uline); | 1335 |
1140 | 1336 if (buttons & GTK_WEBVIEW_BOLD) |
1141 if (buttons & GTK_IMHTML_BOLD) | 1337 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", |
1142 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", bold); | 1338 bold); |
1143 if (buttons & GTK_IMHTML_ITALIC) | 1339 if (buttons & GTK_WEBVIEW_ITALIC) |
1144 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", italic); | 1340 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", |
1145 if (buttons & GTK_IMHTML_UNDERLINE) | 1341 italic); |
1146 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", uline); | 1342 if (buttons & GTK_WEBVIEW_UNDERLINE) |
1147 | 1343 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", |
1148 if (buttons & GTK_IMHTML_GROW || buttons & GTK_IMHTML_SHRINK) | 1344 uline); |
1345 if (buttons & GTK_WEBVIEW_STRIKE) | |
1346 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_strike", | |
1347 strike); | |
1348 | |
1349 if (buttons & GTK_WEBVIEW_GROW || buttons & GTK_WEBVIEW_SHRINK) | |
1149 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/font_size", | 1350 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/font_size", |
1150 gtk_imhtml_get_current_fontsize(GTK_IMHTML(imhtml))); | 1351 gtk_webview_get_current_fontsize(webview)); |
1151 if (buttons & GTK_IMHTML_FACE) { | 1352 if (buttons & GTK_WEBVIEW_FACE) { |
1152 char *face = gtk_imhtml_get_current_fontface(GTK_IMHTML(imhtml)); | 1353 char *face = gtk_webview_get_current_fontface(webview); |
1153 if (!face) | 1354 |
1154 face = g_strdup(""); | 1355 if (face) |
1155 | 1356 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", face); |
1156 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", face); | 1357 else |
1358 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", ""); | |
1359 | |
1157 g_free(face); | 1360 g_free(face); |
1158 } | 1361 } |
1159 | 1362 |
1160 if (buttons & GTK_IMHTML_FORECOLOR) { | 1363 if (buttons & GTK_WEBVIEW_FORECOLOR) { |
1161 char *color = gtk_imhtml_get_current_forecolor(GTK_IMHTML(imhtml)); | 1364 char *color = gtk_webview_get_current_forecolor(webview); |
1162 if (!color) | 1365 |
1163 color = g_strdup(""); | 1366 if (color) |
1164 | 1367 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", color); |
1165 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", color); | 1368 else |
1369 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", ""); | |
1370 | |
1166 g_free(color); | 1371 g_free(color); |
1167 } | 1372 } |
1168 | 1373 |
1169 if (buttons & GTK_IMHTML_BACKCOLOR) { | 1374 if (buttons & GTK_WEBVIEW_BACKCOLOR) { |
1170 char *color; | 1375 char *color = gtk_webview_get_current_backcolor(webview); |
1171 GObject *object; | 1376 |
1172 | 1377 if (color) |
1173 color = gtk_imhtml_get_current_backcolor(GTK_IMHTML(imhtml)); | 1378 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", color); |
1174 if (!color) | 1379 else |
1175 color = g_strdup(""); | 1380 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", ""); |
1176 | |
1177 /* Block the signal to prevent a loop. */ | |
1178 object = g_object_ref(G_OBJECT(imhtml)); | |
1179 g_signal_handlers_block_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL, | |
1180 NULL, toolbar); | |
1181 /* Clear the backcolor. */ | |
1182 gtk_imhtml_toggle_backcolor(GTK_IMHTML(imhtml), ""); | |
1183 /* Unblock the signal. */ | |
1184 g_signal_handlers_unblock_matched(object, G_SIGNAL_MATCH_DATA, 0, 0, NULL, | |
1185 NULL, toolbar); | |
1186 g_object_unref(object); | |
1187 | |
1188 /* This will fire a toggle signal and get saved below. */ | |
1189 gtk_imhtml_toggle_background(GTK_IMHTML(imhtml), color); | |
1190 | 1381 |
1191 g_free(color); | 1382 g_free(color); |
1192 } | 1383 } |
1193 | 1384 } |
1194 if (buttons & GTK_IMHTML_BACKGROUND) { | 1385 |
1195 char *color = gtk_imhtml_get_current_background(GTK_IMHTML(imhtml)); | 1386 static void |
1196 if (!color) | 1387 formatting_clear_cb(GtkWebView *webview, void *data) |
1197 color = g_strdup(""); | |
1198 | |
1199 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/bgcolor", color); | |
1200 g_free(color); | |
1201 } | |
1202 } | |
1203 | |
1204 static void | |
1205 formatting_clear_cb(GtkIMHtml *imhtml, void *data) | |
1206 { | 1388 { |
1207 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", FALSE); | 1389 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_bold", FALSE); |
1208 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", FALSE); | 1390 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_italic", FALSE); |
1209 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", FALSE); | 1391 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_underline", FALSE); |
1392 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/conversations/send_strike", FALSE); | |
1210 | 1393 |
1211 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/font_size", 3); | 1394 purple_prefs_set_int(PIDGIN_PREFS_ROOT "/conversations/font_size", 3); |
1212 | 1395 |
1213 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", ""); | 1396 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/font_face", ""); |
1214 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", ""); | 1397 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/conversations/fgcolor", ""); |
1420 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font")) { | 1603 if (!purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/use_theme_font")) { |
1421 const char *font = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font"); | 1604 const char *font = purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/custom_font"); |
1422 desc = pango_font_description_from_string(font); | 1605 desc = pango_font_description_from_string(font); |
1423 } | 1606 } |
1424 | 1607 |
1425 gtk_widget_modify_font(sample_imhtml, desc); | 1608 gtk_widget_modify_font(sample_webview, desc); |
1426 if (desc) | 1609 if (desc) |
1427 pango_font_description_free(desc); | 1610 pango_font_description_free(desc); |
1428 | 1611 |
1429 } | 1612 } |
1430 static void | 1613 static void |
1444 GtkWidget *ret; | 1627 GtkWidget *ret; |
1445 GtkWidget *vbox; | 1628 GtkWidget *vbox; |
1446 GtkWidget *toolbar; | 1629 GtkWidget *toolbar; |
1447 GtkWidget *iconpref1; | 1630 GtkWidget *iconpref1; |
1448 GtkWidget *iconpref2; | 1631 GtkWidget *iconpref2; |
1449 GtkWidget *imhtml; | 1632 GtkWidget *webview; |
1450 GtkWidget *frame; | 1633 GtkWidget *frame; |
1451 GtkWidget *hbox; | 1634 GtkWidget *hbox; |
1452 GtkWidget *checkbox; | 1635 GtkWidget *checkbox; |
1453 GtkWidget *spin_button; | 1636 GtkWidget *spin_button; |
1454 | 1637 |
1534 } | 1717 } |
1535 #endif | 1718 #endif |
1536 | 1719 |
1537 vbox = pidgin_make_frame(ret, _("Default Formatting")); | 1720 vbox = pidgin_make_frame(ret, _("Default Formatting")); |
1538 | 1721 |
1539 frame = pidgin_create_imhtml(TRUE, &imhtml, &toolbar, NULL); | 1722 frame = pidgin_create_webview(TRUE, &webview, &toolbar, NULL); |
1540 gtk_widget_show(frame); | 1723 gtk_widget_show(frame); |
1541 gtk_widget_set_name(imhtml, "pidgin_prefs_font_imhtml"); | 1724 gtk_widget_set_name(webview, "pidgin_prefs_font_webview"); |
1542 gtk_widget_set_size_request(frame, 450, -1); | 1725 gtk_widget_set_size_request(frame, 450, -1); |
1543 gtk_imhtml_set_whole_buffer_formatting_only(GTK_IMHTML(imhtml), TRUE); | 1726 gtk_webview_set_whole_buffer_formatting_only(GTK_WEBVIEW(webview), TRUE); |
1544 gtk_imhtml_set_format_functions(GTK_IMHTML(imhtml), | 1727 gtk_webview_set_format_functions(GTK_WEBVIEW(webview), |
1545 GTK_IMHTML_BOLD | | 1728 GTK_WEBVIEW_BOLD | |
1546 GTK_IMHTML_ITALIC | | 1729 GTK_WEBVIEW_ITALIC | |
1547 GTK_IMHTML_UNDERLINE | | 1730 GTK_WEBVIEW_UNDERLINE | |
1548 GTK_IMHTML_GROW | | 1731 GTK_WEBVIEW_STRIKE | |
1549 GTK_IMHTML_SHRINK | | 1732 GTK_WEBVIEW_GROW | |
1550 GTK_IMHTML_FACE | | 1733 GTK_WEBVIEW_SHRINK | |
1551 GTK_IMHTML_FORECOLOR | | 1734 GTK_WEBVIEW_FACE | |
1552 GTK_IMHTML_BACKCOLOR | | 1735 GTK_WEBVIEW_FORECOLOR | |
1553 GTK_IMHTML_BACKGROUND); | 1736 GTK_WEBVIEW_BACKCOLOR); |
1554 | 1737 |
1555 gtk_imhtml_append_text(GTK_IMHTML(imhtml), _("This is how your outgoing message text will appear when you use protocols that support formatting."), 0); | 1738 gtk_webview_append_html(GTK_WEBVIEW(webview), |
1739 _("This is how your outgoing message text will " | |
1740 "appear when you use protocols that support " | |
1741 "formatting.")); | |
1556 | 1742 |
1557 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); | 1743 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); |
1558 | 1744 |
1559 gtk_imhtml_setup_entry(GTK_IMHTML(imhtml), PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_FORMATTING_WBFO); | 1745 gtk_webview_setup_entry(GTK_WEBVIEW(webview), |
1560 | 1746 PURPLE_CONNECTION_HTML | |
1561 g_signal_connect_after(G_OBJECT(imhtml), "format_function_toggle", | 1747 PURPLE_CONNECTION_FORMATTING_WBFO); |
1562 G_CALLBACK(formatting_toggle_cb), toolbar); | 1748 |
1563 g_signal_connect_after(G_OBJECT(imhtml), "format_function_clear", | 1749 g_signal_connect_after(G_OBJECT(webview), "format-toggled", |
1564 G_CALLBACK(formatting_clear_cb), NULL); | 1750 G_CALLBACK(formatting_toggle_cb), toolbar); |
1565 sample_imhtml = imhtml; | 1751 g_signal_connect_after(G_OBJECT(webview), "format-cleared", |
1752 G_CALLBACK(formatting_clear_cb), NULL); | |
1753 sample_webview = webview; | |
1566 | 1754 |
1567 gtk_widget_show(ret); | 1755 gtk_widget_show(ret); |
1568 | 1756 |
1569 return ret; | 1757 return ret; |
1570 } | 1758 } |
2881 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_icon_folder", ""); | 3069 purple_prefs_add_path(PIDGIN_PREFS_ROOT "/filelocations/last_icon_folder", ""); |
2882 | 3070 |
2883 /* Themes */ | 3071 /* Themes */ |
2884 prefs_themes_init(); | 3072 prefs_themes_init(); |
2885 | 3073 |
3074 /* Conversation Themes */ | |
3075 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/conversations"); | |
3076 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/conversations/theme", "Default"); | |
3077 | |
2886 /* Smiley Themes */ | 3078 /* Smiley Themes */ |
2887 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/smileys"); | 3079 purple_prefs_add_none(PIDGIN_PREFS_ROOT "/smileys"); |
2888 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/smileys/theme", "Default"); | 3080 purple_prefs_add_string(PIDGIN_PREFS_ROOT "/smileys/theme", "Default"); |
2889 | 3081 |
2890 /* Smiley Callbacks */ | 3082 /* Smiley Callbacks */ |
2896 | 3088 |
2897 void | 3089 void |
2898 pidgin_prefs_update_old(void) | 3090 pidgin_prefs_update_old(void) |
2899 { | 3091 { |
2900 const char *str = NULL; | 3092 const char *str = NULL; |
2901 | |
2902 purple_prefs_rename("/gaim/gtk", PIDGIN_PREFS_ROOT); | |
2903 | 3093 |
2904 /* Rename some old prefs */ | 3094 /* Rename some old prefs */ |
2905 purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_ims", "/purple/logging/log_ims"); | 3095 purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_ims", "/purple/logging/log_ims"); |
2906 purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_chats", "/purple/logging/log_chats"); | 3096 purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_chats", "/purple/logging/log_chats"); |
2907 purple_prefs_rename("/purple/conversations/placement", | 3097 purple_prefs_rename("/purple/conversations/placement", |
2908 PIDGIN_PREFS_ROOT "/conversations/placement"); | 3098 PIDGIN_PREFS_ROOT "/conversations/placement"); |
2909 | 3099 |
2910 purple_prefs_rename(PIDGIN_PREFS_ROOT "/debug/timestamps", "/purple/debug/timestamps"); | |
2911 purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/im/raise_on_events", "/plugins/gtk/X11/notify/method_raise"); | 3100 purple_prefs_rename(PIDGIN_PREFS_ROOT "/conversations/im/raise_on_events", "/plugins/gtk/X11/notify/method_raise"); |
2912 | 3101 |
2913 purple_prefs_rename_boolean_toggle(PIDGIN_PREFS_ROOT "/conversations/ignore_colors", | 3102 purple_prefs_rename_boolean_toggle(PIDGIN_PREFS_ROOT "/conversations/ignore_colors", |
2914 PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting"); | 3103 PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting"); |
2915 | 3104 |
2921 */ | 3110 */ |
2922 if((str = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/browsers/command")) != NULL) { | 3111 if((str = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/browsers/command")) != NULL) { |
2923 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/manual_command", str); | 3112 purple_prefs_set_string(PIDGIN_PREFS_ROOT "/browsers/manual_command", str); |
2924 purple_prefs_remove(PIDGIN_PREFS_ROOT "/browsers/command"); | 3113 purple_prefs_remove(PIDGIN_PREFS_ROOT "/browsers/command"); |
2925 } | 3114 } |
2926 | |
2927 /* this string pref moved into the core, try to be friendly */ | |
2928 purple_prefs_rename(PIDGIN_PREFS_ROOT "/idle/reporting_method", "/purple/away/idle_reporting"); | |
2929 if ((str = purple_prefs_get_string("/purple/away/idle_reporting")) && | |
2930 strcmp(str, "gaim") == 0) | |
2931 purple_prefs_set_string("/purple/away/idle_reporting", "purple"); | |
2932 | 3115 |
2933 /* Remove some no-longer-used prefs */ | 3116 /* Remove some no-longer-used prefs */ |
2934 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/auto_expand_contacts"); | 3117 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/auto_expand_contacts"); |
2935 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/button_style"); | 3118 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/button_style"); |
2936 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/grey_idle_buddies"); | 3119 purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/grey_idle_buddies"); |
2957 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/color_nicks"); | 3140 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/color_nicks"); |
2958 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/raise_on_events"); | 3141 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/chat/raise_on_events"); |
2959 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ignore_fonts"); | 3142 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ignore_fonts"); |
2960 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ignore_font_sizes"); | 3143 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/ignore_font_sizes"); |
2961 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/passthrough_unknown_commands"); | 3144 purple_prefs_remove(PIDGIN_PREFS_ROOT "/conversations/passthrough_unknown_commands"); |
3145 purple_prefs_remove(PIDGIN_PREFS_ROOT "/debug/timestamps"); | |
2962 purple_prefs_remove(PIDGIN_PREFS_ROOT "/idle"); | 3146 purple_prefs_remove(PIDGIN_PREFS_ROOT "/idle"); |
2963 purple_prefs_remove(PIDGIN_PREFS_ROOT "/logging/individual_logs"); | 3147 purple_prefs_remove(PIDGIN_PREFS_ROOT "/logging/individual_logs"); |
2964 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/signon"); | 3148 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/signon"); |
2965 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/silent_signon"); | 3149 purple_prefs_remove(PIDGIN_PREFS_ROOT "/sound/silent_signon"); |
2966 | 3150 |