From 87cdc7f7e7e2072238f2a2cd05d6587e1dbc7ff4 Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Sat, 10 Mar 2018 16:59:09 -0500 Subject: [PATCH] Reorganize main window and style meter --- mainwindow.cpp | 4 +- mainwindow.ui | 1144 +++++++++++++++++++++++++++----------------- meterwidget.cpp | 12 +- revision_utils.cpp | 2 +- signalmeter.cpp | 9 +- wsjtx.pro.user | 2 +- 6 files changed, 718 insertions(+), 455 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 608b61b..f760f9b 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -294,7 +294,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, wsprNet {new WSPRNet {&m_network_manager, this}}, m_appDir {QApplication::applicationDirPath ()}, m_palette {"Linrad"}, - m_mode {"JT9"}, + m_mode {"FT8"}, m_rpt {"-15"}, m_pfx { "1A", "1S", @@ -838,7 +838,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, if(m_bFast9) m_bFastMode=true; ui->cbFast9->setChecked(m_bFast9 or m_bFastMode); - if(m_mode=="FT8") on_actionFT8_triggered(); + if(true || m_mode=="FT8") on_actionFT8_triggered(); if(m_mode=="JT4") on_actionJT4_triggered(); if(m_mode=="JT9") on_actionJT9_triggered(); if(m_mode=="JT65") on_actionJT65_triggered(); diff --git a/mainwindow.ui b/mainwindow.ui index fa4183e..700327b 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -6,8 +6,8 @@ 0 0 - 974 - 563 + 1195 + 709 @@ -17,15 +17,703 @@ - + + + 4 + + + 4 + + + 4 + + + 4 + + + 4 + - - - - 0 - 100 - + + + QFrame::Plain + + Qt::Vertical + + + true + + + 4 + + + true + + + + + 0 + 0 + + + + + 0 + 100 + + + + Qt::Horizontal + + + 4 + + + + Qt::Vertical + + + 4 + + + + + 0 + 0 + + + + + true + + + + true + + + QTextEdit { background:rgb(255, 250, 205); } + + + true + + + + + + + + + 0 + 0 + + + + QTextEdit { background:rgb(255, 255, 255); } + + + false + + + Type your outgoing messages / commands here. + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + + 16777215 + 16777215 + + + + QListWidget { background:rgb(255, 255, 255); } + + + + allcall + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + + <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> + + + true + + + QComboBox::NoInsert + + + QComboBox::AdjustToMinimumContentsLength + + + + + + + + 0 + 0 + + + + QFrame::NoFrame + + + QFrame::Plain + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + QFrame::NoFrame + + + QFrame::Plain + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + false + + + background-color:rgb(0,0,0); + + + QFrame::NoFrame + + + QFrame::Plain + + + + + + + 0 + 0 + + + + USB dial frequency + + + QLabel { + font-family: MS Shell Dlg 2; + font-size: 20pt; + color : white; + background-color : black; +} +QLabel[oob="true"] { + background-color: red; +} + + + + 14.078 000 + + + Qt::AlignCenter + + + 5 + + + + + + + + 0 + 0 + + + + QLabel { + font-family: MS Shell Dlg 2; + font-size: 12pt; + background-color : black; + color : white; +} + + + QFrame::StyledPanel + + + QFrame::Sunken + + + 2 + + + 0 + + + <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> + + + Qt::AlignCenter + + + 5 + + + + + + + + + + + 0 + 0 + + + + background-color:rgb(0,0,0); + + + QFrame::NoFrame + + + QFrame::Plain + + + + + + false + + + <html><head/><body><p>If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode.</p></body></html> + + + QPushButton { +font-family: helvetica; +font-size: 9pt; +font-weight: bold; +background-color: white; +color: black; +border-style: solid; +border-width:0px; +border-color: gray; +max-height:20px; +min-width:20px; +min-height:20px; +max-width:40px; +} +QPushButton[state="error"] { +background-color: red; +} +QPushButton[state="warning"] { +background-color: orange; +} +QPushButton[state="ok"] { +background-color: #00ff00; +} + + + CAT + + + + + + + true + + + QPushButton { +font-family: helvetica; +font-size: 9pt; +font-weight: bold; +background-color: lightgray; +color: black; +border-style: solid; +border-width:0px; +border-color: gray; +max-height:20px; +min-width:20px; +min-height:20px; +max-width:40px; +} +QPushButton[state="error"] { +background-color: red; +} +QPushButton[state="warning"] { +background-color: orange; +} +QPushButton[state="ok"] { +background-color: #00ff00; +} +QPushButton:checked { +background-color: #00ff00; +} + + + RX + + + true + + + + + + + false + + + QPushButton { +font-family: helvetica; +font-size: 9pt; +font-weight: bold; +background-color: lightgray; +color: black; +border-style: solid; +border-width:0px; +border-color: gray; +max-height:20px; +min-width:20px; +min-height:20px; +max-width:40px; +} +QPushButton[state="error"] { +background-color: red; +} +QPushButton[state="warning"] { +background-color: orange; +} +QPushButton[state="ok"] { +background-color: #00ff00; +} +QPushButton:checked { +background-color: #00ff00; +} + + + TX + + + true + + + + + + + true + + + QPushButton { +font-family: helvetica; +font-size: 9pt; +font-weight: bold; +background-color: lightgray; +color: black; +border-style: solid; +border-width:0px; +border-color: gray; +max-height:20px; +min-width:20px; +min-height:20px; +max-width:40px; +} +QPushButton[state="error"] { +background-color: red; +} +QPushButton[state="warning"] { +background-color: orange; +} +QPushButton[state="ok"] { +background-color: #00ff00; +} +QPushButton:checked { +background-color: yellow; +} + + + TUNE + + + true + + + + + + + true + + + QPushButton { +font-family: helvetica; +font-size: 9pt; +font-weight: bold; +background-color: lightgray; +color: black; +border-style: solid; +border-width:0px; +border-color: gray; +max-height:20px; +min-width:20px; +min-height:20px; +max-width:40px; +} +QPushButton[state="error"] { +background-color: red; +} +QPushButton[state="warning"] { +background-color: orange; +} +QPushButton[state="ok"] { +background-color: #00ff00; +} +QPushButton:checked { +background-color: #6699ff; +} + + + BCN + + + true + + + + + + + true + + + QPushButton { +font-family: helvetica; +font-size: 9pt; +font-weight: bold; +background-color: lightgray; +color: black; +border-style: solid; +border-width:0px; +border-color: gray; +max-height:20px; +min-width:20px; +min-height:20px; +max-width:40px; +} +QPushButton[state="error"] { +background-color: red; +} +QPushButton[state="warning"] { +background-color: orange; +} +QPushButton[state="ok"] { +background-color: #00ff00; +} + + + HALT + + + + + monitorButton + readFreq + beaconButton + autoButton + stopTxButton + tuneButton + + + + + + + + + + 0 + 0 + + + + + 75 + 0 + + + + + 16777215 + 16777215 + + + + <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html> + + + background-color:black; + + + QFrame::NoFrame + + + QFrame::Plain + + + + + + + + + + + + + 0 + 0 + + + + + 0 + 50 + + + + QFrame::Plain + + + + + 0 + 0 + 0 + + + + + + + + + + + Adjust Tx audio level + + + selection-background-color: rgb(70, 70, 70); + + + 450 + + + 0 + + + Qt::Vertical + + + true + + + true + + + QSlider::TicksBothSides + + + 50 + + + + + + + @@ -2535,438 +3223,6 @@ list. The list can be maintained in Settings (F2). - - - - - - - 0 - 0 - - - - - 100 - 16777215 - - - - <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html> - - - QFrame::Panel - - - QFrame::Sunken - - - - - - - - - <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> - - - true - - - QComboBox::NoInsert - - - QComboBox::AdjustToMinimumContentsLength - - - - - - - - 0 - 0 - - - - false - - - background-color:rgb(0,0,0); - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - 0 - 0 - - - - USB dial frequency - - - QLabel { - font-family: MS Shell Dlg 2; - font-size: 20pt; - color : white; - background-color : black; -} -QLabel[oob="true"] { - background-color: red; -} - - - - 14.078 000 - - - Qt::AlignCenter - - - 5 - - - - - - - - 0 - 0 - - - - QLabel { - font-family: MS Shell Dlg 2; - font-size: 12pt; - background-color : black; - color : white; -} - - - QFrame::StyledPanel - - - QFrame::Sunken - - - 2 - - - 0 - - - <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> - - - Qt::AlignCenter - - - 5 - - - - - - - - - false - - - <html><head/><body><p>If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode.</p></body></html> - - - QPushButton { -font-family: helvetica; -font-size: 9pt; -font-weight: bold; -background-color: white; -color: black; -border-style: solid; -border-width:0px; -border-color: gray; -max-height:20px; -min-width:20px; -min-height:20px; -max-width:40px; -} -QPushButton[state="error"] { -background-color: red; -} -QPushButton[state="warning"] { -background-color: orange; -} -QPushButton[state="ok"] { -background-color: #00ff00; -} - - - CAT - - - - - - - true - - - QPushButton { -font-family: helvetica; -font-size: 9pt; -font-weight: bold; -background-color: lightgray; -color: black; -border-style: solid; -border-width:0px; -border-color: gray; -max-height:20px; -min-width:20px; -min-height:20px; -max-width:40px; -} -QPushButton[state="error"] { -background-color: red; -} -QPushButton[state="warning"] { -background-color: orange; -} -QPushButton[state="ok"] { -background-color: #00ff00; -} -QPushButton:checked { -background-color: #00ff00; -} - - - RX - - - true - - - - - - - false - - - QPushButton { -font-family: helvetica; -font-size: 9pt; -font-weight: bold; -background-color: lightgray; -color: black; -border-style: solid; -border-width:0px; -border-color: gray; -max-height:20px; -min-width:20px; -min-height:20px; -max-width:40px; -} -QPushButton[state="error"] { -background-color: red; -} -QPushButton[state="warning"] { -background-color: orange; -} -QPushButton[state="ok"] { -background-color: #00ff00; -} -QPushButton:checked { -background-color: #00ff00; -} - - - TX - - - true - - - - - - - true - - - QPushButton { -font-family: helvetica; -font-size: 9pt; -font-weight: bold; -background-color: lightgray; -color: black; -border-style: solid; -border-width:0px; -border-color: gray; -max-height:20px; -min-width:20px; -min-height:20px; -max-width:40px; -} -QPushButton[state="error"] { -background-color: red; -} -QPushButton[state="warning"] { -background-color: orange; -} -QPushButton[state="ok"] { -background-color: #00ff00; -} -QPushButton:checked { -background-color: yellow; -} - - - TUNE - - - true - - - - - - - true - - - QPushButton { -font-family: helvetica; -font-size: 9pt; -font-weight: bold; -background-color: lightgray; -color: black; -border-style: solid; -border-width:0px; -border-color: gray; -max-height:20px; -min-width:20px; -min-height:20px; -max-width:40px; -} -QPushButton[state="error"] { -background-color: red; -} -QPushButton[state="warning"] { -background-color: orange; -} -QPushButton[state="ok"] { -background-color: #00ff00; -} -QPushButton:checked { -background-color: #6699ff; -} - - - BCN - - - true - - - - - - - true - - - QPushButton { -font-family: helvetica; -font-size: 9pt; -font-weight: bold; -background-color: lightgray; -color: black; -border-style: solid; -border-width:0px; -border-color: gray; -max-height:20px; -min-width:20px; -min-height:20px; -max-width:40px; -} -QPushButton[state="error"] { -background-color: red; -} -QPushButton[state="warning"] { -background-color: orange; -} -QPushButton[state="ok"] { -background-color: #00ff00; -} - - - HALT - - - - - - - - - - - - - - - - - - - Pwr - - - - - - - Adjust Tx audio level - - - selection-background-color: rgb(70, 70, 70); - - - 450 - - - 0 - - - Qt::Vertical - - - true - - - true - - - QSlider::TicksBothSides - - - 50 - - - - - - - @@ -2974,7 +3230,7 @@ background-color: #00ff00; 0 0 - 974 + 1195 27 @@ -3705,13 +3961,9 @@ background-color: #00ff00; logQSOButton stopButton - monitorButton EraseButton ClrAvgButton DecodeButton - autoButton - stopTxButton - tuneButton dxCallEntry dxGridEntry lookupButton diff --git a/meterwidget.cpp b/meterwidget.cpp index 9e441a1..ff4f577 100644 --- a/meterwidget.cpp +++ b/meterwidget.cpp @@ -57,12 +57,14 @@ void MeterWidget::paintEvent (QPaintEvent * event) auto const& target = contentsRect (); QRect r {QPoint {target.left (), static_cast (target.top () + target.height () - m_signal / (double)MAXDB * target.height ())} , QPoint {target.right (), target.bottom ()}}; - p.setBrush (QColor(85,170,85)); + //p.setBrush (QColor(85,170,85)); + p.setBrush (Qt::green); if (m_sigPeak > 85) { p.setBrush(Qt::red); } else if (m_noisePeak < 15) { - p.setBrush(QColor(232,81,0)); + //p.setBrush(QColor(232,81,0)); + p.setBrush(Qt::yellow); } p.drawRect (r); @@ -70,9 +72,11 @@ void MeterWidget::paintEvent (QPaintEvent * event) { // Draw peak hold indicator auto peak = static_cast (target.top () + target.height () - m_noisePeak / (double)MAXDB * target.height ()); - p.setBrush (Qt::black); + //p.setBrush (Qt::black); + p.setBrush (Qt::white); p.translate (target.left (), peak); - p.drawPolygon (QPolygon {{{0, -4}, {0, 4}, {target.width (), 0}}}); + //p.drawPolygon (QPolygon {{{0, -4}, {0, 4}, {target.width (), 0}}}); + p.drawPolygon (QPolygon { { {target.width (), -4}, {target.width (), 4}, {0, 0} } }); } } diff --git a/revision_utils.cpp b/revision_utils.cpp index 81b12a6..2ec5f73 100644 --- a/revision_utils.cpp +++ b/revision_utils.cpp @@ -83,6 +83,6 @@ QString version (bool include_patch) QString program_title (QString const& revision) { - QString id {QCoreApplication::applicationName () + " v" + QCoreApplication::applicationVersion ()}; + QString id {"FT8Call by KN4CRD a derivative of " + QCoreApplication::applicationName () + " v" + QCoreApplication::applicationVersion ()}; return id + " " + revision + " by K1JT"; } diff --git a/signalmeter.cpp b/signalmeter.cpp index d1a27ad..970fe79 100644 --- a/signalmeter.cpp +++ b/signalmeter.cpp @@ -44,6 +44,7 @@ protected: QWidget::paintEvent (event); QPainter p {this}; + p.setPen(Qt::white); auto const& target = contentsRect (); QFontMetrics font_metrics {p.font (), this}; auto font_offset = font_metrics.ascent () / 2; @@ -82,12 +83,18 @@ SignalMeter::SignalMeter (QWidget * parent) m_meter = new MeterWidget; m_meter->setSizePolicy (QSizePolicy::Minimum, QSizePolicy::Minimum); - inner_layout->addWidget (m_meter); + //inner_layout->addWidget (m_meter); m_scale = new Scale; inner_layout->addWidget (m_scale); + // add this second... + inner_layout->addWidget (m_meter); + m_reading = new QLabel(this); + auto p = m_reading->palette(); + p.setColor(m_reading->foregroundRole(), Qt::white); + m_reading->setPalette(p); outer_layout->addLayout (inner_layout); outer_layout->addWidget (m_reading); diff --git a/wsjtx.pro.user b/wsjtx.pro.user index 703ccc3..3b9fee6 100644 --- a/wsjtx.pro.user +++ b/wsjtx.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId