kopia lustrzana https://github.com/PianetaRadio/CatRadio
rodzic
4b8ea4161c
commit
5ac75cee7c
|
@ -47,7 +47,10 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
|
|||
LIBS += -L$$PWD/hamlib/ -lhamlib
|
||||
INCLUDEPATH += $$PWD/hamlib
|
||||
|
||||
VERSION = 1.2.0
|
||||
RESOURCES += qdarkstyle/dark/darkstyle.qrc
|
||||
# RESOURCES += qdarkstyle/light/lightstyle.qrc
|
||||
|
||||
VERSION = 1.3.0
|
||||
|
||||
RC_ICONS = catradio.ico
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 6.0.2, 2022-10-30T12:38:39. -->
|
||||
<!-- Written by QtCreator 6.0.2, 2022-11-19T20:47:40. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
|
@ -85,6 +85,9 @@
|
|||
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
|
||||
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="CppEditor.QuickFix">
|
||||
<value type="bool" key="UseGlobalSettings">true</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
|
@ -240,8 +243,9 @@
|
|||
<valuelist type="QVariantList" key="CustomOutputParsers"/>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:C:/Users/Johnny/Documents/QT/CatRadio/CatRadio.pro</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">C:/Users/Johnny/Documents/QT/CatRadio/CatRadio.pro</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">CatRadio2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:C:/Users/Johnny/Documents/QT/CatRadio_dark/CatRadio.pro</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">C:/Users/Johnny/Documents/QT/CatRadio_dark/CatRadio.pro</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
||||
|
|
|
@ -3,9 +3,10 @@ CatRadio
|
|||
(+ New, * Updated, - Removed)
|
||||
|
||||
1.3.0 - 2022-xx-xx
|
||||
+ Dark theme
|
||||
+ MIC levels
|
||||
* Bug fix: Sort bandwidth list
|
||||
* General improvements
|
||||
* General GUI and code improvements
|
||||
+ NB2
|
||||
* Bug fix: Sliders
|
||||
+ Sub meter COMP, ID, VDD
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include <QSettings>
|
||||
#include <QFile>
|
||||
#include <QMessageBox>
|
||||
|
||||
|
||||
extern guiConfig guiConf;
|
||||
|
@ -17,6 +18,7 @@ DialogSetup::DialogSetup(QWidget *parent) :
|
|||
ui->setupUi(this);
|
||||
|
||||
if (guiConf.vfoDisplayMode) ui->radioButton_vfoDispMode_UD->setChecked(true);
|
||||
if (guiConf.darkTheme) ui->radioButton_themeDark->setChecked(true);
|
||||
}
|
||||
|
||||
DialogSetup::~DialogSetup()
|
||||
|
@ -24,20 +26,23 @@ DialogSetup::~DialogSetup()
|
|||
delete ui;
|
||||
}
|
||||
|
||||
void DialogSetup::on_radioButton_vfoDispMode_LR_toggled(bool checked)
|
||||
{
|
||||
if (checked) guiConf.vfoDisplayMode=0;
|
||||
}
|
||||
|
||||
void DialogSetup::on_radioButton_vfoDispMode_UD_toggled(bool checked)
|
||||
{
|
||||
if (checked) guiConf.vfoDisplayMode=1;
|
||||
}
|
||||
|
||||
void DialogSetup::on_buttonBox_accepted()
|
||||
{
|
||||
if ((guiConf.darkTheme != ui->radioButton_themeDark->isChecked()))
|
||||
{
|
||||
QMessageBox msgBox;
|
||||
msgBox.setWindowTitle("Theme");
|
||||
msgBox.setText("Please, restart CatRadio to make effective the theme.");
|
||||
msgBox.setIcon(QMessageBox::Information);
|
||||
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||
msgBox.exec();
|
||||
}
|
||||
|
||||
guiConf.vfoDisplayMode = ui->radioButton_vfoDispMode_UD->isChecked();
|
||||
guiConf.darkTheme = ui->radioButton_themeDark->isChecked();
|
||||
|
||||
//* Save settings in catradio.ini
|
||||
QSettings configFile(QString("catradio.ini"), QSettings::IniFormat);
|
||||
configFile.setValue("vfoDisplayMode", guiConf.vfoDisplayMode);
|
||||
configFile.setValue("darkTheme", guiConf.darkTheme);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,12 +16,6 @@ public:
|
|||
~DialogSetup();
|
||||
|
||||
private slots:
|
||||
|
||||
|
||||
void on_radioButton_vfoDispMode_LR_toggled(bool checked);
|
||||
|
||||
void on_radioButton_vfoDispMode_UD_toggled(bool checked);
|
||||
|
||||
void on_buttonBox_accepted();
|
||||
|
||||
private:
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<string>Setup</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
|
@ -50,7 +50,7 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="2" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
@ -63,6 +63,32 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_theme">
|
||||
<property name="title">
|
||||
<string>Theme</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_themeDefault">
|
||||
<property name="text">
|
||||
<string>Default</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_themeDark">
|
||||
<property name="text">
|
||||
<string>Dark</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
typedef struct {
|
||||
int vfoDisplayMode; //0: use Left/Right mouse button, 1: click digit Up or Down
|
||||
bool darkTheme; //flag for Dark theme
|
||||
} guiConfig;
|
||||
|
||||
|
||||
|
|
|
@ -113,6 +113,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
rigCom.rigRefresh = configFile.value("rigRefresh", 100).toInt();
|
||||
rigCom.fullPoll = configFile.value("fullPolling", true).toBool();
|
||||
guiConf.vfoDisplayMode = configFile.value("vfoDisplayMode", 0).toInt();
|
||||
guiConf.darkTheme = configFile.value("darkTheme", false).toBool();
|
||||
//Window settings
|
||||
restoreGeometry(configFile.value("WindowSettings/geometry").toByteArray());
|
||||
restoreState(configFile.value("WindowSettings/state").toByteArray());
|
||||
|
@ -120,6 +121,39 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
//* Style
|
||||
//ui->pushButton_PTT->setStyleSheet("QPushButton::checked {font: bold; color: red;}");
|
||||
|
||||
//Dark theme
|
||||
if (guiConf.darkTheme)
|
||||
{
|
||||
QFile darkStyleFile(":qdarkstyle/dark/darkstyle.qss");
|
||||
|
||||
if (!darkStyleFile.exists()) ui->statusbar->showMessage("Unable to set stylesheet, file not found!");
|
||||
else
|
||||
{
|
||||
darkStyleFile.open(QFile::ReadOnly | QFile::Text);
|
||||
QTextStream ts(&darkStyleFile);
|
||||
qApp->setStyleSheet(ts.readAll());
|
||||
|
||||
ui->progressBar_Smeter->setBgColor(Qt::black);
|
||||
ui->progressBar_Smeter->setScaleColor(Qt::white);
|
||||
ui->progressBar_Smeter->setLineColor(Qt::white);
|
||||
ui->progressBar_Smeter->setProgressColor(QColor(0x66, 0x8f, 0xb8));
|
||||
|
||||
ui->progressBar_subMeter->setBgColor(Qt::black);
|
||||
ui->progressBar_subMeter->setScaleColor(Qt::white);
|
||||
ui->progressBar_subMeter->setLineColor(Qt::white);
|
||||
ui->progressBar_subMeter->setProgressColor(Qt::blue);
|
||||
|
||||
ui->lineEdit_vfoMain->setBgColor(Qt::black);
|
||||
ui->lineEdit_vfoMain->setLineColor(Qt::white);
|
||||
ui->lineEdit_vfoMain->setTextColor(Qt::white);
|
||||
|
||||
ui->lineEdit_vfoSub->setBgColor(Qt::black);
|
||||
ui->lineEdit_vfoSub->setLineColor(Qt::white);
|
||||
ui->lineEdit_vfoSub->setTextColor(Qt::white);
|
||||
}
|
||||
}
|
||||
//Light QFile darkStyleFile(":qdarkstyle/light/lightstyle.qss");
|
||||
|
||||
QApplication::setWheelScrollLines(10); //Mouse wheel scroll step
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>610</width>
|
||||
<height>601</height>
|
||||
<height>605</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
|
@ -1550,6 +1550,11 @@
|
|||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Comp</string>
|
||||
</property>
|
||||
|
@ -1662,6 +1667,11 @@
|
|||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Mon</string>
|
||||
</property>
|
||||
|
|
25
smeter.cpp
25
smeter.cpp
|
@ -26,6 +26,7 @@ SMeter::SMeter(QWidget *parent) : QWidget(parent)
|
|||
lineColor = QColor(Qt::black);
|
||||
bgColor = QColor(Qt::white);
|
||||
progressColor = QColor(Qt::green);
|
||||
scaleColor = QColor(Qt::black);
|
||||
|
||||
//Default value
|
||||
minValue = 0;
|
||||
|
@ -118,7 +119,7 @@ void SMeter::drawProgress(QPainter *painter)
|
|||
void SMeter::drawScalePWRMeter(QPainter *painter)
|
||||
{
|
||||
painter->save();
|
||||
painter->setPen(lineColor);
|
||||
painter->setPen(scaleColor);
|
||||
|
||||
double initX = 0;
|
||||
double initTopY = height()*2/3-2;
|
||||
|
@ -190,7 +191,7 @@ void SMeter::drawScaleSMeter(QPainter *painter)
|
|||
double textHeight = meterFont.height();
|
||||
|
||||
painter->save();
|
||||
painter->setPen(lineColor);
|
||||
painter->setPen(scaleColor);
|
||||
|
||||
//Draw scale and scale values based on range values
|
||||
int longStep = 12;
|
||||
|
@ -302,6 +303,26 @@ void SMeter::setPrecision(int value)
|
|||
update();
|
||||
}
|
||||
|
||||
void SMeter::setBgColor(QColor color)
|
||||
{
|
||||
bgColor = color;
|
||||
}
|
||||
|
||||
void SMeter::setLineColor(QColor color)
|
||||
{
|
||||
lineColor = color;
|
||||
}
|
||||
|
||||
void SMeter::setProgressColor(QColor color)
|
||||
{
|
||||
progressColor = color;
|
||||
}
|
||||
|
||||
void SMeter::setScaleColor(QColor color)
|
||||
{
|
||||
scaleColor = color;
|
||||
}
|
||||
|
||||
void SMeter::setValue(double value)
|
||||
{
|
||||
currentValue = value;
|
||||
|
|
6
smeter.h
6
smeter.h
|
@ -37,6 +37,11 @@ public slots:
|
|||
void setShortStep(double value);
|
||||
void setPrecision(int value);
|
||||
|
||||
void setBgColor(QColor color);
|
||||
void setLineColor(QColor color);
|
||||
void setProgressColor(QColor color);
|
||||
void setScaleColor(QColor color);
|
||||
|
||||
void setValue(double value);
|
||||
void setValue(int value);
|
||||
|
||||
|
@ -65,6 +70,7 @@ private:
|
|||
QColor bgColor; //background color
|
||||
QColor lineColor; //line color
|
||||
QColor progressColor; //progress color
|
||||
QColor scaleColor; //scale text color
|
||||
|
||||
signals:
|
||||
|
||||
|
|
23
submeter.cpp
23
submeter.cpp
|
@ -27,6 +27,7 @@ SubMeter::SubMeter(QWidget *parent) : QWidget(parent)
|
|||
lineColor = QColor(Qt::black);
|
||||
bgColor = QColor(Qt::white);
|
||||
progressColor = QColor(Qt::green);
|
||||
scaleColor = QColor(Qt::black);
|
||||
|
||||
//Default value
|
||||
minValue = 0;
|
||||
|
@ -118,7 +119,7 @@ void SubMeter::drawProgress(QPainter *painter)
|
|||
void SubMeter::drawScale(QPainter *painter)
|
||||
{
|
||||
painter->save();
|
||||
painter->setPen(lineColor);
|
||||
painter->setPen(scaleColor);
|
||||
|
||||
double initX = 0;
|
||||
double initTopY = height()*2/3-2;
|
||||
|
@ -240,6 +241,26 @@ void SubMeter::setPrecision(int value)
|
|||
update();
|
||||
}
|
||||
|
||||
void SubMeter::setBgColor(QColor color)
|
||||
{
|
||||
bgColor = color;
|
||||
}
|
||||
|
||||
void SubMeter::setLineColor(QColor color)
|
||||
{
|
||||
lineColor = color;
|
||||
}
|
||||
|
||||
void SubMeter::setProgressColor(QColor color)
|
||||
{
|
||||
progressColor = color;
|
||||
}
|
||||
|
||||
void SubMeter::setScaleColor(QColor color)
|
||||
{
|
||||
scaleColor = color;
|
||||
}
|
||||
|
||||
void SubMeter::setValue(double value)
|
||||
{
|
||||
currentValue = value;
|
||||
|
|
|
@ -36,6 +36,11 @@ public slots:
|
|||
void setShortStep(double value);
|
||||
void setPrecision(int value);
|
||||
|
||||
void setBgColor(QColor color);
|
||||
void setLineColor(QColor color);
|
||||
void setProgressColor(QColor color);
|
||||
void setScaleColor(QColor color);
|
||||
|
||||
void setValue(double value);
|
||||
void setValue(int value);
|
||||
|
||||
|
@ -63,6 +68,7 @@ private:
|
|||
QColor bgColor; //background color
|
||||
QColor lineColor; //line color
|
||||
QColor progressColor; //progress color
|
||||
QColor scaleColor; //scale text color
|
||||
|
||||
signals:
|
||||
|
||||
|
|
|
@ -95,6 +95,21 @@ void vfoDisplay::drawText(QPainter *painter)
|
|||
painter->restore();
|
||||
}
|
||||
|
||||
void vfoDisplay::setBgColor(QColor color)
|
||||
{
|
||||
bgColor = color;
|
||||
}
|
||||
|
||||
void vfoDisplay::setLineColor(QColor color)
|
||||
{
|
||||
lineColor = color;
|
||||
}
|
||||
|
||||
void vfoDisplay::setTextColor(QColor color)
|
||||
{
|
||||
textColor = color;
|
||||
}
|
||||
|
||||
void vfoDisplay::setValue(unsigned long value)
|
||||
{
|
||||
currentValue = value;
|
||||
|
|
|
@ -14,6 +14,10 @@ public slots:
|
|||
void setValue(unsigned long value);
|
||||
void setMode(int mode);
|
||||
|
||||
void setBgColor(QColor color);
|
||||
void setLineColor(QColor color);
|
||||
void setTextColor(QColor color);
|
||||
|
||||
signals:
|
||||
void on_valueChanged(int value);
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue