--- Frodo4/Src/main_x.h 2004/01/23 15:07:46 1.7 +++ Frodo4/Src/main_x.h 2010/04/21 22:03:44 1.11 @@ -1,7 +1,7 @@ /* * main_x.h - Main program, Unix 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 @@ -24,6 +24,7 @@ #include #endif +// Qtopia Windowing System #ifdef QTOPIA extern "C" int main(int argc, char *argv[]); #include @@ -33,6 +34,7 @@ extern int init_graphics(void); // Global variables +Frodo *TheApp = NULL; char Frodo::prefs_path[256] = ""; @@ -51,15 +53,21 @@ int main(int argc, char **argv) gettimeofday(&tv, NULL); srand(tv.tv_usec); - printf("%s by Christian Bauer\n", VERSION_STRING); +#ifndef HAVE_GLADE + printf( + "%s Copyright (C) Christian Bauer\n" + "This is free software with ABSOLUTELY NO WARRANTY.\n" + , VERSION_STRING + ); +#endif if (!init_graphics()) return 1; fflush(stdout); - Frodo *the_app = new Frodo(); - the_app->ArgvReceived(argc, argv); - the_app->ReadyToRun(); - delete the_app; + TheApp = new Frodo(); + TheApp->ArgvReceived(argc, argv); + TheApp->ReadyToRun(); + delete TheApp; return 0; } @@ -90,7 +98,7 @@ void Frodo::ArgvReceived(int argc, char * Arguments processed, run emulation */ -void Frodo::ReadyToRun(void) +void Frodo::ReadyToRun() { getcwd(AppDirPath, 256); @@ -108,7 +116,7 @@ void Frodo::ReadyToRun(void) // Show preferences editor #ifdef HAVE_GLADE if (!ThePrefs.ShowEditor(true, prefs_path)) - return; + return; // "Quit" clicked #endif // Create and start C64 @@ -119,11 +127,20 @@ void Frodo::ReadyToRun(void) } -Prefs *Frodo::reload_prefs(void) +/* + * Run preferences editor + */ + +bool Frodo::RunPrefsEditor(void) { - static Prefs newprefs; - newprefs.Load(prefs_path); - return &newprefs; + Prefs *prefs = new Prefs(ThePrefs); + bool result = prefs->ShowEditor(false, prefs_path); + if (result) { + TheC64->NewPrefs(prefs); + ThePrefs = *prefs; + } + delete prefs; + return result; }