Mercurial > pidgin
comparison src/prefs.c @ 4978:307c16c4b57e
[gaim-migrate @ 5313]
(08:55:48) Robot101: patch to:
(08:56:07) Robot101: * make online buddies appear black, not grey, when you have 'show offline buddies' turned on
(08:56:21) Robot101: * random cleanup in buddy.c (tooltip/timer freeing)
(08:56:43) Robot101: * stop the add buddy dialog resetting your choice of group when you choose an account
(08:57:03) Robot101: * fix little memleak when loading the default window icon
(08:57:16) Robot101: * make the main window use the default instead of loading the same icon itself
(08:57:42) Robot101: * make the manual browser pref validate and save when the entry widget loses focus, not with a crappy button
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Thu, 03 Apr 2003 14:05:43 +0000 |
parents | 42bd8ab53234 |
children | 06baf1e9094c |
comparison
equal
deleted
inserted
replaced
4977:503f61301b81 | 4978:307c16c4b57e |
---|---|
810 gtk_widget_show_all(ret); | 810 gtk_widget_show_all(ret); |
811 return ret; | 811 return ret; |
812 } | 812 } |
813 | 813 |
814 #ifndef _WIN32 | 814 #ifndef _WIN32 |
815 static void manual_browser_set(GtkButton *button, GtkEntry *entry) { | 815 static gboolean manual_browser_set(GtkWidget *entry, GdkEventFocus *event, gpointer data) { |
816 | 816 const char *program = gtk_entry_get_text(GTK_ENTRY(entry)); |
817 const char *program = gtk_entry_get_text(entry); | 817 |
818 if (!program_is_valid(program)) { | 818 if (!program_is_valid(program)) { |
819 char *error = g_strdup_printf(_("The entered manual browser " | 819 char *error = g_strdup_printf(_("The entered manual browser " |
820 "'%s' is not valid. Hyperlinks will " | 820 "'%s' is not valid. Hyperlinks will " |
821 "not work."), program); | 821 "not work."), program); |
822 do_error_dialog(error, NULL, GAIM_WARNING); | 822 do_error_dialog(error, NULL, GAIM_WARNING); |
823 } | 823 } |
824 | 824 |
825 g_strlcpy(web_command, program, sizeof(web_command)); | 825 g_strlcpy(web_command, program, sizeof(web_command)); |
826 } | 826 |
827 | 827 /* carry on normally */ |
828 static void manual_browser_reset(GtkButton *button, GtkEntry *entry) { | 828 return FALSE; |
829 gtk_entry_set_text(entry, web_command); | |
830 } | 829 } |
831 | 830 |
832 static GList *get_available_browsers() | 831 static GList *get_available_browsers() |
833 { | 832 { |
834 struct browser { | 833 struct browser { |
888 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | 887 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
889 label = gtk_label_new_with_mnemonic(_("_Manual: ")); | 888 label = gtk_label_new_with_mnemonic(_("_Manual: ")); |
890 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); | 889 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); |
891 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | 890 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); |
892 gtk_size_group_add_widget(sg, label); | 891 gtk_size_group_add_widget(sg, label); |
892 | |
893 browser_entry = gtk_entry_new(); | 893 browser_entry = gtk_entry_new(); |
894 gtk_label_set_mnemonic_widget(GTK_LABEL(label), browser_entry); | 894 gtk_label_set_mnemonic_widget(GTK_LABEL(label), browser_entry); |
895 if (web_browser != BROWSER_MANUAL) | 895 if (web_browser != BROWSER_MANUAL) |
896 gtk_widget_set_sensitive(hbox, FALSE); | 896 gtk_widget_set_sensitive(hbox, FALSE); |
897 gtk_box_pack_start (GTK_BOX (hbox), browser_entry, FALSE, FALSE, 0); | 897 gtk_box_pack_start (GTK_BOX (hbox), browser_entry, FALSE, FALSE, 0); |
898 | 898 |
899 gtk_entry_set_text(GTK_ENTRY(browser_entry), web_command); | 899 gtk_entry_set_text(GTK_ENTRY(browser_entry), web_command); |
900 g_signal_connect_swapped(GTK_OBJECT(browser_entry), "activate", | 900 g_signal_connect(G_OBJECT(browser_entry), "focus-out-event", G_CALLBACK(manual_browser_set), NULL); |
901 G_CALLBACK(manual_browser_set), NULL); | |
902 label = gtk_button_new_with_label(_("Set")); | |
903 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
904 g_signal_connect(GTK_OBJECT(label), "clicked", | |
905 G_CALLBACK(manual_browser_set), browser_entry); | |
906 label = gtk_button_new_with_label(_("Reset")); | |
907 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
908 g_signal_connect(GTK_OBJECT(label), "clicked", | |
909 G_CALLBACK(manual_browser_reset), browser_entry); | |
910 | 901 |
911 if (browsers != NULL) { | 902 if (browsers != NULL) { |
912 vbox = make_frame (ret, _("Browser Options")); | 903 vbox = make_frame (ret, _("Browser Options")); |
913 label = gaim_button(_("Open new _window by default"), &misc_options, OPT_MISC_BROWSER_POPUP, vbox); | 904 label = gaim_button(_("Open new _window by default"), &misc_options, OPT_MISC_BROWSER_POPUP, vbox); |
914 } | 905 } |