mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-14 01:27:00 +00:00
LED settings: set modal and add has_battery check
This commit is contained in:
parent
db402cb8af
commit
b31d38eef7
@ -5,12 +5,13 @@
|
||||
#include <QPixmap>
|
||||
#include <QPainterPath>
|
||||
|
||||
pad_led_settings_dialog::pad_led_settings_dialog(const int& colorR, const int& colorG, const int& colorB, const bool& led_low_battery_blink, const bool& led_battery_indicator, const int& led_battery_indicator_brightness, QDialog * parent)
|
||||
pad_led_settings_dialog::pad_led_settings_dialog(QDialog* parent, int colorR, int colorG, int colorB, bool has_battery, bool led_low_battery_blink, bool led_battery_indicator, int led_battery_indicator_brightness)
|
||||
: QDialog(parent)
|
||||
, ui(new Ui::pad_led_settings_dialog)
|
||||
, m_initial{colorR, colorG, colorB, led_low_battery_blink, led_battery_indicator, led_battery_indicator_brightness}
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setModal(true);
|
||||
m_new = m_initial;
|
||||
|
||||
ui->hs_indicator_brightness->setValue(m_new.battery_indicator_brightness);
|
||||
@ -20,6 +21,9 @@ pad_led_settings_dialog::pad_led_settings_dialog(const int& colorR, const int& c
|
||||
switch_groupboxes(m_new.battery_indicator);
|
||||
update_slider_label(m_new.battery_indicator_brightness);
|
||||
|
||||
ui->gb_battery_status->setEnabled(has_battery);
|
||||
ui->gb_indicator_brightness->setEnabled(has_battery);
|
||||
|
||||
connect(ui->bb_dialog_buttons, &QDialogButtonBox::clicked, [this](QAbstractButton* button)
|
||||
{
|
||||
if (button == ui->bb_dialog_buttons->button(QDialogButtonBox::Ok))
|
||||
|
@ -14,7 +14,7 @@ class pad_led_settings_dialog : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit pad_led_settings_dialog(const int& colorR, const int& colorG, const int& colorB, const bool& led_low_battery_blink, const bool& led_battery_indicator, const int& led_battery_indicator_brightness, QDialog* parent = Q_NULLPTR);
|
||||
explicit pad_led_settings_dialog(QDialog* parent, int colorR, int colorG, int colorB, bool has_battery, bool led_low_battery_blink, bool led_battery_indicator, int led_battery_indicator_brightness);
|
||||
~pad_led_settings_dialog();
|
||||
|
||||
Q_SIGNALS:
|
||||
|
@ -377,8 +377,8 @@ void pad_settings_dialog::InitButtons()
|
||||
connect(ui->b_led_settings, &QPushButton::clicked, [this]()
|
||||
{
|
||||
// Allow LED battery indication while the dialog is open
|
||||
m_handler->SetPadData(m_device_name, 0, 0, m_handler_cfg.colorR, m_handler_cfg.colorG, m_handler_cfg.colorB, static_cast<bool>(m_handler_cfg.led_battery_indicator), m_handler_cfg.led_battery_indicator_brightness);
|
||||
pad_led_settings_dialog dialog(m_handler_cfg.colorR, m_handler_cfg.colorG, m_handler_cfg.colorB, static_cast<bool>(m_handler_cfg.led_low_battery_blink), static_cast<bool>(m_handler_cfg.led_battery_indicator), m_handler_cfg.led_battery_indicator_brightness, this);
|
||||
m_handler->SetPadData(m_device_name, 0, 0, m_handler_cfg.colorR, m_handler_cfg.colorG, m_handler_cfg.colorB, m_handler_cfg.led_battery_indicator.get(), m_handler_cfg.led_battery_indicator_brightness);
|
||||
pad_led_settings_dialog dialog(this, m_handler_cfg.colorR, m_handler_cfg.colorG, m_handler_cfg.colorB, m_handler->has_battery(), m_handler_cfg.led_low_battery_blink.get(), m_handler_cfg.led_battery_indicator.get(), m_handler_cfg.led_battery_indicator_brightness);
|
||||
connect(&dialog, &pad_led_settings_dialog::pass_led_settings, this, &pad_settings_dialog::apply_led_settings);
|
||||
dialog.exec();
|
||||
m_handler->SetPadData(m_device_name, 0, 0, m_handler_cfg.colorR, m_handler_cfg.colorG, m_handler_cfg.colorB, false, m_handler_cfg.led_battery_indicator_brightness);
|
||||
|
Loading…
x
Reference in New Issue
Block a user