Some cleanup of new Fox GUI.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8211 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2017-11-02 20:35:22 +00:00
parent a72de82a39
commit 4df5d99441
2 changed files with 40 additions and 5 deletions

View File

@ -866,6 +866,10 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
m_bCheckedContest=false;
m_bDisplayedOnce=false;
m_wait=0;
m_isort=-3;
m_max_N=10;
m_min_dB=-30;
m_max_dB=30;
m_CQtype="CQ";
if(m_mode.startsWith ("WSPR") and m_pctx>0) {
@ -1701,6 +1705,18 @@ void MainWindow::auto_tx_mode (bool state)
void MainWindow::keyPressEvent (QKeyEvent * e)
{
if(m_config.bFox()) {
switch (e->key()) {
case Qt::Key_7:
if(m_isort>-4) m_isort--;
return;
case Qt::Key_8:
if(m_isort<4) m_isort++;
return;
}
QMainWindow::keyPressEvent (e);
}
int n;
switch(e->key())
{
@ -2712,7 +2728,7 @@ void MainWindow::decodeDone ()
if(f.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream s(&f);
QString t=s.readAll();
QString t1=sortFoxCalls(t,1,10,-30,30);
QString t1=sortFoxCalls(t,m_isort,m_max_N,m_min_dB,m_max_dB);
ui->decodedTextBrowser->setText(t1);
}
}
@ -3399,6 +3415,12 @@ void MainWindow::guiUpdate()
on_actionOpen_next_in_directory_triggered();
}
}
if(m_config.bFox()) {
QString t;
t.sprintf("DXpedition: Fox %d %d %d %d",m_isort,m_max_N,
m_min_dB,m_max_dB);
ui->labDXped->setText(t);
}
//Once per second:
if(nsec != m_sec0) {
@ -3763,6 +3785,16 @@ void MainWindow::doubleClickOnCall(Qt::KeyboardModifiers modifiers)
cursor=ui->decodedTextBrowser2->textCursor();
}
cursor.setPosition (cursor.selectionStart());
if(m_config.bFox() and m_decodedText2) {
QString t=cursor.block().text();
QString c2=t.split(" ",QString::SkipEmptyParts).at(0);
QString g2=t.split(" ",QString::SkipEmptyParts).at(1);
QString rpt=t.split(" ",QString::SkipEmptyParts).at(2);
ui->dxCallEntry->setText(c2);
ui->dxGridEntry->setText(g2);
genStdMsgs(rpt);
return;
}
DecodedText message {cursor.block().text(), ("MSK144" == m_mode || "FT8" == m_mode) &&
ui->cbVHFcontest->isChecked(), m_config.my_grid ()};
m_bDoubleClicked = true;

View File

@ -96,7 +96,6 @@ public:
QSharedMemory *shdmem, unsigned downSampleFactor,
QSplashScreen *,
QWidget *parent = nullptr);
qint32 m_isort;
~MainWindow();
public slots:
@ -408,6 +407,10 @@ private:
qint32 m_UTCdisk;
qint32 m_wait;
qint32 m_i3bit;
qint32 m_isort;
qint32 m_max_N;
qint32 m_max_dB;
qint32 m_min_dB;
bool m_btxok; //True if OK to transmit
bool m_diskData;
@ -628,7 +631,7 @@ private:
, Frequency frequency
, QString const& his_call
, QString const& his_grid) const;
QString sortFoxCalls(QString t, int m_isort, int max_N, int min_dB, int max_dB);
QString sortFoxCalls(QString t, int isort, int max_N, int min_dB, int max_dB);
void read_wav_file (QString const& fname);
void decodeDone ();
void subProcessFailed (QProcess *, int exit_code, QProcess::ExitStatus);