1 |
|
/* |
2 |
|
* main_x.h - Main program, Unix specific stuff |
3 |
|
* |
4 |
< |
* Frodo (C) 1994-1997,2002-2003 Christian Bauer |
4 |
> |
* Frodo (C) 1994-1997,2002-2004 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 |
20 |
|
|
21 |
|
#include "Version.h" |
22 |
|
|
23 |
+ |
#ifdef HAVE_GLADE |
24 |
+ |
#include <gnome.h> |
25 |
+ |
#endif |
26 |
+ |
|
27 |
|
|
28 |
|
extern int init_graphics(void); |
29 |
|
|
38 |
|
|
39 |
|
int main(int argc, char **argv) |
40 |
|
{ |
41 |
< |
Frodo *the_app; |
41 |
> |
#ifdef HAVE_GLADE |
42 |
> |
gnome_program_init(PACKAGE_NAME, PACKAGE_VERSION, LIBGNOMEUI_MODULE, argc, argv, |
43 |
> |
GNOME_PARAM_APP_DATADIR, DATADIR, NULL); |
44 |
> |
#endif |
45 |
|
|
46 |
|
timeval tv; |
47 |
|
gettimeofday(&tv, NULL); |
49 |
|
|
50 |
|
printf("%s by Christian Bauer\n", VERSION_STRING); |
51 |
|
if (!init_graphics()) |
52 |
< |
return 0; |
52 |
> |
return 1; |
53 |
|
fflush(stdout); |
54 |
|
|
55 |
< |
the_app = new Frodo(); |
55 |
> |
Frodo *the_app = new Frodo(); |
56 |
|
the_app->ArgvReceived(argc, argv); |
57 |
|
the_app->ReadyToRun(); |
58 |
|
delete the_app; |
101 |
|
} |
102 |
|
ThePrefs.Load(prefs_path); |
103 |
|
|
104 |
< |
// Create and start C64 |
105 |
< |
TheC64 = new C64; |
106 |
< |
if (load_rom_files()) |
104 |
> |
// Show preferences editor |
105 |
> |
if (ThePrefs.ShowEditor(true, prefs_path)) { |
106 |
> |
|
107 |
> |
// Create and start C64 |
108 |
> |
TheC64 = new C64; |
109 |
> |
load_rom_files(); |
110 |
|
TheC64->Run(); |
111 |
< |
delete TheC64; |
111 |
> |
delete TheC64; |
112 |
> |
} |
113 |
|
} |
114 |
|
|
115 |
|
|
119 |
|
newprefs.Load(prefs_path); |
120 |
|
return &newprefs; |
121 |
|
} |
122 |
+ |
|
123 |
+ |
|
124 |
+ |
/* |
125 |
+ |
* Determine whether path name refers to a directory |
126 |
+ |
*/ |
127 |
+ |
|
128 |
+ |
bool IsDirectory(const char *path) |
129 |
+ |
{ |
130 |
+ |
struct stat st; |
131 |
+ |
return stat(path, &st) == 0 && S_ISDIR(st.st_mode); |
132 |
+ |
} |