--- Frodo4/Src/Prefs_glade.h 2004/01/14 17:26:29 1.2 +++ Frodo4/Src/Prefs_glade.h 2010/04/21 22:07:34 1.8 @@ -1,7 +1,7 @@ /* * Prefs_glade.h - Global preferences, Glade/Gnome/Gtk+ specific stuff * - * Frodo (C) 1994-1997,2002-2004 Christian Bauer + * Frodo Copyright (C) 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 @@ -18,6 +18,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "Version.h" + #include #include @@ -47,10 +49,10 @@ static void ghost_widgets(); * prefs_name points to the file name of the preferences (which may be changed) */ -bool Prefs::ShowEditor(bool startup, char *path) +bool Prefs::ShowEditor(bool startup, char *prefs_name) { prefs = this; - prefs_path = path; + prefs_path = prefs_name; // Load XML user interface file on startup if (startup) { @@ -63,11 +65,14 @@ bool Prefs::ShowEditor(bool startup, cha // No XML means no prefs editor if (!xml) - return false; + return startup; // Run editor result = false; + + gtk_widget_show(glade_xml_get_widget(xml, "prefs_win")); gtk_main(); + return result; } @@ -193,14 +198,15 @@ static void ghost_widget(const char *nam static void ghost_widgets() { - ghost_widget("drive9_type", prefs->Emul1541Proc); - ghost_widget("drive10_type", prefs->Emul1541Proc); - ghost_widget("drive11_type", prefs->Emul1541Proc); ghost_widget("drive9_path", prefs->Emul1541Proc); ghost_widget("drive10_path", prefs->Emul1541Proc); ghost_widget("drive11_path", prefs->Emul1541Proc); ghost_widget("sid_filters", prefs->SIDType != SIDTYPE_DIGITAL); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(glade_xml_get_widget(xml, "sid_filters")), prefs->SIDType == SIDTYPE_DIGITAL ? prefs->SIDFilters : (prefs->SIDType == SIDTYPE_SIDCARD ? true : false)); + + ghost_widget("timing_control", IsFrodoSC); + ghost_widget("advanced_options", IsFrodoSC); } @@ -218,6 +224,7 @@ extern "C" void on_ok_clicked(GtkButton result = true; get_values(); prefs->Save(prefs_path); + gtk_widget_hide(glade_xml_get_widget(xml, "prefs_win")); gtk_main_quit(); } @@ -229,7 +236,12 @@ extern "C" void on_quit_clicked(GtkButto extern "C" void on_about_activate(GtkMenuItem *menuitem, gpointer user_data) { - gtk_widget_show(glade_xml_get_widget(xml, "about_win")); + GladeXML *about_xml = glade_xml_new(DATADIR "Frodo.glade", "about_win", NULL); + if (about_xml) { + GtkWidget *about_win = glade_xml_get_widget(about_xml, "about_win"); + g_object_set(about_win, "name", VERSION_STRING, NULL); + gtk_widget_show(about_win); + } } extern "C" void on_emul1541_proc_toggled(GtkToggleButton *button, gpointer user_data) @@ -243,3 +255,8 @@ extern "C" void on_sid_type_activate(Gtk prefs->SIDType = gtk_option_menu_get_history(GTK_OPTION_MENU(glade_xml_get_widget(xml, "sid_type"))); ghost_widgets(); } + +extern "C" void on_sid_filters_toggled(GtkToggleButton *button, gpointer user_data) +{ + prefs->SIDFilters = gtk_toggle_button_get_active(button); +}