From 852159d1b1789544d5e4f2e2be2b127a754e74d7 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 15 Aug 2013 17:32:46 +0000 Subject: [PATCH] Changes from G4KLA, required to make latest code play on MacOSX. It's necessary to convey "appDir" from the GUI to jt9, so that jt9 can find the .lock and .quit files. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3551 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/jt9.f90 | 5 +++-- lib/jt9a.f90 | 9 +++++---- mainwindow.cpp | 5 ++++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/jt9.f90 b/lib/jt9.f90 index ff5307ef4..2265f7576 100644 --- a/lib/jt9.f90 +++ b/lib/jt9.f90 @@ -7,7 +7,7 @@ program jt9 integer*4 ihdr(11) real*4 s(NSMAX) integer*2 id2 - character*80 arg,infile + character*80 arg,ldir,infile common/jt9com/ss(184,NSMAX),savg(NSMAX),id2(NMAX),nutc,ndiskdat,ntr, & mousefqso,newdat,nfa,nfsplit,nfb,ntol,kin,nzhsym,nsynced,ndecoded common/tracer/limtrace,lu @@ -25,7 +25,8 @@ program jt9 if(arg(1:2).eq.'-s') then ! Multiple instances: call getarg(2,arg) - call jt9a(trim(arg)) + call getarg(3,ldir) + call jt9a(trim(arg),trim(ldir)) go to 999 endif read(arg,*) ntrperiod diff --git a/lib/jt9a.f90 b/lib/jt9a.f90 index 113533c7e..34f1a46ff 100644 --- a/lib/jt9a.f90 +++ b/lib/jt9a.f90 @@ -1,6 +1,7 @@ -subroutine jt9a(thekey) +subroutine jt9a(thekey,ldir) character(len=*), intent(in):: thekey + character(len=*), intent(in):: ldir ! These routines connect the shared memory region to the decoder. interface @@ -36,13 +37,13 @@ subroutine jt9a(thekey) i1=attach_jt9() -10 inquire(file=trim(cwd)//'/.lock',exist=fileExists) +10 inquire(file=trim(ldir)//'/.lock',exist=fileExists) if(fileExists) then call sleep_msec(100) go to 10 endif - inquire(file=trim(cwd)//'/.quit',exist=fileExists) + inquire(file=trim(ldir)//'/.quit',exist=fileExists) if(fileExists) then ! call ftnquit i1=detach_jt9() @@ -61,7 +62,7 @@ subroutine jt9a(thekey) call jt9b(p_jt9,nbytes) call timer('jt9b ',1) -100 inquire(file=trim(cwd)//'/.lock',exist=fileExists) +100 inquire(file=trim(ldir)//'/.lock',exist=fileExists) if(fileExists) go to 10 call sleep_msec(100) go to 100 diff --git a/mainwindow.cpp b/mainwindow.cpp index 1fbb8b381..524431a34 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -321,7 +321,10 @@ MainWindow::MainWindow(QSettings * settings, QSharedMemory *shdmem, QString *the // Multiple instances: start "jt9 -s " QByteArray ba = mykey_jt9->toLocal8Bit(); const char *bc = ba.data(); - proc_jt9.start(QDir::toNativeSeparators('"' + m_appDir + '"' + "/jt9 -s " + bc)); +// proc_jt9.start(QDir::toNativeSeparators('"' + m_appDir + '"' + "/jt9 -s " + bc)); + QByteArray lda = m_appDir.toLocal8Bit(); + const char *ldir = lda.data(); + proc_jt9.start(QDir::toNativeSeparators('"' + m_appDir + '"' + "/jt9 -s " + bc + " " + ldir)); m_pbdecoding_style1="QPushButton{background-color: cyan; \ border-style: outset; border-width: 1px; border-radius: 5px; \