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 |
< |
load_rom_files(); |
107 |
< |
TheC64->Run(); |
108 |
< |
delete TheC64; |
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; |
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 |
+ |
} |