make removeButton a member of IconPickerDialog

Signed-off-by: leo78913 <leo3758@riseup.net>
This commit is contained in:
leo78913 2022-12-08 11:13:53 -03:00
parent 8c99edd3c5
commit ab2f3bb5bc
2 changed files with 2 additions and 3 deletions

View File

@ -63,8 +63,7 @@ IconPickerDialog::IconPickerDialog(QWidget *parent)
// NOTE: ResetRole forces the button to be on the left, while the OK/Cancel ones are on the right. We win.
auto buttonAdd = ui->buttonBox->addButton(tr("Add Icon"), QDialogButtonBox::ResetRole);
auto buttonRemove = ui->buttonBox->addButton(tr("Remove Icon"), QDialogButtonBox::ResetRole);
buttonRemove->setObjectName("buttonRemove");
buttonRemove = ui->buttonBox->addButton(tr("Remove Icon"), QDialogButtonBox::ResetRole);
connect(buttonAdd, SIGNAL(clicked(bool)), SLOT(addNewIcon()));
connect(buttonRemove, SIGNAL(clicked(bool)), SLOT(removeSelectedIcon()));
@ -133,7 +132,6 @@ void IconPickerDialog::selectionChanged(QItemSelection selected, QItemSelection
if (!key.isEmpty()) {
selectedIconKey = key;
}
auto buttonRemove = ui->buttonBox->findChild<QPushButton *>("buttonRemove");
buttonRemove->setEnabled(APPLICATION->icons()->iconFileExists(selectedIconKey));
}

View File

@ -37,6 +37,7 @@ protected:
private:
Ui::IconPickerDialog *ui;
QPushButton *buttonRemove;
private
slots: