--- BasiliskII/src/Unix/prefs_editor_gtk.cpp 2002/09/17 16:06:37 1.23 +++ BasiliskII/src/Unix/prefs_editor_gtk.cpp 2005/01/30 21:42:14 1.26 @@ -1,7 +1,7 @@ /* * prefs_editor_gtk.cpp - Preferences editor, Unix implementation using GTK+ * - * Basilisk II (C) 1997-2002 Christian Bauer + * Basilisk II (C) 1997-2005 Christian Bauer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -306,7 +306,7 @@ static void mn_about(...) dialog = gnome_about_new( "Basilisk II", version, - "Copyright (C) 1997-2002 Christian Bauer", + "Copyright (C) 1997-2004 Christian Bauer", authors, "Basilisk II comes with ABSOLUTELY NO WARRANTY." "This is free software, and you are welcome to redistribute it" @@ -322,7 +322,7 @@ static void mn_about(...) char str[512]; sprintf(str, "Basilisk II\nVersion %d.%d\n\n" - "Copyright (C) 1997-2002 Christian Bauer et al.\n" + "Copyright (C) 1997-2004 Christian Bauer et al.\n" "E-mail: Christian.Bauer@uni-mainz.de\n" "http://www.uni-mainz.de/~bauec002/B2Main.html\n\n" "Basilisk II comes with ABSOLUTELY NO\n" @@ -715,6 +715,8 @@ static GtkWidget *l_fbdev_name, *l_fbdev static char fbdev_name[256]; #endif +static GtkWidget *w_dspdevice_file, *w_mixerdevice_file; + // Hide/show graphics widgets static void hide_show_graphics_widgets(void) { @@ -761,10 +763,19 @@ static void mn_30hz(...) {PrefsReplaceIn static void mn_60hz(...) {PrefsReplaceInt32("frameskip", 1);} static void mn_dynamic(...) {PrefsReplaceInt32("frameskip", 0);} +// Set sensitivity of widgets +static void set_graphics_sensitive(void) +{ + const bool sound_enabled = !PrefsFindBool("nosound"); + gtk_widget_set_sensitive(w_dspdevice_file, sound_enabled); + gtk_widget_set_sensitive(w_mixerdevice_file, sound_enabled); +} + // "Disable Sound Output" button toggled static void tb_nosound(GtkWidget *widget) { PrefsReplaceBool("nosound", GTK_TOGGLE_BUTTON(widget)->active); + set_graphics_sensitive(); } // Read graphics preferences @@ -827,6 +838,8 @@ static void read_graphics_settings(void) else PrefsRemoveItem("fbdevicefile"); #endif + PrefsReplaceString("dsp", get_file_entry_path(w_dspdevice_file)); + PrefsReplaceString("mixer", get_file_entry_path(w_mixerdevice_file)); } // Create "Graphics/Sound" pane @@ -947,6 +960,10 @@ static void create_graphics_pane(GtkWidg make_separator(box); make_checkbox(box, STR_NOSOUND_CTRL, "nosound", GTK_SIGNAL_FUNC(tb_nosound)); + w_dspdevice_file = make_file_entry(box, STR_DSPDEVICE_FILE_CTRL, "dsp"); + w_mixerdevice_file = make_file_entry(box, STR_MIXERDEVICE_FILE_CTRL, "mixer"); + + set_graphics_sensitive(); hide_show_graphics_widgets(); }