--- Frodo4/Src/main_x.h 2003/07/01 17:33:50 1.1 +++ Frodo4/Src/main_x.h 2004/01/14 17:24:19 1.6 @@ -1,7 +1,7 @@ /* * main_x.h - Main program, Unix specific stuff * - * Frodo (C) 1994-1997,2002 Christian Bauer + * Frodo (C) 1994-1997,2002-2004 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 @@ -20,6 +20,10 @@ #include "Version.h" +#ifdef HAVE_GLADE +#include +#endif + extern int init_graphics(void); @@ -34,7 +38,10 @@ char Frodo::prefs_path[256] = ""; int main(int argc, char **argv) { - Frodo *the_app; +#ifdef HAVE_GLADE + gnome_program_init(PACKAGE_NAME, PACKAGE_VERSION, LIBGNOMEUI_MODULE, argc, argv, + GNOME_PARAM_APP_DATADIR, DATADIR, NULL); +#endif timeval tv; gettimeofday(&tv, NULL); @@ -42,10 +49,10 @@ int main(int argc, char **argv) printf("%s by Christian Bauer\n", VERSION_STRING); if (!init_graphics()) - return 0; + return 1; fflush(stdout); - the_app = new Frodo(); + Frodo *the_app = new Frodo(); the_app->ArgvReceived(argc, argv); the_app->ReadyToRun(); delete the_app; @@ -94,11 +101,15 @@ void Frodo::ReadyToRun(void) } ThePrefs.Load(prefs_path); - // Create and start C64 - TheC64 = new C64; - if (load_rom_files()) + // Show preferences editor + if (ThePrefs.ShowEditor(true, prefs_path)) { + + // Create and start C64 + TheC64 = new C64; + load_rom_files(); TheC64->Run(); - delete TheC64; + delete TheC64; + } } @@ -108,3 +119,14 @@ Prefs *Frodo::reload_prefs(void) newprefs.Load(prefs_path); return &newprefs; } + + +/* + * Determine whether path name refers to a directory + */ + +bool IsDirectory(const char *path) +{ + struct stat st; + return stat(path, &st) == 0 && S_ISDIR(st.st_mode); +}