From f1261076be366655d6b4c71b3a2a2a1de84a76eb Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 25 Aug 2018 11:19:43 -0400 Subject: [PATCH 1/5] Starting to implement a color-highlighting reminder window. --- CMakeLists.txt | 2 ++ colorhighlighting.cpp | 18 ++++++++++++++++++ colorhighlighting.h | 22 ++++++++++++++++++++++ colorhighlighting.ui | 18 ++++++++++++++++++ mainwindow.cpp | 14 +++++++++++++- mainwindow.h | 4 +++- mainwindow.ui | 6 ++++++ wsjtx.pro | 9 ++++++--- 8 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 colorhighlighting.cpp create mode 100644 colorhighlighting.h create mode 100644 colorhighlighting.ui diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b1ed3a0e..258965d28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -302,6 +302,7 @@ set (wsjtx_CXXSRCS about.cpp astro.cpp messageaveraging.cpp + colorhighlighting.cpp WsprTxScheduler.cpp mainwindow.cpp Configuration.cpp @@ -689,6 +690,7 @@ set (wsjtx_UISRCS mainwindow.ui about.ui astro.ui + colorhighlighting.ui echograph.ui fastgraph.ui messageaveraging.ui diff --git a/colorhighlighting.cpp b/colorhighlighting.cpp new file mode 100644 index 000000000..47865da09 --- /dev/null +++ b/colorhighlighting.cpp @@ -0,0 +1,18 @@ +#include "colorhighlighting.h" +#include "ui_colorhighlighting.h" + +#include + +ColorHighlighting::ColorHighlighting(QWidget *parent) : + QDialog(parent), + ui(new Ui::ColorHighlighting) +{ + qDebug() << "AA"; + ui->setupUi(this); + qDebug() << "BB"; +} + +ColorHighlighting::~ColorHighlighting() +{ + delete ui; +} diff --git a/colorhighlighting.h b/colorhighlighting.h new file mode 100644 index 000000000..7a51b8b97 --- /dev/null +++ b/colorhighlighting.h @@ -0,0 +1,22 @@ +#ifndef COLORHIGHLIGHTING_H +#define COLORHIGHLIGHTING_H + +#include + +namespace Ui { +class ColorHighlighting; +} + +class ColorHighlighting : public QDialog +{ + Q_OBJECT + +public: + explicit ColorHighlighting(QWidget *parent = 0); + ~ColorHighlighting(); + +private: + Ui::ColorHighlighting *ui; +}; + +#endif // COLORHIGHLIGHTING_H diff --git a/colorhighlighting.ui b/colorhighlighting.ui new file mode 100644 index 000000000..b560a01b0 --- /dev/null +++ b/colorhighlighting.ui @@ -0,0 +1,18 @@ + + ColorHighlighting + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + diff --git a/mainwindow.cpp b/mainwindow.cpp index 496c31b76..6feba786d 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -39,6 +39,7 @@ #include "fastgraph.h" #include "about.h" #include "messageaveraging.h" +#include "colorhighlighting.h" #include "widegraph.h" #include "sleep.h" #include "logqso.h" @@ -2372,6 +2373,18 @@ void MainWindow::on_actionFox_Log_triggered() m_msgAvgWidget->foxLogSetup(); } +void MainWindow::on_actionColors_triggered() +{ + qDebug() << "aa"; + if (!m_colorHighlighting) { + m_colorHighlighting.reset (new ColorHighlighting); + } + m_colorHighlighting->showNormal(); + m_colorHighlighting->raise (); + m_colorHighlighting->activateWindow (); + qDebug() << "bb"; +} + void MainWindow::on_actionMessage_averaging_triggered() { if (!m_msgAvgWidget) @@ -5163,7 +5176,6 @@ void MainWindow::cabLog() if(m_freqNominal>50000000) nfreq=m_freqNominal/1000000; QString t; t.sprintf("QSO: %5d RY ",nfreq); - qDebug() << t; t=t + QDateTime::currentDateTimeUtc().toString("yyyy-MM-dd hhmm ") + m_config.my_callsign().leftJustified(13,' ') + m_xSent.leftJustified(14,' ') + m_hisCall.leftJustified(13,' ') + m_xRcvd; diff --git a/mainwindow.h b/mainwindow.h index 86e4ef13b..94f009871 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -68,6 +68,7 @@ class WideGraph; class LogQSO; class Transceiver; class MessageAveraging; +class ColorHighlighting; class MessageClient; class QTime; class WSPRBandHopping; @@ -243,6 +244,7 @@ private slots: void auto_tx_mode(bool); void on_actionMessage_averaging_triggered(); void on_actionFox_Log_triggered(); + void on_actionColors_triggered(); void on_actionInclude_averaging_toggled (bool); void on_actionInclude_correlation_toggled (bool); void on_actionEnable_AP_DXcall_toggled (bool); @@ -356,7 +358,7 @@ private: QScopedPointer m_prefixes; QScopedPointer m_mouseCmnds; QScopedPointer m_msgAvgWidget; - + QScopedPointer m_colorHighlighting; Transceiver::TransceiverState m_rigState; Frequency m_lastDialFreq; QString m_lastBand; diff --git a/mainwindow.ui b/mainwindow.ui index 9d85918b3..5b6dc38b0 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -2637,6 +2637,7 @@ QPushButton[state="ok"] { + @@ -3298,6 +3299,11 @@ QPushButton[state="ok"] { Erase cabrillo.log + + + Color highlighting scheme + + diff --git a/wsjtx.pro b/wsjtx.pro index 1a327c919..353bd4aea 100644 --- a/wsjtx.pro +++ b/wsjtx.pro @@ -67,7 +67,8 @@ SOURCES += \ echoplot.cpp echograph.cpp fastgraph.cpp fastplot.cpp Modes.cpp \ WSPRBandHopping.cpp MessageAggregator.cpp SampleDownloader.cpp qt_helpers.cpp\ MultiSettings.cpp PhaseEqualizationDialog.cpp IARURegions.cpp MessageBox.cpp \ - EqualizationToolsDialog.cpp + EqualizationToolsDialog.cpp \ + colorhighlighting.cpp HEADERS += qt_helpers.hpp \ pimpl_h.hpp pimpl_impl.hpp \ @@ -83,7 +84,8 @@ HEADERS += qt_helpers.hpp \ logbook/logbook.h logbook/countrydat.h logbook/countriesworked.h logbook/adif.h \ messageaveraging.h echoplot.h echograph.h fastgraph.h fastplot.h Modes.hpp WSPRBandHopping.hpp \ WsprTxScheduler.h SampleDownloader.hpp MultiSettings.hpp PhaseEqualizationDialog.hpp \ - IARURegions.hpp MessageBox.hpp EqualizationToolsDialog.hpp + IARURegions.hpp MessageBox.hpp EqualizationToolsDialog.hpp \ + colorhighlighting.h INCLUDEPATH += qmake_only @@ -95,7 +97,8 @@ HEADERS += OmniRigTransceiver.hpp FORMS += mainwindow.ui about.ui Configuration.ui widegraph.ui astro.ui \ logqso.ui wf_palette_design_dialog.ui messageaveraging.ui echograph.ui \ - fastgraph.ui + fastgraph.ui \ + colorhighlighting.ui RC_FILE = wsjtx.rc RESOURCES = wsjtx.qrc From 52e733d31d3bb53ad77678bdcb456d5f9bd4d8cc Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 25 Aug 2018 11:52:41 -0400 Subject: [PATCH 2/5] More work on a color-highlighting window. --- colorhighlighting.cpp | 8 ++++++-- colorhighlighting.h | 1 + mainwindow.cpp | 3 +-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/colorhighlighting.cpp b/colorhighlighting.cpp index 47865da09..1f217c31d 100644 --- a/colorhighlighting.cpp +++ b/colorhighlighting.cpp @@ -1,18 +1,22 @@ #include "colorhighlighting.h" #include "ui_colorhighlighting.h" +#include #include ColorHighlighting::ColorHighlighting(QWidget *parent) : QDialog(parent), ui(new Ui::ColorHighlighting) { - qDebug() << "AA"; ui->setupUi(this); - qDebug() << "BB"; } ColorHighlighting::~ColorHighlighting() { delete ui; } + +void ColorHighlighting::colorHighlightlingSetup() +{ + setWindowTitle(QApplication::applicationName() + " - Colors"); +} diff --git a/colorhighlighting.h b/colorhighlighting.h index 7a51b8b97..a7e1c4ba4 100644 --- a/colorhighlighting.h +++ b/colorhighlighting.h @@ -14,6 +14,7 @@ class ColorHighlighting : public QDialog public: explicit ColorHighlighting(QWidget *parent = 0); ~ColorHighlighting(); + void colorHighlightlingSetup(); private: Ui::ColorHighlighting *ui; diff --git a/mainwindow.cpp b/mainwindow.cpp index 6feba786d..c07823f64 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -2375,14 +2375,13 @@ void MainWindow::on_actionFox_Log_triggered() void MainWindow::on_actionColors_triggered() { - qDebug() << "aa"; if (!m_colorHighlighting) { m_colorHighlighting.reset (new ColorHighlighting); } m_colorHighlighting->showNormal(); m_colorHighlighting->raise (); m_colorHighlighting->activateWindow (); - qDebug() << "bb"; + m_colorHighlighting->colorHighlightlingSetup(); } void MainWindow::on_actionMessage_averaging_triggered() From 847327cf3273b6569c9aee64fa237bf423368b98 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 25 Aug 2018 15:37:30 -0400 Subject: [PATCH 3/5] Finish implementing the color-highlighting window. --- Configuration.ui | 8 +- colorhighlighting.cpp | 33 ++++++++- colorhighlighting.h | 11 ++- colorhighlighting.ui | 166 +++++++++++++++++++++++++++++++++++++++++- mainwindow.cpp | 10 ++- 5 files changed, 213 insertions(+), 15 deletions(-) diff --git a/Configuration.ui b/Configuration.ui index 9eb94ee8e..bf58ac3fc 100644 --- a/Configuration.ui +++ b/Configuration.ui @@ -3111,12 +3111,12 @@ soundcard changes - - - + + + - + diff --git a/colorhighlighting.cpp b/colorhighlighting.cpp index 1f217c31d..5fd8803ff 100644 --- a/colorhighlighting.cpp +++ b/colorhighlighting.cpp @@ -1,22 +1,51 @@ #include "colorhighlighting.h" #include "ui_colorhighlighting.h" +#include "SettingsGroup.hpp" #include #include -ColorHighlighting::ColorHighlighting(QWidget *parent) : +ColorHighlighting::ColorHighlighting(QSettings *settings, QWidget *parent) : QDialog(parent), + settings_ {settings}, ui(new Ui::ColorHighlighting) { ui->setupUi(this); + read_settings (); } ColorHighlighting::~ColorHighlighting() { + if (isVisible ()) write_settings (); delete ui; } -void ColorHighlighting::colorHighlightlingSetup() +void ColorHighlighting::read_settings () +{ + SettingsGroup group {settings_, "ColorScheme"}; + restoreGeometry (settings_->value ("window/geometry").toByteArray ()); +} + +void ColorHighlighting::write_settings () +{ + SettingsGroup group {settings_, "ColorScheme"}; + settings_->setValue ("window/geometry", saveGeometry ()); +} + + +void ColorHighlighting::colorHighlightlingSetup(QColor color_CQ,QColor color_MyCall, + QColor color_DXCC,QColor color_DXCCband,QColor color_NewCall, + QColor color_NewCallBand,QColor color_NewGrid,QColor color_NewGridBand, + QColor color_TxMsg) { setWindowTitle(QApplication::applicationName() + " - Colors"); + ui->label->setStyleSheet(QString("background: %1").arg(color_CQ.name())); + ui->label_3->setStyleSheet(QString("background: %1").arg(color_MyCall.name())); + ui->label_5->setStyleSheet(QString("background: %1").arg(color_TxMsg.name())); + ui->label_7->setStyleSheet(QString("background: %1").arg(color_DXCC.name())); + ui->label_9->setStyleSheet(QString("background: %1").arg(color_DXCCband.name())); + ui->label_11->setStyleSheet(QString("background: %1").arg(color_NewCall.name())); + ui->label_13->setStyleSheet(QString("background: %1").arg(color_NewCallBand.name())); + ui->label_15->setStyleSheet(QString("background: %1").arg(color_NewGrid.name())); + ui->label_17->setStyleSheet(QString("background: %1").arg(color_NewGridBand.name())); } diff --git a/colorhighlighting.h b/colorhighlighting.h index a7e1c4ba4..3b612a27f 100644 --- a/colorhighlighting.h +++ b/colorhighlighting.h @@ -2,6 +2,7 @@ #define COLORHIGHLIGHTING_H #include +#include namespace Ui { class ColorHighlighting; @@ -12,11 +13,17 @@ class ColorHighlighting : public QDialog Q_OBJECT public: - explicit ColorHighlighting(QWidget *parent = 0); + explicit ColorHighlighting(QSettings *, QWidget *parent = 0); ~ColorHighlighting(); - void colorHighlightlingSetup(); + void colorHighlightlingSetup(QColor color_CQ,QColor color_MyCall, + QColor color_DXCC,QColor color_DXCCband,QColor color_NewCall, + QColor color_NewCallBand,QColor color_NewGrid,QColor color_NewGridBand, + QColor color_TxMsg); private: + QSettings * settings_; + void read_settings (); + void write_settings (); Ui::ColorHighlighting *ui; }; diff --git a/colorhighlighting.ui b/colorhighlighting.ui index b560a01b0..b7865c465 100644 --- a/colorhighlighting.ui +++ b/colorhighlighting.ui @@ -1,17 +1,177 @@ + ColorHighlighting - + 0 0 - 400 - 300 + 196 + 265 Dialog + + + + + + + K1ABC + + + Qt::AlignCenter + + + + + + + CQ in message + + + + + + + K1ABC + + + Qt::AlignCenter + + + + + + + My Call in message + + + + + + + K1ABC + + + Qt::AlignCenter + + + + + + + Transmitted message + + + + + + + K1ABC + + + Qt::AlignCenter + + + + + + + New DXCC + + + + + + + K1ABC + + + Qt::AlignCenter + + + + + + + New DXCC on Band + + + + + + + K1ABC + + + Qt::AlignCenter + + + + + + + New Call + + + + + + + K1ABC + + + Qt::AlignCenter + + + + + + + New Call on Band + + + + + + + K1ABC + + + Qt::AlignCenter + + + + + + + New Grid + + + + + + + K1ABC + + + Qt::AlignCenter + + + + + + + New Grid on Band + + + + + + diff --git a/mainwindow.cpp b/mainwindow.cpp index c07823f64..351cafe82 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -2166,6 +2166,7 @@ void MainWindow::closeEvent(QCloseEvent * e) m_prefixes.reset (); m_shortcuts.reset (); m_mouseCmnds.reset (); + m_colorHighlighting.reset(); if(m_mode!="MSK144" and m_mode!="FT8") killFile(); float sw=0.0; int nw=400; @@ -2179,9 +2180,7 @@ void MainWindow::closeEvent(QCloseEvent * e) bool b=proc_jt9.waitForFinished(1000); if(!b) proc_jt9.close(); quitFile.remove(); - Q_EMIT finished (); - QMainWindow::closeEvent (e); } @@ -2376,12 +2375,15 @@ void MainWindow::on_actionFox_Log_triggered() void MainWindow::on_actionColors_triggered() { if (!m_colorHighlighting) { - m_colorHighlighting.reset (new ColorHighlighting); + m_colorHighlighting.reset (new ColorHighlighting {m_settings}); } m_colorHighlighting->showNormal(); m_colorHighlighting->raise (); m_colorHighlighting->activateWindow (); - m_colorHighlighting->colorHighlightlingSetup(); + m_colorHighlighting->colorHighlightlingSetup(m_config.color_CQ(),m_config.color_MyCall(), + m_config.color_DXCC(),m_config.color_DXCCband(),m_config.color_NewCall(), + m_config.color_NewCallBand(),m_config.color_NewGrid(),m_config.color_NewGridBand(), + m_config.color_TxMsg()); } void MainWindow::on_actionMessage_averaging_triggered() From 266c903a8f14ce7770ea62f7ec53505944dec897 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 25 Aug 2018 15:45:07 -0400 Subject: [PATCH 4/5] Re-order the displayed colors for New DXCC, etc. --- Configuration.ui | 127 +++++++++++++++--------------- colorhighlighting.ui | 182 +++++++++++++++++++++---------------------- 2 files changed, 154 insertions(+), 155 deletions(-) diff --git a/Configuration.ui b/Configuration.ui index bf58ac3fc..f87bbedd0 100644 --- a/Configuration.ui +++ b/Configuration.ui @@ -2176,32 +2176,6 @@ Right click for insert and delete options. - - - - QLabel{background-color: #99ffff} - - - K1ABC - - - Qt::AlignCenter - - - - - - - QLabel{background-color: #ff8000} - - - K1ABC - - - Qt::AlignCenter - - - @@ -2216,19 +2190,6 @@ Right click for insert and delete options. - - - - QLabel{background-color: #ffcc99} - - - K1ABC - - - Qt::AlignCenter - - - @@ -2236,27 +2197,6 @@ Right click for insert and delete options. - - - - New Call on Band - - - - - - - New grid - - - - - - - New Grid on Band - - - @@ -2385,7 +2325,27 @@ Right click for insert and delete options. + + + + Reset Defaults + + + + + + QLabel{background-color: #ff8000} + + + K1ABC + + + Qt::AlignCenter + + + + @@ -2404,7 +2364,40 @@ Right click for insert and delete options. + + + + QLabel{background-color: #ffcc99} + + + K1ABC + + + Qt::AlignCenter + + + + + + + QLabel{background-color: #99ffff} + + + K1ABC + + + Qt::AlignCenter + + + + + + New grid + + + + @@ -2417,10 +2410,17 @@ Right click for insert and delete options. - - + + - Reset Defaults + New Grid on Band + + + + + + + New Call on Band @@ -3033,7 +3033,6 @@ soundcard changes pbMyCall pbTxMsg pbNewDXCC - pbNewCall sbNtrials sbAggressive cbTwoPass diff --git a/colorhighlighting.ui b/colorhighlighting.ui index b7865c465..65f46bd78 100644 --- a/colorhighlighting.ui +++ b/colorhighlighting.ui @@ -16,6 +16,81 @@ + + + + K1ABC + + + Qt::AlignCenter + + + + + + + K1ABC + + + Qt::AlignCenter + + + + + + + K1ABC + + + Qt::AlignCenter + + + + + + + K1ABC + + + Qt::AlignCenter + + + + + + + New Call + + + + + + + New Call on Band + + + + + + + New Grid + + + + + + + New Grid on Band + + + + + + + Transmitted message + + + @@ -26,15 +101,8 @@ - - - - CQ in message - - - - - + + K1ABC @@ -43,13 +111,6 @@ - - - - My Call in message - - - @@ -60,15 +121,8 @@ - - - - Transmitted message - - - - - + + K1ABC @@ -84,16 +138,6 @@ - - - - K1ABC - - - Qt::AlignCenter - - - @@ -101,8 +145,15 @@ - - + + + + My Call in message + + + + + K1ABC @@ -111,61 +162,10 @@ - - + + - New Call - - - - - - - K1ABC - - - Qt::AlignCenter - - - - - - - New Call on Band - - - - - - - K1ABC - - - Qt::AlignCenter - - - - - - - New Grid - - - - - - - K1ABC - - - Qt::AlignCenter - - - - - - - New Grid on Band + CQ in message From 110b4a8d1d347499c2b73486c63482635128470e Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 25 Aug 2018 19:03:03 -0400 Subject: [PATCH 5/5] Make the colors window just a tad wider. --- colorhighlighting.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/colorhighlighting.ui b/colorhighlighting.ui index 65f46bd78..933c363f6 100644 --- a/colorhighlighting.ui +++ b/colorhighlighting.ui @@ -6,7 +6,7 @@ 0 0 - 196 + 212 265