mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Toggle enabled status of add/remove custom icon buttons based on radio button selection.
This commit is contained in:
parent
a1dec7594d
commit
15fa09167b
@ -111,9 +111,9 @@ EditEntryWidget::EditEntryWidget(QWidget* parent)
|
||||
connect(m_iconsUi->customIconsView, SIGNAL(clicked(QModelIndex)),
|
||||
this, SLOT(updateRadioButtonCustomIcons()));
|
||||
connect(m_iconsUi->defaultIconsRadio, SIGNAL(toggled(bool)),
|
||||
this, SLOT(updateIndexDefaultIcons(bool)));
|
||||
this, SLOT(updateWidgetsDefaultIcons(bool)));
|
||||
connect(m_iconsUi->customIconsRadio, SIGNAL(toggled(bool)),
|
||||
this, SLOT(updateIndexCustomIcons(bool)));
|
||||
this, SLOT(updateWidgetsCustomIcons(bool)));
|
||||
connect(m_iconsUi->addButton, SIGNAL(clicked()), SLOT(addCustomIcon()));
|
||||
connect(m_iconsUi->deleteButton, SIGNAL(clicked()), SLOT(removeCustomIcon()));
|
||||
|
||||
@ -457,7 +457,7 @@ void EditEntryWidget::removeCustomIcon()
|
||||
}
|
||||
}
|
||||
|
||||
void EditEntryWidget::updateIndexDefaultIcons(bool check)
|
||||
void EditEntryWidget::updateWidgetsDefaultIcons(bool check)
|
||||
{
|
||||
if (check) {
|
||||
QModelIndex index = m_iconsUi->defaultIconsView->currentIndex();
|
||||
@ -469,10 +469,12 @@ void EditEntryWidget::updateIndexDefaultIcons(bool check)
|
||||
setCurrentIndex(index, QItemSelectionModel::ClearAndSelect);
|
||||
}
|
||||
m_iconsUi->customIconsView->selectionModel()->clearSelection();
|
||||
m_iconsUi->addButton->setEnabled(false);
|
||||
m_iconsUi->deleteButton->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
void EditEntryWidget::updateIndexCustomIcons(bool check)
|
||||
void EditEntryWidget::updateWidgetsCustomIcons(bool check)
|
||||
{
|
||||
if (check) {
|
||||
QModelIndex index = m_iconsUi->customIconsView->currentIndex();
|
||||
@ -484,6 +486,8 @@ void EditEntryWidget::updateIndexCustomIcons(bool check)
|
||||
setCurrentIndex(index, QItemSelectionModel::ClearAndSelect);
|
||||
}
|
||||
m_iconsUi->defaultIconsView->selectionModel()->clearSelection();
|
||||
m_iconsUi->addButton->setEnabled(true);
|
||||
m_iconsUi->deleteButton->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,8 +72,8 @@ private Q_SLOTS:
|
||||
void removeCurrentAttachment();
|
||||
void addCustomIcon();
|
||||
void removeCustomIcon();
|
||||
void updateIndexDefaultIcons(bool checked);
|
||||
void updateIndexCustomIcons(bool checked);
|
||||
void updateWidgetsDefaultIcons(bool checked);
|
||||
void updateWidgetsCustomIcons(bool checked);
|
||||
void updateRadioButtonDefaultIcons();
|
||||
void updateRadioButtonCustomIcons();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user