make removeButton a member of IconPickerDialog
Signed-off-by: leo78913 <leo3758@riseup.net>
This commit is contained in:
		@@ -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.
 | 
					    // 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 buttonAdd = ui->buttonBox->addButton(tr("Add Icon"), QDialogButtonBox::ResetRole);
 | 
				
			||||||
    auto buttonRemove = ui->buttonBox->addButton(tr("Remove Icon"), QDialogButtonBox::ResetRole);
 | 
					    buttonRemove = ui->buttonBox->addButton(tr("Remove Icon"), QDialogButtonBox::ResetRole);
 | 
				
			||||||
    buttonRemove->setObjectName("buttonRemove");
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    connect(buttonAdd, SIGNAL(clicked(bool)), SLOT(addNewIcon()));
 | 
					    connect(buttonAdd, SIGNAL(clicked(bool)), SLOT(addNewIcon()));
 | 
				
			||||||
    connect(buttonRemove, SIGNAL(clicked(bool)), SLOT(removeSelectedIcon()));
 | 
					    connect(buttonRemove, SIGNAL(clicked(bool)), SLOT(removeSelectedIcon()));
 | 
				
			||||||
@@ -133,7 +132,6 @@ void IconPickerDialog::selectionChanged(QItemSelection selected, QItemSelection
 | 
				
			|||||||
    if (!key.isEmpty()) {
 | 
					    if (!key.isEmpty()) {
 | 
				
			||||||
        selectedIconKey = key;
 | 
					        selectedIconKey = key;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    auto buttonRemove = ui->buttonBox->findChild<QPushButton *>("buttonRemove");
 | 
					 | 
				
			||||||
    buttonRemove->setEnabled(APPLICATION->icons()->iconFileExists(selectedIconKey));
 | 
					    buttonRemove->setEnabled(APPLICATION->icons()->iconFileExists(selectedIconKey));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -37,6 +37,7 @@ protected:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
    Ui::IconPickerDialog *ui;
 | 
					    Ui::IconPickerDialog *ui;
 | 
				
			||||||
 | 
					    QPushButton *buttonRemove;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
private
 | 
					private
 | 
				
			||||||
slots:
 | 
					slots:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user