2018-08-25 11:19:43 -04:00
|
|
|
#include "colorhighlighting.h"
|
|
|
|
#include "ui_colorhighlighting.h"
|
2018-08-25 15:37:30 -04:00
|
|
|
#include "SettingsGroup.hpp"
|
2018-08-25 11:19:43 -04:00
|
|
|
|
2018-08-25 11:52:41 -04:00
|
|
|
#include <QApplication>
|
2018-08-25 11:19:43 -04:00
|
|
|
#include <QDebug>
|
|
|
|
|
2018-08-25 15:37:30 -04:00
|
|
|
ColorHighlighting::ColorHighlighting(QSettings *settings, QWidget *parent) :
|
2018-08-25 11:19:43 -04:00
|
|
|
QDialog(parent),
|
2018-08-25 15:37:30 -04:00
|
|
|
settings_ {settings},
|
2018-08-25 11:19:43 -04:00
|
|
|
ui(new Ui::ColorHighlighting)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2018-08-25 15:37:30 -04:00
|
|
|
read_settings ();
|
2018-08-25 11:19:43 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
ColorHighlighting::~ColorHighlighting()
|
|
|
|
{
|
2018-08-25 15:37:30 -04:00
|
|
|
if (isVisible ()) write_settings ();
|
2018-08-25 11:19:43 -04:00
|
|
|
delete ui;
|
|
|
|
}
|
2018-08-25 11:52:41 -04:00
|
|
|
|
2018-08-25 15:37:30 -04:00
|
|
|
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)
|
2018-08-25 11:52:41 -04:00
|
|
|
{
|
|
|
|
setWindowTitle(QApplication::applicationName() + " - Colors");
|
2018-08-25 15:37:30 -04:00
|
|
|
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()));
|
2018-08-25 11:52:41 -04:00
|
|
|
}
|