GtkosxApplication *theApp = g_object_new(GTKOSX_TYPE_APPLICATION, NULL);
char *path = gtkosx_application_get_bundle_path();
strncpy(dataDir, path, MSG_SIZ);
- snprintf(masterSettings, MSG_SIZ, "%s/../Resources/etc/xboard.conf", path);
+ snprintf(masterSettings, MSG_SIZ, "%s/Contents/Resources/etc/xboard.conf", path);
g_signal_connect(theApp, "NSApplicationOpenFile", G_CALLBACK(StartNewXBoard), NULL);
// we must call application ready before we can get the signal,
// and supply a (dummy) menu bar before that, to avoid problems with dual apples in it
}
#endif
+ if(argc > 1 && !strcmp(argv[1], "--show-config")) { // [HGM] install: called to print config info
+ typedef struct {char *name, *value; } Config;
+ static Config configList[] = {
+ { "Datadir", DATADIR },
+ { "Sysconfdir", SYSCONFDIR },
+ { NULL }
+ };
+ int i;
+
+ for(i=0; configList[i].name; i++) {
+ if(argc > 2 && strcmp(argv[2], configList[i].name)) continue;
+ if(argc > 2) printf("%s", configList[i].value);
+ else printf("%-12s: %s\n", configList[i].name, configList[i].value);
+ }
+ exit(0);
+ }
+
/* set up keyboard accelerators group */
GtkAccelerators = gtk_accel_group_new();
{ // [HGM] initstring: kludge to fix bad bug. expand '\n' characters in init string and computer string.
static char buf[MSG_SIZ];
+ snprintf(buf, MSG_SIZ, appData.sysOpen, DATADIR);
+ ASSIGN(appData.sysOpen, buf); // expand %s in -openCommand to DATADIR (usefull for OS X configuring)
EscapeExpand(buf, appData.firstInitString);
appData.firstInitString = strdup(buf);
EscapeExpand(buf, appData.secondInitString);
ManProc ()
{ // called from menu
#ifdef __APPLE__
- system("%s ./man.command", appData.sysOpen);
+ char buf[MSG_SIZ];
+ snprintf(buf, MSG_SIZ, "%s ./man.command", appData.sysOpen);
+ system(buf);
#else
system("xterm -e man xboard &");
#endif