Finish implementing the color-highlighting window.

This commit is contained in:
Joe Taylor 2018-08-25 15:37:30 -04:00
parent 52e733d31d
commit 847327cf32
5 changed files with 213 additions and 15 deletions

View File

@ -3111,12 +3111,12 @@ soundcard changes</string>
</connection>
</connections>
<buttongroups>
<buttongroup name="CAT_data_bits_button_group"/>
<buttongroup name="TX_mode_button_group"/>
<buttongroup name="CAT_stop_bits_button_group"/>
<buttongroup name="TX_audio_source_button_group"/>
<buttongroup name="CAT_data_bits_button_group"/>
<buttongroup name="CAT_handshake_button_group"/>
<buttongroup name="CAT_stop_bits_button_group"/>
<buttongroup name="split_mode_button_group"/>
<buttongroup name="PTT_method_button_group"/>
<buttongroup name="CAT_handshake_button_group"/>
<buttongroup name="TX_mode_button_group"/>
</buttongroups>
</ui>

View File

@ -1,22 +1,51 @@
#include "colorhighlighting.h"
#include "ui_colorhighlighting.h"
#include "SettingsGroup.hpp"
#include <QApplication>
#include <QDebug>
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()));
}

View File

@ -2,6 +2,7 @@
#define COLORHIGHLIGHTING_H
#include <QDialog>
#include <QSettings>
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;
};

View File

@ -1,17 +1,177 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ColorHighlighting</class>
<widget name="ColorHighlighting" class="QDialog">
<widget class="QDialog" name="ColorHighlighting">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>196</width>
<height>265</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>K1ABC</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_2">
<property name="text">
<string>CQ in message</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>K1ABC</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_4">
<property name="text">
<string>My Call in message</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>K1ABC</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Transmitted message</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>K1ABC</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_8">
<property name="text">
<string>New DXCC</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>K1ABC</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_10">
<property name="text">
<string>New DXCC on Band</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>K1ABC</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_12">
<property name="text">
<string>New Call</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>K1ABC</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLabel" name="label_14">
<property name="text">
<string>New Call on Band</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_15">
<property name="text">
<string>K1ABC</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="label_16">
<property name="text">
<string>New Grid</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_17">
<property name="text">
<string>K1ABC</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLabel" name="label_18">
<property name="text">
<string>New Grid on Band</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>

View File

@ -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()