diff --git a/mainwindow.cpp b/mainwindow.cpp index 9f843e271..4d5cd2869 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -371,6 +371,7 @@ void MainWindow::readSettings() if(m_ndepth==1) ui->actionQuickDecode->setChecked(true); if(m_ndepth==2) ui->actionMediumDecode->setChecked(true); if(m_ndepth==3) ui->actionDeepestDecode->setChecked(true); + statusChanged(); } //-------------------------------------------------------------- dataSink() @@ -605,6 +606,24 @@ void MainWindow::bumpFqso(int n) //bumpFqso() } } +void MainWindow::dialFreqChanged2(double f) +{ + m_dialFreq=f; + statusChanged(); +} + +void MainWindow::statusChanged() +{ + QFile f("wsjtx_status.txt"); + if(!f.open(QFile::WriteOnly)) { + msgBox("Cannot open file \"wsjtx_status.txt\"."); + return; + } + QTextStream out(&f); + out << m_dialFreq << ";" << m_mode << ";" << m_hisCall << "\r\n"; + f.close(); +} + bool MainWindow::eventFilter(QObject *object, QEvent *event) //eventFilter() { if (event->type() == QEvent::KeyPress) { @@ -720,7 +739,8 @@ void MainWindow::on_actionWide_Waterfall_triggered() //Display Waterfalls SLOT(freezeDecode(int))); connect(g_pWideGraph, SIGNAL(f11f12(int)),this, SLOT(bumpFqso(int))); - } + connect(g_pWideGraph, SIGNAL(dialFreqChanged(double)),this, + SLOT(dialFreqChanged2(double))); } g_pWideGraph->show(); } @@ -1611,14 +1631,7 @@ void MainWindow::on_dxCallEntry_textChanged(const QString &t) //dxCall changed { m_hisCall=t.toUpper().trimmed(); ui->dxCallEntry->setText(m_hisCall); - QFile f("wsjtx_txcall.txt"); - if(!f.open(QFile::WriteOnly)) { - msgBox("Cannot open file \"wsjtx_txcall.txt\"."); - return; - } - QTextStream out(&f); - out << m_hisCall << "\r\n"; - f.close(); + statusChanged(); } void MainWindow::on_dxGridEntry_textChanged(const QString &t) //dxGrid changed @@ -1679,6 +1692,7 @@ void MainWindow::on_actionErase_wsjtx_tx_log_triggered() //Erase Tx log void MainWindow::on_actionJT9_1_triggered() { m_mode="JT9-1"; + statusChanged(); m_TRperiod=60; m_nsps=6912; m_hsymStop=181; @@ -1693,6 +1707,7 @@ void MainWindow::on_actionJT9_1_triggered() void MainWindow::on_actionJT9_2_triggered() { m_mode="JT9-2"; + statusChanged(); m_TRperiod=120; m_nsps=15360; m_hsymStop=178; @@ -1707,6 +1722,7 @@ void MainWindow::on_actionJT9_2_triggered() void MainWindow::on_actionJT9_5_triggered() { m_mode="JT9-5"; + statusChanged(); m_TRperiod=300; m_nsps=40960; m_hsymStop=172; @@ -1721,6 +1737,7 @@ void MainWindow::on_actionJT9_5_triggered() void MainWindow::on_actionJT9_10_triggered() { m_mode="JT9-10"; + statusChanged(); m_TRperiod=600; m_nsps=82944; m_hsymStop=171; @@ -1735,6 +1752,7 @@ void MainWindow::on_actionJT9_10_triggered() void MainWindow::on_actionJT9_30_triggered() { m_mode="JT9-30"; + statusChanged(); m_TRperiod=1800; m_nsps=252000; m_hsymStop=167; diff --git a/mainwindow.h b/mainwindow.h index 2b0cb7146..1f803d7c0 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -109,9 +109,13 @@ private slots: void on_inGain_valueChanged(int n); void bumpFqso(int n); void on_actionMonitor_OFF_at_startup_triggered(); + void dialFreqChanged2(double f); private: Ui::MainWindow *ui; + + double m_dialFreq; + qint32 m_nDevIn; qint32 m_nDevOut; qint32 m_idInt; @@ -217,6 +221,7 @@ private: void ba2msg(QByteArray ba, char* message); void msgtype(QString t, QLineEdit* tx); void stub(); + void statusChanged(); }; extern void getfile(QString fname, int ntrperiod); diff --git a/widegraph.cpp b/widegraph.cpp index 25812e691..e918b2736 100644 --- a/widegraph.cpp +++ b/widegraph.cpp @@ -39,7 +39,7 @@ WideGraph::WideGraph(QWidget *parent) : ui->widePlot->setBinsPerPixel(1); m_waterfallAvg = settings.value("WaterfallAvg",5).toInt(); ui->waterfallAvgSpinBox->setValue(m_waterfallAvg); - m_dialFreq=settings.value("DialFreqkHz",474.000).toDouble(); + m_dialFreq=settings.value("DialFreqMHz",14.078).toDouble(); ui->fDialLineEdit->setText(QString::number(m_dialFreq)); ui->widePlot->m_bCurrent=settings.value("Current",true).toBool(); ui->widePlot->m_bCumulative=settings.value("Cumulative",false).toBool(); @@ -53,6 +53,8 @@ WideGraph::WideGraph(QWidget *parent) : ui->widePlot->setFQSO(m_qsoFreq,true); settings.endGroup(); +// Change the following to a slot in mainwindow; emit a corresponding +// signal here, instead. QFile f("wsjtx_qrg.txt"); if(f.open(QFile::WriteOnly)) { QTextStream out(&f); @@ -83,7 +85,7 @@ void WideGraph::saveSettings() settings.setValue("PlotWidth",ui->widePlot->plotWidth()); settings.setValue("FreqSpan",ui->freqSpanSpinBox->value()); settings.setValue("WaterfallAvg",ui->waterfallAvgSpinBox->value()); - settings.setValue("DialFreqkHz",m_dialFreq); + settings.setValue("DialFreqMHz",m_dialFreq); settings.setValue("Current",ui->widePlot->m_bCurrent); settings.setValue("Cumulative",ui->widePlot->m_bCumulative); settings.setValue("JT9Sync",ui->widePlot->m_bJT9Sync); @@ -243,15 +245,7 @@ void WideGraph::setPalette(QString palette) void WideGraph::on_fDialLineEdit_editingFinished() { m_dialFreq=ui->fDialLineEdit->text().toDouble(); - QFile f("wsjtx_qrg.txt"); - if(!f.open(QFile::WriteOnly)) { -// msgBox("Cannot open file \"wsjtx_qrg.txt\"."); - qDebug() << "Cannot open file \"wsjtx_qrg.txt\"."; - return; - } - QTextStream out(&f); - out << m_dialFreq; - f.close(); + emit dialFreqChanged(m_dialFreq); } double WideGraph::fGreen() diff --git a/widegraph.h b/widegraph.h index fd71402bb..92798bd66 100644 --- a/widegraph.h +++ b/widegraph.h @@ -37,6 +37,7 @@ public: signals: void freezeDecode2(int n); void f11f12(int n); + void dialFreqChanged(double f); public slots: void wideFreezeDecode(int n); diff --git a/wsjtx.iss b/wsjtx.iss index a452016b2..fefcfa3c5 100644 --- a/wsjtx.iss +++ b/wsjtx.iss @@ -1,6 +1,6 @@ [Setup] AppName=wsjtx -AppVerName=wsjtx Version 0.6 r3046 +AppVerName=wsjtx Version 0.6 r3047 AppCopyright=Copyright (C) 2001-2013 by Joe Taylor, K1JT DefaultDirName=c:\wsjtx DefaultGroupName=wsjtx