diff --git a/foxcalls.cpp b/foxcalls.cpp index 98bd700e7..acf6c17c8 100644 --- a/foxcalls.cpp +++ b/foxcalls.cpp @@ -1,4 +1,5 @@ #include "foxcalls.h" +#include "qt_helpers.hpp" #include #include #include "ui_foxcalls.h" @@ -13,6 +14,7 @@ FoxCalls::FoxCalls(QSettings * settings, QWidget *parent) : setWindowTitle (QApplication::applicationName () + " - " + tr ("Fox Callers")); installEventFilter(parent); //Installing the filter + //Restore user's settings m_settings->beginGroup("FoxCalls"); restoreGeometry (m_settings->value ("geometry", saveGeometry ()).toByteArray ()); @@ -36,3 +38,14 @@ void FoxCalls::saveSettings() m_settings->setValue ("geometry", saveGeometry ()); m_settings->endGroup(); } + +void FoxCalls::insertText(QString t) +{ + QTextDocument *doc = ui->foxPlainTextEdit->document(); + QFont font = doc->defaultFont(); + font.setFamily("Courier New"); + doc->setDefaultFont(font); + qDebug() << font; + ui->foxPlainTextEdit->setPlainText(t); + ui->foxPlainTextEdit->setReadOnly (true); +} diff --git a/foxcalls.h b/foxcalls.h index 1b3462098..9ae35c30d 100644 --- a/foxcalls.h +++ b/foxcalls.h @@ -3,12 +3,14 @@ #include #include +#include namespace Ui { class FoxCalls; } class QSettings; +class QFont; class FoxCalls : public QWidget { @@ -21,7 +23,8 @@ public: explicit FoxCalls(QSettings *, QWidget *parent = 0); ~FoxCalls(); - void saveSettings(); + void saveSettings(); + void insertText(QString t); private slots: // void on_binsPerPixelSpinBox_valueChanged(int n); diff --git a/foxcalls.ui b/foxcalls.ui index 668721f51..0f473445d 100644 --- a/foxcalls.ui +++ b/foxcalls.ui @@ -13,16 +13,6 @@ Form - - - - 20 - 90 - 321 - 192 - - - @@ -83,6 +73,22 @@ + + + + 20 + 90 + 511 + 191 + + + + + Courier New + 12 + + + diff --git a/mainwindow.cpp b/mainwindow.cpp index 33e9e9ff5..2f6306a6c 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -204,8 +204,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, m_echoGraph (new EchoGraph(m_settings)), m_fastGraph (new FastGraph(m_settings)), m_logDlg (new LogQSO (program_title (), m_settings, &m_config, this)), -// m_foxTable (new QTableWidget(100,5)), - m_foxTable (new FoxCalls(m_settings)), + m_foxCalls (new FoxCalls(m_settings)), m_lastDialFreq {0}, m_dialFreqRxWSPR {0}, m_detector {new Detector {RX_SAMPLE_RATE, NTMAX, downSampleFactor}}, @@ -1148,6 +1147,11 @@ void MainWindow::setDecodedTextFont (QFont const& font) if (m_msgAvgWidget) { m_msgAvgWidget->changeFont (font); } + /* + if (m_foxCalls->isVisible()) { + m_foxCalls->changeFont (font); + } + */ updateGeometry (); } @@ -2051,7 +2055,7 @@ void MainWindow::closeEvent(QCloseEvent * e) m_config.transceiver_offline (); writeSettings (); m_astroWidget.reset (); - m_foxTable.reset(); + m_foxCalls.reset(); m_guiTimer.stop (); m_prefixes.reset (); m_shortcuts.reset (); @@ -2115,6 +2119,10 @@ void MainWindow::on_actionFast_Graph_triggered() m_fastGraph->show(); } +void MainWindow::on_actionFox_Callers_triggered() +{ + m_foxCalls->show(); +} void MainWindow::on_actionSolve_FreqCal_triggered() { QString dpath{QDir::toNativeSeparators(m_config.writeable_data_dir().absolutePath()+"/")}; @@ -2712,58 +2720,11 @@ void MainWindow::decodeDone () m_blankLine=true; if(m_config.bFox()) { QFile f(m_config.temp_dir ().absoluteFilePath ("decoded.txt")); - if(f.open (QIODevice::ReadOnly | QIODevice::Text)) { + + if(f.open(QIODevice::ReadOnly | QIODevice::Text)) { QTextStream s(&f); -// int nutc,nsnr,nfreq, - int i=0; -// double dt; - QString c1,c2,g2; - QStringList line; - while(!s.atEnd()) { - line=s.readLine().split(" ", QString::SkipEmptyParts); -// nutc=line.at(0).toInt(); -// nsnr=line.at(2).toInt(); -// dt=line.at(3).toDouble(); -// nfreq=line.at(4).toInt(); - c1=line.at(6); - c2=line.at(7); - g2=line.at(8); - /* - if(g2.contains (grid_regexp)) { - QTableWidgetItem *pCell0 = m_foxTable->item(i,0); - if(!pCell0) { - pCell0= new QTableWidgetItem; - m_foxTable->setItem(i,0,pCell0); - pCell0->setText(c2); - } - QTableWidgetItem *pCell1 = m_foxTable->item(i,1); - if(!pCell1) { - pCell1= new QTableWidgetItem; - m_foxTable->setItem(i,1,pCell1); - pCell1->setText(g2); - } - QTableWidgetItem *pCell2 = m_foxTable->item(i,2); - if(!pCell2) { - pCell2= new QTableWidgetItem; - m_foxTable->setItem(i,2,pCell2); - pCell2->setText(line.at(2)); - } - QTableWidgetItem *pCell3 = m_foxTable->item(i,3); - if(!pCell3) { - pCell3= new QTableWidgetItem; - m_foxTable->setItem(i,3,pCell3); - pCell3->setText(line.at(4)); - } - QTableWidgetItem *pCell4 = m_foxTable->item(i,4); - if(!pCell4) { - pCell4= new QTableWidgetItem; - m_foxTable->setItem(i,4,pCell4); - pCell4->setText(line.at(0)); - } i++; - } - */ - } - f.close(); + QString t=s.readAll(); + m_foxCalls->insertText(t); } } } @@ -3440,6 +3401,8 @@ void MainWindow::guiUpdate() //Once per second: if(nsec != m_sec0) { +// qDebug() << "a" << m_foxCalls->font(); +// qDebug() << "b" << ui->decodedTextBrowser->font(); if(m_freqNominal!=0 and m_freqNominal<50000000 and m_config.enable_VHF_features()) { if(!m_bVHFwarned) vhfWarning(); } else { @@ -4790,14 +4753,14 @@ void MainWindow::on_actionFT8_triggered() ui->label_7->setText("Rx Frequency"); displayWidgets(nWidgets("111010000100111000010000")); if(m_config.bFox()) { - if(!m_foxTable->isVisible()) { + if(!m_foxCalls->isVisible()) { // QStringList headers{"Call","Loc","dB","Freq","UTC"}; // m_foxTable->setHorizontalHeaderLabels(headers); // m_foxTable->setGeometry(QRect(100,100,550,400)); - m_foxTable->show(); + m_foxCalls->show(); } } else { - if(m_foxTable) m_foxTable->hide(); + if(m_foxCalls) m_foxCalls->hide(); } if(m_config.bFox() or m_config.bHound()) { if(m_config.bFox()) ui->labDXped->setText("DXpeditiion Fox"); diff --git a/mainwindow.h b/mainwindow.h index 4e8250bd1..f67d1a350 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -269,6 +269,7 @@ private slots: void on_actionEcho_triggered(); void on_actionISCAT_triggered(); void on_actionFast_Graph_triggered(); + void on_actionFox_Callers_triggered(); void fast_decode_done(); void on_actionMeasure_reference_spectrum_triggered(); void on_actionErase_reference_spectrum_triggered(); @@ -341,7 +342,7 @@ private: QScopedPointer m_prefixes; QScopedPointer m_mouseCmnds; QScopedPointer m_msgAvgWidget; - QScopedPointer m_foxTable; + QScopedPointer m_foxCalls; Transceiver::TransceiverState m_rigState; Frequency m_lastDialFreq; diff --git a/mainwindow.ui b/mainwindow.ui index 0ad9db356..47737ebbc 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -2343,6 +2343,7 @@ QPushButton[state="ok"] { + @@ -2979,6 +2980,11 @@ QPushButton[state="ok"] { Shift+F1 + + + Fox Callers + +