refactor: ActionDialog use proper ActionDialog::itemToggled in place of lambda
This commit is contained in:
@ -27,9 +27,7 @@ ActionDialog::ActionDialog(QWidget *parent, const ServerConfig &config, Hotkey &
|
||||
connect(
|
||||
ui->comboActionType, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ActionDialog::actionTypeChanged
|
||||
);
|
||||
connect(ui->listScreens, &QListWidget::itemChanged, this, [&] {
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(canSave());
|
||||
});
|
||||
connect(ui->listScreens, &QListWidget::itemChanged, this, &ActionDialog::itemToggled);
|
||||
connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &ActionDialog::accept);
|
||||
connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &ActionDialog::reject);
|
||||
|
||||
@ -117,6 +115,11 @@ void ActionDialog::keySequenceChanged()
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(canSave());
|
||||
}
|
||||
|
||||
void ActionDialog::itemToggled() const
|
||||
{
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(canSave());
|
||||
}
|
||||
|
||||
void ActionDialog::actionTypeChanged(int index)
|
||||
{
|
||||
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(canSave());
|
||||
|
||||
@ -44,6 +44,7 @@ protected Q_SLOTS:
|
||||
private:
|
||||
void updateSize();
|
||||
void keySequenceChanged();
|
||||
void itemToggled() const;
|
||||
void actionTypeChanged(int index);
|
||||
bool isKeyAction(int index) const;
|
||||
bool canSave() const;
|
||||
|
||||
Reference in New Issue
Block a user