ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/Frodo4/Src/Prefs_glade.h
(Generate patch)

Comparing Frodo4/Src/Prefs_glade.h (file contents):
Revision 1.2 by cebix, 2004-01-14T17:26:29Z vs.
Revision 1.8 by cebix, 2010-04-21T22:07:34Z

# Line 1 | Line 1
1   /*
2   *  Prefs_glade.h - Global preferences, Glade/Gnome/Gtk+ specific stuff
3   *
4 < *  Frodo (C) 1994-1997,2002-2004 Christian Bauer
4 > *  Frodo Copyright (C) Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 18 | Line 18
18   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19   */
20  
21 + #include "Version.h"
22 +
23   #include <gnome.h>
24   #include <glade/glade.h>
25  
# Line 47 | Line 49 | static void ghost_widgets();
49   *  prefs_name points to the file name of the preferences (which may be changed)
50   */
51  
52 < bool Prefs::ShowEditor(bool startup, char *path)
52 > bool Prefs::ShowEditor(bool startup, char *prefs_name)
53   {
54          prefs = this;
55 <        prefs_path = path;
55 >        prefs_path = prefs_name;
56  
57          // Load XML user interface file on startup
58          if (startup) {
# Line 63 | Line 65 | bool Prefs::ShowEditor(bool startup, cha
65  
66          // No XML means no prefs editor
67          if (!xml)
68 <                return false;
68 >                return startup;
69  
70          // Run editor
71          result = false;
72 +
73 +        gtk_widget_show(glade_xml_get_widget(xml, "prefs_win"));
74          gtk_main();
75 +
76          return result;
77   }
78  
# Line 193 | Line 198 | static void ghost_widget(const char *nam
198  
199   static void ghost_widgets()
200   {
196        ghost_widget("drive9_type", prefs->Emul1541Proc);
197        ghost_widget("drive10_type", prefs->Emul1541Proc);
198        ghost_widget("drive11_type", prefs->Emul1541Proc);
201          ghost_widget("drive9_path", prefs->Emul1541Proc);
202          ghost_widget("drive10_path", prefs->Emul1541Proc);
203          ghost_widget("drive11_path", prefs->Emul1541Proc);
204  
205          ghost_widget("sid_filters", prefs->SIDType != SIDTYPE_DIGITAL);
206 +        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));
207 +
208 +        ghost_widget("timing_control", IsFrodoSC);
209 +        ghost_widget("advanced_options", IsFrodoSC);
210   }
211  
212  
# Line 218 | Line 224 | extern "C" void on_ok_clicked(GtkButton
224          result = true;
225          get_values();
226          prefs->Save(prefs_path);
227 +        gtk_widget_hide(glade_xml_get_widget(xml, "prefs_win"));
228          gtk_main_quit();
229   }
230  
# Line 229 | Line 236 | extern "C" void on_quit_clicked(GtkButto
236  
237   extern "C" void on_about_activate(GtkMenuItem *menuitem, gpointer user_data)
238   {
239 <        gtk_widget_show(glade_xml_get_widget(xml, "about_win"));
239 >        GladeXML *about_xml = glade_xml_new(DATADIR "Frodo.glade", "about_win", NULL);
240 >        if (about_xml) {
241 >                GtkWidget *about_win = glade_xml_get_widget(about_xml, "about_win");
242 >                g_object_set(about_win, "name", VERSION_STRING, NULL);
243 >                gtk_widget_show(about_win);
244 >    }
245   }
246  
247   extern "C" void on_emul1541_proc_toggled(GtkToggleButton *button, gpointer user_data)
# Line 243 | Line 255 | extern "C" void on_sid_type_activate(Gtk
255          prefs->SIDType = gtk_option_menu_get_history(GTK_OPTION_MENU(glade_xml_get_widget(xml, "sid_type")));
256          ghost_widgets();
257   }
258 +
259 + extern "C" void on_sid_filters_toggled(GtkToggleButton *button, gpointer user_data)
260 + {
261 +        prefs->SIDFilters = gtk_toggle_button_get_active(button);
262 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines