comparison src/gtkprefs.c @ 5539:de09863bd4b5

[gaim-migrate @ 5939] Split Show URLs as Links into Show URLs as Links and Send URLs as Links, and converted them to the new prefs system. Also, added a function in gtkprefs.c called prefs_checkbox(), which works with the new prefs. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 27 May 2003 20:10:21 +0000
parents 933739f789f9
children 7a64114641c3
comparison
equal deleted inserted replaced
5538:f7dc3f656f03 5539:de09863bd4b5
66 static GtkWidget *browser_entry = NULL; 66 static GtkWidget *browser_entry = NULL;
67 static GtkWidget *sound_entry = NULL; 67 static GtkWidget *sound_entry = NULL;
68 static GtkWidget *away_text = NULL; 68 static GtkWidget *away_text = NULL;
69 static GtkListStore *smiley_theme_store = NULL; 69 static GtkListStore *smiley_theme_store = NULL;
70 GtkWidget *prefs_proxy_frame = NULL; 70 GtkWidget *prefs_proxy_frame = NULL;
71 GtkWidget *gaim_button(const char *, guint *, int, GtkWidget *); 71 static GtkWidget *gaim_button(const char *, guint *, int, GtkWidget *);
72 GtkWidget *gaim_labeled_spin_button(GtkWidget *, const gchar *, int*, int, int, GtkSizeGroup *); 72 GtkWidget *gaim_labeled_spin_button(GtkWidget *, const gchar *, int*, int, int, GtkSizeGroup *);
73 static GtkWidget *gaim_dropdown(GtkWidget *, const gchar *, int *, int, ...); 73 static GtkWidget *gaim_dropdown(GtkWidget *, const gchar *, int *, int, ...);
74 static GtkWidget *gaim_dropdown_from_list(GtkWidget *, const gchar *, int *, int, GList *); 74 static GtkWidget *gaim_dropdown_from_list(GtkWidget *, const gchar *, int *, int, GList *);
75 static GtkWidget *show_color_pref(GtkWidget *, gboolean); 75 static GtkWidget *show_color_pref(GtkWidget *, gboolean);
76 static void delete_prefs(GtkWidget *, void *); 76 static void delete_prefs(GtkWidget *, void *);
459 style->bg[0] = c; 459 style->bg[0] = c;
460 gtk_widget_set_style(pic, style); 460 gtk_widget_set_style(pic, style);
461 g_object_unref(style); 461 g_object_unref(style);
462 } 462 }
463 463
464 static void
465 set_bool_pref(GtkWidget *w, const char *key)
466 {
467 gaim_prefs_set_bool(key,
468 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)));
469 }
470
471 static GtkWidget *
472 pref_checkbox(const char *text, char *key, GtkWidget *page)
473 {
474 GtkWidget *button;
475
476 button = gtk_check_button_new_with_mnemonic(text);
477 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
478 gaim_prefs_get_bool(key));
479
480 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0);
481
482 g_signal_connect(G_OBJECT(button), "clicked",
483 G_CALLBACK(set_bool_pref), key);
484
485 gtk_widget_show(button);
486
487 return button;
488 }
489
490
464 GtkWidget *font_page() { 491 GtkWidget *font_page() {
465 GtkWidget *ret; 492 GtkWidget *ret;
466 GtkWidget *button; 493 GtkWidget *button;
467 GtkWidget *vbox, *hbox; 494 GtkWidget *vbox, *hbox;
468 GtkWidget *select = NULL; 495 GtkWidget *select = NULL;
551 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); 578 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
552 579
553 vbox = gaim_gtk_make_frame (ret, _("Display")); 580 vbox = gaim_gtk_make_frame (ret, _("Display"));
554 gaim_button(_("Show graphical _smileys"), &convo_options, OPT_CONVO_SHOW_SMILEY, vbox); 581 gaim_button(_("Show graphical _smileys"), &convo_options, OPT_CONVO_SHOW_SMILEY, vbox);
555 gaim_button(_("Show _timestamp on messages"), &convo_options, OPT_CONVO_SHOW_TIME, vbox); 582 gaim_button(_("Show _timestamp on messages"), &convo_options, OPT_CONVO_SHOW_TIME, vbox);
556 gaim_button(_("Show _URLs as links"), &convo_options, OPT_CONVO_SEND_LINKS, vbox); 583 pref_checkbox(_("Show _URLs as links"),
584 "/gaim/gtk/conversations/show_urls_as_links", vbox);
585
557 #ifdef USE_GTKSPELL 586 #ifdef USE_GTKSPELL
558 gaim_button(_("_Highlight misspelled words"), &convo_options, OPT_CONVO_CHECK_SPELLING, vbox); 587 gaim_button(_("_Highlight misspelled words"), &convo_options, OPT_CONVO_CHECK_SPELLING, vbox);
559 #endif 588 #endif
560 vbox = gaim_gtk_make_frame (ret, _("Ignore")); 589 vbox = gaim_gtk_make_frame (ret, _("Ignore"));
561 gaim_button(_("Ignore c_olors"), &convo_options, OPT_CONVO_IGNORE_COLOUR, vbox); 590 gaim_button(_("Ignore c_olors"), &convo_options, OPT_CONVO_IGNORE_COLOUR, vbox);
672 g_list_free(names); 701 g_list_free(names);
673 702
674 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); 703 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
675 gtk_size_group_add_widget(sg, label); 704 gtk_size_group_add_widget(sg, label);
676 705
677 gaim_button(_("Show IMs and chats in _same tabbed window."), 706 gaim_button(_("Show IMs and chats in _same tabbed window"),
678 &convo_options, OPT_CONVO_COMBINE, vbox); 707 &convo_options, OPT_CONVO_COMBINE, vbox);
708 pref_checkbox(_("Send _URLs as Links"),
709 "/core/conversations/send_urls_as_links", vbox);
679 710
680 gtk_widget_show_all(ret); 711 gtk_widget_show_all(ret);
681 712
682 return ret; 713 return ret;
683 } 714 }
2097 2128
2098 if (option == OPT_AWAY_QUEUE) 2129 if (option == OPT_AWAY_QUEUE)
2099 toggle_away_queue(); 2130 toggle_away_queue();
2100 } 2131 }
2101 2132
2102 GtkWidget *gaim_button(const char *text, guint *options, int option, GtkWidget *page) 2133 static GtkWidget *gaim_button(const char *text, guint *options, int option, GtkWidget *page)
2103 { 2134 {
2104 GtkWidget *button; 2135 GtkWidget *button;
2105 button = gtk_check_button_new_with_mnemonic(text); 2136 button = gtk_check_button_new_with_mnemonic(text);
2106 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), (*options & option)); 2137 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), (*options & option));
2107 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0); 2138 gtk_box_pack_start(GTK_BOX(page), button, FALSE, FALSE, 0);
2495 gaim_prefs_add_bool("/gaim/gtk/debug/toolbar", TRUE); 2526 gaim_prefs_add_bool("/gaim/gtk/debug/toolbar", TRUE);
2496 gaim_prefs_add_bool("/gaim/gtk/debug/timestamps", FALSE); 2527 gaim_prefs_add_bool("/gaim/gtk/debug/timestamps", FALSE);
2497 gaim_prefs_add_bool("/gaim/gtk/debug/enabled", FALSE); 2528 gaim_prefs_add_bool("/gaim/gtk/debug/enabled", FALSE);
2498 gaim_prefs_add_int("/gaim/gtk/debug/width", 400); 2529 gaim_prefs_add_int("/gaim/gtk/debug/width", 400);
2499 gaim_prefs_add_int("/gaim/gtk/debug/height", 150); 2530 gaim_prefs_add_int("/gaim/gtk/debug/height", 150);
2500 } 2531
2501 2532 /* Conversations */
2533 gaim_prefs_add_none("/gaim/gtk/conversations");
2534 gaim_prefs_add_bool("/gaim/gtk/conversations/show_urls_as_links", TRUE);
2535
2536 /* Smiley Themes */
2537 gaim_prefs_add_none("/gaim/gtk/smilies");
2538 gaim_prefs_add_string("/gaim/gtk/smilies/theme", "");
2539 }
2540