mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-08-02 22:22:33 -04:00
Now have two decoded text boxes: left for decodes at QSO frequency, right
for everything else. NB: I have screwed up the vertical expansion of mainwindow: growth occurs at the bottom, rather than in the text boxes. Help! git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3129 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
c5bd47a9cd
commit
4a9ea17e5f
@ -79,6 +79,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
connect(txMsgButtonGroup,SIGNAL(buttonClicked(int)),SLOT(set_ntx(int)));
|
||||
connect(ui->decodedTextBrowser,SIGNAL(selectCallsign(bool,bool)),this,
|
||||
SLOT(doubleClickOnCall(bool,bool)));
|
||||
connect(ui->decodedTextBrowser2,SIGNAL(selectCallsign(bool,bool)),this,
|
||||
SLOT(doubleClickOnCall2(bool,bool)));
|
||||
|
||||
setWindowTitle(Program_Title_Version);
|
||||
connect(&soundInThread, SIGNAL(readyForFFT(int)),
|
||||
@ -164,7 +166,9 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
m_clearCallGrid=false;
|
||||
m_bMiles=false;
|
||||
m_fMin=1000;
|
||||
m_decodedText2=false;
|
||||
ui->fMinSpinBox->setValue(m_fMin);
|
||||
|
||||
decodeBusy(false);
|
||||
|
||||
ui->xThermo->setFillBrush(Qt::green);
|
||||
@ -264,8 +268,11 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
if(ui->actionBlue->isChecked()) on_actionBlue_triggered();
|
||||
|
||||
ui->decodedTextLabel->setFont(ui->decodedTextBrowser->font());
|
||||
// 2241 10 -8 0.2 1184. 0 VK7XX N1ISA FN41
|
||||
ui->decodedTextLabel->setText("UTC Sync dB DT Freq Drift Message");
|
||||
ui->decodedTextLabel->setFont(ui->decodedTextBrowser2->font());
|
||||
// 2022 0 0.1 1446 W5NZ EA6BB JM19
|
||||
t="UTC dB DT Freq Message";
|
||||
t=t + " " + t;
|
||||
ui->decodedTextLabel->setText(t);
|
||||
|
||||
#ifdef WIN32
|
||||
if(m_pskReporter) {
|
||||
@ -1177,15 +1184,25 @@ void MainWindow::readFromStdout() //readFromStdout
|
||||
QString bg="white";
|
||||
if(t.indexOf(" CQ ")>0) bg="#66ff66"; //Light green
|
||||
if(m_myCall!="" and t.indexOf(" "+m_myCall+" ")>0) bg="#ff6666"; //Light red
|
||||
|
||||
bool bQSO=abs(t.mid(22,4).toInt() - g_pWideGraph->QSOfreq()) < 10;
|
||||
QString t1=t.mid(0,5) + t.mid(10,4) + t.mid(15,5) + t.mid(22,4) +
|
||||
t.mid(32);
|
||||
QString s = "<table border=0 cellspacing=0 width=100%><tr><td bgcolor=\"" +
|
||||
bg + "\"><pre>" + t.replace("\n","") + "</pre></td></tr></table>";
|
||||
bg + "\"><pre>" + t1.replace("\n","") + "</pre></td></tr></table>";
|
||||
if(bQSO) {
|
||||
cursor = ui->decodedTextBrowser->textCursor();
|
||||
cursor.movePosition(QTextCursor::End);
|
||||
bf = cursor.blockFormat();
|
||||
bf.setBackground(QBrush(QColor(bg)));
|
||||
cursor.insertHtml(s);
|
||||
ui->decodedTextBrowser->setTextCursor(cursor);
|
||||
}
|
||||
cursor = ui->decodedTextBrowser2->textCursor();
|
||||
cursor.movePosition(QTextCursor::End);
|
||||
bf = cursor.blockFormat();
|
||||
bf.setBackground(QBrush(QColor(bg)));
|
||||
cursor.insertHtml(s);
|
||||
ui->decodedTextBrowser2->setTextCursor(cursor);
|
||||
|
||||
QString msg=t.mid(34,22);
|
||||
bool b=stdmsg_(msg.toAscii().constData(),22);
|
||||
@ -1253,6 +1270,7 @@ void MainWindow::readFromStdout() //readFromStdout
|
||||
void MainWindow::on_EraseButton_clicked() //Erase
|
||||
{
|
||||
ui->decodedTextBrowser->clear();
|
||||
ui->decodedTextBrowser2->clear();
|
||||
}
|
||||
|
||||
void MainWindow::decodeBusy(bool b) //decodeBusy()
|
||||
@ -1620,33 +1638,45 @@ void MainWindow::on_txb6_clicked() //txb6
|
||||
m_restart=true;
|
||||
}
|
||||
|
||||
void MainWindow::doubleClickOnCall2(bool shift, bool ctrl)
|
||||
{
|
||||
m_decodedText2=true;
|
||||
doubleClickOnCall(shift,ctrl);
|
||||
m_decodedText2=false;
|
||||
}
|
||||
void MainWindow::doubleClickOnCall(bool shift, bool ctrl)
|
||||
{
|
||||
QTextCursor cursor=ui->decodedTextBrowser->textCursor();
|
||||
QTextCursor cursor;
|
||||
if(!m_decodedText2) cursor=ui->decodedTextBrowser->textCursor();
|
||||
if(m_decodedText2) cursor=ui->decodedTextBrowser2->textCursor();
|
||||
cursor.select(QTextCursor::LineUnderCursor);
|
||||
int i2=cursor.position();
|
||||
QString t = ui->decodedTextBrowser->toPlainText(); //Full contents
|
||||
|
||||
QString t;
|
||||
if(!m_decodedText2) t= ui->decodedTextBrowser->toPlainText(); //Full contents
|
||||
if(m_decodedText2) t= ui->decodedTextBrowser2->toPlainText();
|
||||
|
||||
QString t1 = t.mid(0,i2); //contents up to \n on selected line
|
||||
int i1=t1.lastIndexOf("\n") + 1; //points to first char of line
|
||||
QString t2 = t1.mid(i1,i2-i1); //selected line
|
||||
int i4=t.mid(i1).length();
|
||||
if(i4>60) i4=60;
|
||||
if(i4>55) i4=55;
|
||||
QString t3=t.mid(i1,i4);
|
||||
int i5=t3.indexOf(" CQ DX ");
|
||||
if(i5>0) t3=t3.mid(0,i5+3) + "_" + t3.mid(i5+4); //Make it "CQ_DX" (one word)
|
||||
QStringList t4=t3.split(" ",QString::SkipEmptyParts);
|
||||
if(t4.length() <7) return; //Skip the rest if no decoded text
|
||||
QString firstcall=t4.at(6);
|
||||
if(t4.length() <5) return; //Skip the rest if no decoded text
|
||||
QString firstcall=t4.at(4);
|
||||
//Don't change freqs if Shift key down or a station is calling me.
|
||||
if(!shift and (firstcall!=m_myCall or ctrl)) {
|
||||
int nfreq=int(t4.at(4).toFloat());
|
||||
int nfreq=int(t4.at(3).toFloat());
|
||||
ui->TxFreqSpinBox->setValue(nfreq);
|
||||
g_pWideGraph->setQSOfreq(nfreq);
|
||||
}
|
||||
QString hiscall=t4.at(7);
|
||||
QString hiscall=t4.at(5);
|
||||
QString hisgrid="";
|
||||
if(t4.length()>=9)
|
||||
hisgrid=t4.at(8);
|
||||
if(t4.length()>=7)
|
||||
hisgrid=t4.at(6);
|
||||
ui->dxCallEntry->setText(hiscall);
|
||||
lookup();
|
||||
if(ui->dxGridEntry->text()=="" and gridOK(hisgrid))
|
||||
@ -1655,7 +1685,7 @@ void MainWindow::doubleClickOnCall(bool shift, bool ctrl)
|
||||
int nmod=n%(m_TRperiod/30);
|
||||
m_txFirst=(nmod!=0);
|
||||
ui->txFirstCheckBox->setChecked(m_txFirst);
|
||||
QString rpt=t4.at(2);
|
||||
QString rpt=t4.at(1);
|
||||
if(rpt.indexOf(" ")==0) rpt="+" + rpt.mid(2,2);
|
||||
if(rpt.indexOf(" -")==0) rpt=rpt.mid(1,2);
|
||||
if(rpt.indexOf(" ")==0) rpt="+" + rpt.mid(1,2);
|
||||
|
@ -33,6 +33,7 @@ public slots:
|
||||
void freezeDecode(int n);
|
||||
void guiUpdate();
|
||||
void doubleClickOnCall(bool shift, bool ctrl);
|
||||
void doubleClickOnCall2(bool shift, bool ctrl);
|
||||
void readFromStdout();
|
||||
void readFromStderr();
|
||||
void jt9_error();
|
||||
@ -220,6 +221,7 @@ private:
|
||||
bool m_insertBlank;
|
||||
bool m_clearCallGrid;
|
||||
bool m_bMiles;
|
||||
bool m_decodedText2;
|
||||
|
||||
char m_decoded[80];
|
||||
|
||||
|
126
mainwindow.ui
126
mainwindow.ui
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>680</width>
|
||||
<height>475</height>
|
||||
<width>750</width>
|
||||
<height>535</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -18,13 +18,13 @@
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>680</width>
|
||||
<width>690</width>
|
||||
<height>475</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>680</width>
|
||||
<width>750</width>
|
||||
<height>1028</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -35,11 +35,16 @@
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>11</y>
|
||||
<width>730</width>
|
||||
<height>480</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="decodedTextLabel">
|
||||
<property name="minimumSize">
|
||||
@ -122,30 +127,32 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>UTC Sync dB DT Freq Dr </string>
|
||||
<string>UTC dB DT Freq Dr </string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>5</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="DisplayText" name="decodedTextBrowser">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>421</width>
|
||||
<width>360</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>1000</width>
|
||||
<width>360</width>
|
||||
<height>1000</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -162,7 +169,7 @@
|
||||
<enum>Qt::ScrollBarAlwaysOn</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="html">
|
||||
<string notr="true"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
@ -179,6 +186,40 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="DisplayText" name="decodedTextBrowser2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>360</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>360</width>
|
||||
<height>1000</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Courier New</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOn</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
@ -328,14 +369,14 @@ p, li { white-space: pre-wrap; }
|
||||
<item row="3" column="9">
|
||||
<widget class="QLineEdit" name="tx3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>160</horstretch>
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>200</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<width>200</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -444,6 +485,12 @@ p, li { white-space: pre-wrap; }
|
||||
</item>
|
||||
<item row="5" column="7" rowspan="2">
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>107</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
@ -621,7 +668,7 @@ p, li { white-space: pre-wrap; }
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<width>107</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -693,10 +740,10 @@ p, li { white-space: pre-wrap; }
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
@ -832,14 +879,14 @@ p, li { white-space: pre-wrap; }
|
||||
<item row="6" column="9">
|
||||
<widget class="QLineEdit" name="tx6">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>160</horstretch>
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>200</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<width>200</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -1024,14 +1071,14 @@ p, li { white-space: pre-wrap; }
|
||||
<item row="1" column="9">
|
||||
<widget class="QLineEdit" name="tx1">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>160</horstretch>
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>200</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<width>200</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -1139,14 +1186,14 @@ p, li { white-space: pre-wrap; }
|
||||
<item row="5" column="9">
|
||||
<widget class="QLineEdit" name="tx5">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>160</horstretch>
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>200</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<width>200</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -1155,14 +1202,14 @@ p, li { white-space: pre-wrap; }
|
||||
<item row="4" column="9">
|
||||
<widget class="QLineEdit" name="tx4">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>160</horstretch>
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>200</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<width>200</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -1184,14 +1231,14 @@ p, li { white-space: pre-wrap; }
|
||||
<item row="2" column="9">
|
||||
<widget class="QLineEdit" name="tx2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>160</horstretch>
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>200</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<width>200</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -1200,14 +1247,14 @@ p, li { white-space: pre-wrap; }
|
||||
<item row="0" column="9">
|
||||
<widget class="QPushButton" name="genStdMsgsPushButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>200</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -1677,15 +1724,14 @@ p, li { white-space: pre-wrap; }
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menuBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>680</width>
|
||||
<width>750</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
Loading…
x
Reference in New Issue
Block a user