comparison src/audacious/ui_preferences.c @ 4006:8a3cee5c303b

one more commit
author Tomasz Mon <desowin@gmail.com>
date Sun, 25 Nov 2007 13:57:18 +0100
parents 94089cc94ccf
children fc85f7ce6969
comparison
equal deleted inserted replaced
4005:94089cc94ccf 4006:8a3cee5c303b
169 169
170 enum WidgetTypes { 170 enum WidgetTypes {
171 WIDGET_NONE, 171 WIDGET_NONE,
172 WIDGET_CHK_BTN, 172 WIDGET_CHK_BTN,
173 WIDGET_LABEL, 173 WIDGET_LABEL,
174 WIDGET_RADIO_BTN 174 WIDGET_RADIO_BTN,
175 WIDGET_CHARDET_TABLE /* 'fixed' widget, not for reuse */
175 }; 176 };
176 177
177 typedef struct preferences_widgets_t { 178 typedef struct preferences_widgets_t {
178 gint type; /* widget type */ 179 gint type; /* widget type */
179 char *label; /* widget title */ 180 char *label; /* widget title */
221 {WIDGET_CHK_BTN, gettext_noop("Convert backslash '\\' to forward slash '/'"), &cfg.convert_slash, NULL, NULL, FALSE}, 222 {WIDGET_CHK_BTN, gettext_noop("Convert backslash '\\' to forward slash '/'"), &cfg.convert_slash, NULL, NULL, FALSE},
222 {WIDGET_LABEL, gettext_noop("<b>Metadata</b>"), NULL, NULL, NULL, FALSE}, 223 {WIDGET_LABEL, gettext_noop("<b>Metadata</b>"), NULL, NULL, NULL, FALSE},
223 {WIDGET_CHK_BTN, gettext_noop("Load metadata from playlists and files"), &cfg.use_pl_metadata, NULL, gettext_noop("Load metadata (tag information) from music files."), FALSE}, 224 {WIDGET_CHK_BTN, gettext_noop("Load metadata from playlists and files"), &cfg.use_pl_metadata, NULL, gettext_noop("Load metadata (tag information) from music files."), FALSE},
224 {WIDGET_RADIO_BTN, gettext_noop("On load"), &cfg.get_info_on_load, NULL, gettext_noop("Load metadata when adding the file to the playlist or opening it"), TRUE}, 225 {WIDGET_RADIO_BTN, gettext_noop("On load"), &cfg.get_info_on_load, NULL, gettext_noop("Load metadata when adding the file to the playlist or opening it"), TRUE},
225 {WIDGET_RADIO_BTN, gettext_noop("On display"), &cfg.get_info_on_demand, NULL, gettext_noop("Load metadata on demand when displaying the file in the playlist. You may need to set \"Detect file formats on demand\" in Audio page for full benefit."), TRUE}, 226 {WIDGET_RADIO_BTN, gettext_noop("On display"), &cfg.get_info_on_demand, NULL, gettext_noop("Load metadata on demand when displaying the file in the playlist. You may need to set \"Detect file formats on demand\" in Audio page for full benefit."), TRUE},
227 {WIDGET_CHARDET_TABLE, NULL, NULL, NULL, NULL, TRUE},
228 {WIDGET_LABEL, gettext_noop("<b>File Dialog</b>"), NULL, NULL, NULL, FALSE},
229 {WIDGET_CHK_BTN, gettext_noop("Always refresh directory when opening file dialog"), &cfg.refresh_file_list, NULL, gettext_noop("Always refresh the file dialog (this will slow opening the dialog on large directories, and Gnome VFS should handle automatically)."), FALSE},
226 }; 230 };
227 231
228 /* GLib 2.6 compatibility */ 232 /* GLib 2.6 compatibility */
229 #if (! ((GLIB_MAJOR_VERSION > 2) || ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION >= 8)))) 233 #if (! ((GLIB_MAJOR_VERSION > 2) || ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION >= 8))))
230 static const char * 234 static const char *
973 977
974 static void 978 static void
975 on_software_volume_control_realize(GtkToggleButton * button, gpointer data) 979 on_software_volume_control_realize(GtkToggleButton * button, gpointer data)
976 { 980 {
977 gtk_toggle_button_set_active(button, cfg.software_volume_control); 981 gtk_toggle_button_set_active(button, cfg.software_volume_control);
978 }
979
980 static void
981 on_refresh_file_list_realize(GtkToggleButton * button, gpointer data)
982 {
983 gtk_toggle_button_set_active(button, cfg.refresh_file_list);
984 }
985
986 static void
987 on_refresh_file_list_toggled(GtkToggleButton * button, gpointer data)
988 {
989 cfg.refresh_file_list = gtk_toggle_button_get_active(button);
990 } 982 }
991 983
992 static void 984 static void
993 on_pause_between_songs_realize(GtkToggleButton * button, 985 on_pause_between_songs_realize(GtkToggleButton * button,
994 gpointer data) 986 gpointer data)
1738 widgets[x].cfg); 1730 widgets[x].cfg);
1739 g_signal_connect(G_OBJECT(widget), "realize", 1731 g_signal_connect(G_OBJECT(widget), "realize",
1740 G_CALLBACK(on_toggle_button_realize), 1732 G_CALLBACK(on_toggle_button_realize),
1741 widgets[x].cfg); 1733 widgets[x].cfg);
1742 break; 1734 break;
1735 case WIDGET_CHARDET_TABLE:
1736 widget = gtk_table_new(2, 2, FALSE);
1737 GtkWidget *label;
1738
1739 label = gtk_label_new(_("Auto character encoding detector for:"));
1740 gtk_table_attach(GTK_TABLE(widget), label, 0, 1, 0, 1,
1741 (GtkAttachOptions) (0),
1742 (GtkAttachOptions) (0), 0, 0);
1743 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_RIGHT);
1744 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
1745
1746 GtkWidget *combobox = gtk_combo_box_new_text();
1747 gtk_table_attach(GTK_TABLE(widget), combobox, 1, 2, 0, 1,
1748 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1749 (GtkAttachOptions) (0), 0, 0);
1750 g_signal_connect_after(G_OBJECT(combobox), "realize",
1751 G_CALLBACK(on_chardet_detector_cbox_realize),
1752 NULL);
1753
1754 GtkWidget *entry = gtk_entry_new();
1755 gtk_table_attach(GTK_TABLE(widget), entry, 1, 2, 1, 2,
1756 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
1757 (GtkAttachOptions) (0), 0, 0);
1758 gtk_tooltips_set_tip (tooltips, entry, _("List of character encodings used for fall back conversion of metadata. If automatic character encoding detector failed or has been disabled, encodings in this list would be treated as candidates of the encoding of metadata, and fall back conversion from these encodings to UTF-8 would be attempted."), NULL);
1759
1760 label = gtk_label_new(_("Fallback character encodings:"));
1761 gtk_table_attach(GTK_TABLE(widget), label, 0, 1, 1, 2,
1762 (GtkAttachOptions) (0),
1763 (GtkAttachOptions) (0), 0, 0);
1764 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_RIGHT);
1765 gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
1766
1767 g_signal_connect(G_OBJECT(entry), "changed",
1768 G_CALLBACK(on_chardet_fallback_changed),
1769 NULL);
1770 g_signal_connect_after(G_OBJECT(entry), "realize",
1771 G_CALLBACK(on_chardet_fallback_realize),
1772 NULL);
1773
1774 break;
1743 default: 1775 default:
1744 g_object_unref(alignment); 1776 /* shouldn't ever happen - expect things to break */
1745 widget = NULL;
1746 continue; 1777 continue;
1747 } 1778 }
1748 1779
1749 if (widget) 1780 if (widget)
1750 gtk_container_add(GTK_CONTAINER(alignment), widget); 1781 gtk_container_add(GTK_CONTAINER(alignment), widget);
1845 GtkWidget *label33; 1876 GtkWidget *label33;
1846 GtkWidget *label32; 1877 GtkWidget *label32;
1847 GtkWidget *mouse_label; 1878 GtkWidget *mouse_label;
1848 GtkWidget *playlist_page_vbox; 1879 GtkWidget *playlist_page_vbox;
1849 GtkWidget *vbox5; 1880 GtkWidget *vbox5;
1850 GtkWidget *table10;
1851 GtkWidget *label73;
1852 GtkWidget *combobox1;
1853 GtkWidget *entry1;
1854 GtkWidget *label74;
1855 GtkWidget *alignment19;
1856 GtkWidget *label40;
1857 GtkWidget *alignment20;
1858 GtkWidget *refresh_file_list;
1859 GtkWidget *alignment55; 1881 GtkWidget *alignment55;
1860 GtkWidget *label60; 1882 GtkWidget *label60;
1861 GtkWidget *alignment56; 1883 GtkWidget *alignment56;
1862 GtkWidget *table6; 1884 GtkWidget *table6;
1863 GtkWidget *titlestring_help_button; 1885 GtkWidget *titlestring_help_button;
2389 vbox5 = gtk_vbox_new (FALSE, 0); 2411 vbox5 = gtk_vbox_new (FALSE, 0);
2390 gtk_box_pack_start (GTK_BOX (playlist_page_vbox), vbox5, TRUE, TRUE, 0); 2412 gtk_box_pack_start (GTK_BOX (playlist_page_vbox), vbox5, TRUE, TRUE, 0);
2391 2413
2392 create_widgets(GTK_BOX(vbox5), playlist_page_widgets, G_N_ELEMENTS(playlist_page_widgets)); 2414 create_widgets(GTK_BOX(vbox5), playlist_page_widgets, G_N_ELEMENTS(playlist_page_widgets));
2393 2415
2394 /* TODO: this needs to be done by create_widgets and packed into child_box */
2395 {
2396 table10 = gtk_table_new (2, 2, FALSE);
2397 gtk_box_pack_start (GTK_BOX (vbox5), table10, TRUE, TRUE, 0);
2398
2399 label73 = gtk_label_new (_("Auto character encoding detector for:"));
2400 gtk_table_attach (GTK_TABLE (table10), label73, 0, 1, 0, 1,
2401 (GtkAttachOptions) (0),
2402 (GtkAttachOptions) (0), 0, 0);
2403 gtk_label_set_justify (GTK_LABEL (label73), GTK_JUSTIFY_RIGHT);
2404 gtk_misc_set_alignment (GTK_MISC (label73), 1, 0.5);
2405
2406 combobox1 = gtk_combo_box_new_text ();
2407 gtk_table_attach (GTK_TABLE (table10), combobox1, 1, 2, 0, 1,
2408 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
2409 (GtkAttachOptions) (0), 0, 0);
2410
2411 entry1 = gtk_entry_new ();
2412 gtk_table_attach (GTK_TABLE (table10), entry1, 1, 2, 1, 2,
2413 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
2414 (GtkAttachOptions) (0), 0, 0);
2415 gtk_tooltips_set_tip (tooltips, entry1, _("List of character encodings used for fall back conversion of metadata. If automatic character encoding detector failed or has been disabled, encodings in this list would be treated as candidates of the encoding of metadata, and fall back conversion from these encodings to UTF-8 would be attempted."), NULL);
2416
2417 label74 = gtk_label_new (_("Fallback character encodings:"));
2418 gtk_table_attach (GTK_TABLE (table10), label74, 0, 1, 1, 2,
2419 (GtkAttachOptions) (0),
2420 (GtkAttachOptions) (0), 0, 0);
2421 gtk_label_set_justify (GTK_LABEL (label74), GTK_JUSTIFY_RIGHT);
2422 gtk_misc_set_alignment (GTK_MISC (label74), 1, 0.5);
2423 }
2424
2425 alignment19 = gtk_alignment_new (0.5, 0.5, 1, 1);
2426 gtk_box_pack_start (GTK_BOX (vbox5), alignment19, FALSE, FALSE, 0);
2427 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment19), 12, 12, 0, 0);
2428
2429 label40 = gtk_label_new (_("<b>File Dialog</b>"));
2430 gtk_container_add (GTK_CONTAINER (alignment19), label40);
2431 gtk_label_set_use_markup (GTK_LABEL (label40), TRUE);
2432 gtk_misc_set_alignment (GTK_MISC (label40), 0, 0.5);
2433
2434 alignment20 = gtk_alignment_new (0.5, 0.5, 1, 1);
2435 gtk_box_pack_start (GTK_BOX (vbox5), alignment20, FALSE, FALSE, 0);
2436 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment20), 0, 0, 12, 0);
2437
2438 refresh_file_list = gtk_check_button_new_with_mnemonic (_("Always refresh directory when opening file dialog"));
2439 gtk_container_add (GTK_CONTAINER (alignment20), refresh_file_list);
2440 gtk_tooltips_set_tip (tooltips, refresh_file_list, _("Always refresh the file dialog (this will slow opening the dialog on large directories, and Gnome VFS should handle automatically)."), NULL);
2441
2442 alignment55 = gtk_alignment_new (0.5, 0.5, 1, 1); 2416 alignment55 = gtk_alignment_new (0.5, 0.5, 1, 1);
2443 gtk_box_pack_start (GTK_BOX (vbox5), alignment55, FALSE, FALSE, 0); 2417 gtk_box_pack_start (GTK_BOX (vbox5), alignment55, FALSE, FALSE, 0);
2444 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment55), 12, 12, 0, 0); 2418 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment55), 12, 12, 0, 0);
2445 2419
2446 label60 = gtk_label_new (_("<b>Song Display</b>")); 2420 label60 = gtk_label_new (_("<b>Song Display</b>"));
3042 g_signal_connect(G_OBJECT(mouse_wheel_scroll_pl), "value_changed", 3016 g_signal_connect(G_OBJECT(mouse_wheel_scroll_pl), "value_changed",
3043 G_CALLBACK(on_mouse_wheel_scroll_pl_changed), 3017 G_CALLBACK(on_mouse_wheel_scroll_pl_changed),
3044 NULL); 3018 NULL);
3045 g_signal_connect_after(G_OBJECT(mouse_wheel_scroll_pl), "realize", 3019 g_signal_connect_after(G_OBJECT(mouse_wheel_scroll_pl), "realize",
3046 G_CALLBACK(on_mouse_wheel_scroll_pl_realize), 3020 G_CALLBACK(on_mouse_wheel_scroll_pl_realize),
3047 NULL);
3048 g_signal_connect_after(G_OBJECT(combobox1), "realize",
3049 G_CALLBACK(on_chardet_detector_cbox_realize),
3050 NULL);
3051 g_signal_connect(G_OBJECT(entry1), "changed",
3052 G_CALLBACK(on_chardet_fallback_changed),
3053 NULL);
3054 g_signal_connect_after(G_OBJECT(entry1), "realize",
3055 G_CALLBACK(on_chardet_fallback_realize),
3056 NULL);
3057 g_signal_connect(G_OBJECT(refresh_file_list), "toggled",
3058 G_CALLBACK(on_refresh_file_list_toggled),
3059 NULL);
3060 g_signal_connect_after(G_OBJECT(refresh_file_list), "realize",
3061 G_CALLBACK(on_refresh_file_list_realize),
3062 NULL); 3021 NULL);
3063 g_signal_connect(G_OBJECT(titlestring_entry), "changed", 3022 g_signal_connect(G_OBJECT(titlestring_entry), "changed",
3064 G_CALLBACK(on_titlestring_entry_changed), 3023 G_CALLBACK(on_titlestring_entry_changed),
3065 NULL); 3024 NULL);
3066 g_signal_connect_after(G_OBJECT(titlestring_entry), "realize", 3025 g_signal_connect_after(G_OBJECT(titlestring_entry), "realize",