Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Odizinne committed Aug 16, 2024
1 parent 776508d commit d2d3a90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
22 changes: 3 additions & 19 deletions src/HeadsetControlQt/headsetcontrolqt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ HeadsetControlQt::~HeadsetControlQt()
void HeadsetControlQt::initUI()
{
connect(ui->ledBox, &QCheckBox::stateChanged, this, &HeadsetControlQt::onLedBoxStateChanged);
connect(ui->lightBatterySpinbox, QOverload<int>::of(&QSpinBox::valueChanged), this, &HeadsetControlQt::onLightBatterySpinboxValueChanged);
connect(ui->notificationBatterySpinbox, QOverload<int>::of(&QSpinBox::valueChanged), this, &HeadsetControlQt::onNotificationBatterySpinboxValueChanged);
connect(ui->lightBatterySpinbox, QOverload<int>::of(&QSpinBox::valueChanged), this, &HeadsetControlQt::saveSettings);
connect(ui->notificationBatterySpinbox, QOverload<int>::of(&QSpinBox::valueChanged), this, &HeadsetControlQt::saveSettings);
connect(ui->startupCheckbox, &QCheckBox::stateChanged, this, &HeadsetControlQt::onStartupCheckBoxStateChanged);
connect(ui->sidetoneSlider, &QSlider::sliderReleased, this, &HeadsetControlQt::onSidetoneSliderSliderReleased);
connect(ui->themeComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &HeadsetControlQt::onThemeComboBoxCurrentIndexChanged);
Expand All @@ -73,7 +73,7 @@ void HeadsetControlQt::createTrayIcon()
connect(showAction, &QAction::triggered, this, &HeadsetControlQt::toggleWindow);
trayMenu->addAction(showAction);
QAction *exitAction = new QAction("Exit", this);
connect(exitAction, &QAction::triggered, this, &HeadsetControlQt::exitApp);
connect(exitAction, &QAction::triggered, this, &QApplication::quit);
trayMenu->addAction(exitAction);
trayIcon->setContextMenu(trayMenu);
trayIcon->show();
Expand Down Expand Up @@ -339,16 +339,6 @@ void HeadsetControlQt::onLedBoxStateChanged()
saveSettings();
}

void HeadsetControlQt::onLightBatterySpinboxValueChanged(int value)
{
saveSettings();
}

void HeadsetControlQt::onNotificationBatterySpinboxValueChanged(int value)
{
saveSettings();
}

void HeadsetControlQt::onStartupCheckBoxStateChanged()
{
if (ui->startupCheckbox->isChecked()) {
Expand Down Expand Up @@ -395,12 +385,6 @@ void HeadsetControlQt::trayIconActivated(QSystemTrayIcon::ActivationReason reaso
}
}

void HeadsetControlQt::exitApp()
{
trayIcon->hide();
QApplication::quit();
}

void HeadsetControlQt::checkStartupCheckbox()
{
if (isShortcutPresent()) {
Expand Down
3 changes: 0 additions & 3 deletions src/HeadsetControlQt/headsetcontrolqt.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,11 @@ class HeadsetControlQt : public QMainWindow

private slots:
void onLedBoxStateChanged();
void onLightBatterySpinboxValueChanged(int value);
void onNotificationBatterySpinboxValueChanged(int value);
void onSidetoneSliderSliderReleased();
void onThemeComboBoxCurrentIndexChanged(int index);
void updateHeadsetInfo();
void toggleWindow();
void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
void exitApp();
void checkStartupCheckbox();
void onStartupCheckBoxStateChanged();

Expand Down

0 comments on commit d2d3a90

Please sign in to comment.