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/Configuration.ui b/Configuration.ui index 4441716da..44a398bbf 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.cpp b/colorhighlighting.cpp new file mode 100644 index 000000000..5fd8803ff --- /dev/null +++ b/colorhighlighting.cpp @@ -0,0 +1,51 @@ +#include "colorhighlighting.h" +#include "ui_colorhighlighting.h" +#include "SettingsGroup.hpp" + +#include +#include + +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::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 new file mode 100644 index 000000000..3b612a27f --- /dev/null +++ b/colorhighlighting.h @@ -0,0 +1,30 @@ +#ifndef COLORHIGHLIGHTING_H +#define COLORHIGHLIGHTING_H + +#include +#include + +namespace Ui { +class ColorHighlighting; +} + +class ColorHighlighting : public QDialog +{ + Q_OBJECT + +public: + explicit ColorHighlighting(QSettings *, QWidget *parent = 0); + ~ColorHighlighting(); + 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; +}; + +#endif // COLORHIGHLIGHTING_H diff --git a/colorhighlighting.ui b/colorhighlighting.ui new file mode 100644 index 000000000..933c363f6 --- /dev/null +++ b/colorhighlighting.ui @@ -0,0 +1,178 @@ + + + ColorHighlighting + + + + 0 + 0 + 212 + 265 + + + + Dialog + + + + + + + + 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 + + + + + + + K1ABC + + + Qt::AlignCenter + + + + + + + K1ABC + + + Qt::AlignCenter + + + + + + + K1ABC + + + Qt::AlignCenter + + + + + + + K1ABC + + + Qt::AlignCenter + + + + + + + New DXCC + + + + + + + New DXCC on Band + + + + + + + My Call in message + + + + + + + K1ABC + + + Qt::AlignCenter + + + + + + + CQ in message + + + + + + + + + + diff --git a/mainwindow.cpp b/mainwindow.cpp index ab0089eef..6f6a2be8e 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" @@ -2165,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; @@ -2178,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); } @@ -2372,6 +2372,20 @@ void MainWindow::on_actionFox_Log_triggered() m_msgAvgWidget->foxLogSetup(); } +void MainWindow::on_actionColors_triggered() +{ + if (!m_colorHighlighting) { + m_colorHighlighting.reset (new ColorHighlighting {m_settings}); + } + m_colorHighlighting->showNormal(); + m_colorHighlighting->raise (); + m_colorHighlighting->activateWindow (); + 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() { if (!m_msgAvgWidget) 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