X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gtk%2Fxboard.c;h=5da2d3e66b5ffa4edcbb7fdb7284964d3129becd;hb=4011e8678d85310eedf19fd00aa5d96a9a60770a;hp=b2c080c33a14764eb9cfd90ef77ab0827ea258dd;hpb=e5156fd4c6007cb79c7a1d16b99ca4f48c5bce9e;p=xboard.git diff --git a/gtk/xboard.c b/gtk/xboard.c index b2c080c..5da2d3e 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -5,7 +5,7 @@ * Massachusetts. * * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, - * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. + * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Free Software Foundation, Inc. * * The following terms apply to Digital Equipment Corporation's copyright * interest in XBoard: @@ -168,7 +168,7 @@ extern char *getenv(); #include "draw.h" #ifdef OSXAPP -# include +# include // prevent pathname of positional file argument provided by OS X being be mistaken for option name // (price is that we won't recognize Windows option format anymore). # define SLASH '-' @@ -1966,7 +1966,7 @@ ManProc () { // called from menu #ifdef OSXAPP char buf[MSG_SIZ]; - snprintf(buf, MSG_SIZ, "%s ./man.command", appData.sysOpen); + snprintf(buf, MSG_SIZ, "osascript -e 'tell application \"Terminal\"' -e 'activate' -e 'do script \"man %s/../man/man6/xboard.6\"' -e 'end tell'", dataDir); system(buf); #else system("xterm -e man xboard &"); @@ -1974,6 +1974,20 @@ ManProc () } void +InfoProc () +{ + char buf[MSG_SIZ]; +#ifdef OSXAPP + snprintf(buf, MSG_SIZ, "osascript -e 'tell application \"Terminal\"' -e 'activate' -e 'do script \"info -d %s/../info -f xboard.info\"' -e 'end tell'", dataDir); +#else + snprintf(buf, sizeof(buf), "xterm -e info --directory %s --directory . -f %s &", + INFODIR, INFOFILE); +#endif + system(buf); +} + + +void SetWindowTitle (char *text, char *title, char *icon) { #ifdef TODO_GTK @@ -2321,6 +2335,12 @@ void FileNamePopUpWrapper(label, def, filter, proc, pathFlag, openMode, name, fp StartDir(filter, NULL); // change to start directory for this file type + if(def && *def && def[strlen(def)-1] == '/') { + getcwd(curDir, MSG_SIZ); + chdir(def); + } + + /* make a copy of the filter string, so that strtok can work with it*/ cp = strdup(filter);