From dab1519ad85e88eb39fa6b1e230bacddb8d7f6d1 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 24 Apr 2013 15:00:30 +0000 Subject: [PATCH] Option to allow multiple instances of WSJT-X to run simultaneously. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3206 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- mainwindow.cpp | 13 ++++++++++++- mainwindow.h | 4 +++- mainwindow.ui | 16 ++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 332f3bb90..21811b517 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -180,6 +180,7 @@ MainWindow::MainWindow(QSharedMemory *shdmem, QWidget *parent) : m_repeatMsg=0; m_bRigOpen=false; m_secBandChanged=0; + m_bMultipleOK=false; decodeBusy(false); ui->xThermo->setFillBrush(Qt::green); @@ -187,11 +188,13 @@ MainWindow::MainWindow(QSharedMemory *shdmem, QWidget *parent) : ui->labDist->setStyleSheet("border: 0px;"); #ifdef WIN32 - while(true) { + if(!m_bMultipleOK) { + while(true) { int iret=killbyname("jt9.exe"); if(iret == 603) break; if(iret != 0) msgBox("KillByName return code: " + QString::number(iret)); + } } #endif mem_jt9 = shdmem; @@ -395,6 +398,7 @@ void MainWindow::writeSettings() settings.setValue("73TxDisable",m_73TxDisable); settings.setValue("Runaway",m_runaway); settings.setValue("Tx2QSO",m_tx2QSO); + settings.setValue("MultipleOK",m_bMultipleOK); settings.endGroup(); } @@ -505,6 +509,8 @@ void MainWindow::readSettings() ui->actionRunaway_Tx_watchdog->setChecked(m_runaway); m_tx2QSO=settings.value("Tx2QSO",false).toBool(); ui->actionTx2QSO->setChecked(m_tx2QSO); + m_bMultipleOK=settings.value("MultipleOK",false).toBool(); + ui->actionAllow_multiple_instances->setChecked(m_bMultipleOK); if(!ui->actionLinrad->isChecked() && !ui->actionCuteSDR->isChecked() && !ui->actionAFMHot->isChecked() && !ui->actionBlue->isChecked()) { @@ -2614,3 +2620,8 @@ void MainWindow::rigOpen() delete rig; } } + +void MainWindow::on_actionAllow_multiple_instances_triggered(bool checked) +{ + m_bMultipleOK=checked; +} diff --git a/mainwindow.h b/mainwindow.h index b08da9194..90b8fc43b 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -153,6 +153,8 @@ private slots: void killFile(); void on_tuneButton_clicked(); + void on_actionAllow_multiple_instances_triggered(bool checked); + private: Ui::MainWindow *ui; @@ -248,7 +250,7 @@ private: bool m_tx2QSO; bool m_tune; bool m_bRigOpen; - + bool m_bMultipleOK; char m_decoded[80]; float m_pctZap; diff --git a/mainwindow.ui b/mainwindow.ui index 09f68ae0e..a7d758a68 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -2058,6 +2058,12 @@ p, li { white-space: pre-wrap; } Setup + + + Advanced + + + @@ -2074,6 +2080,8 @@ p, li { white-space: pre-wrap; } + + @@ -2631,6 +2639,14 @@ p, li { white-space: pre-wrap; } Tx messages echoed to QSO window + + + true + + + Allow multiple instances + +