From d730f33205d273d20fd463104e8d273e6e6df127 Mon Sep 17 00:00:00 2001 From: Joshua Pettus Date: Tue, 10 Mar 2015 14:21:36 -0400 Subject: [PATCH] Man and Info Page Fix MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. --- Makefile.am | 4 +--- gtk/xboard.c | 16 +++++++++++++++- menus.c | 13 ------------- osxapp/info.command | 2 -- osxapp/man.command | 2 -- xaw/xboard.c | 9 +++++++++ 6 files changed, 25 insertions(+), 21 deletions(-) delete mode 100755 osxapp/info.command delete mode 100755 osxapp/man.command 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]; -- 1.7.0.4