From: Joshua Pettus Date: Tue, 10 Mar 2015 18:21:36 +0000 (-0400) Subject: Man and Info Page Fix X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=d730f33205d273d20fd463104e8d273e6e6df127 Man and Info Page Fix Terminal.app doesn’t accept command line arguments. Rather then use OSX feature of using .command scripts to launch the man and info pages (which is problematic with gatekeeper), it is much better to open them directly with applescript. Had to move infoProc to xboard.c to do this though. --- diff --git a/Makefile.am b/Makefile.am index eaba7f4..16f990a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -255,8 +255,6 @@ osxapp: all-recursive install install-recursive $(INSTALL) ./osxapp/XBoard.gtklauncher $(bindir)/XBoard $(INSTALL) ./xboard $(bindir)/xboard-bin cp -R ./osxapp/icons/. $(datarootdir) - $(INSTALL) ./osxapp/man.command $(datarootdir)/bin/man.command - $(INSTALL) ./osxapp/info.command $(datarootdir)/bin/info.command sed -e 's?-soundProgram "aplay -q"?-soundProgram "afplay"?'\ -e 's?-firstChessProgram fairymax?-firstChessProgram "./fairymax"?'\ -e 's?-firstChessProgramNames {fairymax?-firstChessProgramNames {"fairymax" -fcp "./fairymax" -fd "~~/../../bin/fairymax"?'\ @@ -280,7 +278,7 @@ osxapp: all-recursive install install-recursive echo '-autoLogo true' >>$(sysconfdir)/xboard.conf echo '-logoDir "~~/logos"' >>$(sysconfdir)/xboard.conf echo '-logoSize 100' >>$(sysconfdir)/xboard.conf - echo '-openCommand "cd %s/../../bin; open"' >>$(sysconfdir)/xboard.conf + echo '-openCommand "open"' >>$(sysconfdir)/xboard.conf echo '-firstDirectory "~~/../../bin/fairymax"' >>$(sysconfdir)/xboard.conf echo '-secondDirectory "~~/../../bin/fairymax"' >>$(sysconfdir)/xboard.conf echo '-secondChessProgram "./fairymax"' >>$(sysconfdir)/xboard.conf diff --git a/gtk/xboard.c b/gtk/xboard.c index dbcc9e5..e3d32d0 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -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 diff --git a/menus.c b/menus.c index 9ddfbad..a47e8c3 100644 --- a/menus.c +++ b/menus.c @@ -313,19 +313,6 @@ SaveSettingsProc () } void -InfoProc () -{ - char buf[MSG_SIZ]; -#ifdef OSXAPP - snprintf(buf, MSG_SIZ, "%s ./info.command", appData.sysOpen); -#else - snprintf(buf, sizeof(buf), "xterm -e info --directory %s --directory . -f %s &", - INFODIR, INFOFILE); -#endif - system(buf); -} - -void BugReportProc () { char buf[MSG_SIZ]; diff --git a/osxapp/info.command b/osxapp/info.command deleted file mode 100755 index 6457ae7..0000000 --- a/osxapp/info.command +++ /dev/null @@ -1,2 +0,0 @@ -cd "${0%/*}" -info -d ../share/info -f xboard.info diff --git a/osxapp/man.command b/osxapp/man.command deleted file mode 100755 index 096773b..0000000 --- a/osxapp/man.command +++ /dev/null @@ -1,2 +0,0 @@ -cd "${0%/*}" -man ../share/man/man6/xboard.6 diff --git a/xaw/xboard.c b/xaw/xboard.c index b7cd5cc..f85b725 100644 --- a/xaw/xboard.c +++ b/xaw/xboard.c @@ -2123,6 +2123,15 @@ ManProc () } void +InfoProc () +{ + char buf[MSG_SIZ]; + snprintf(buf, sizeof(buf), "xterm -e info --directory %s --directory . -f %s &", + INFODIR, INFOFILE); + system(buf); +} + +void SetWindowTitle (char *text, char *title, char *icon) { Arg args[16];