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)),
|
connect(m_iconsUi->customIconsView, SIGNAL(clicked(QModelIndex)),
|
||||||
this, SLOT(updateRadioButtonCustomIcons()));
|
this, SLOT(updateRadioButtonCustomIcons()));
|
||||||
connect(m_iconsUi->defaultIconsRadio, SIGNAL(toggled(bool)),
|
connect(m_iconsUi->defaultIconsRadio, SIGNAL(toggled(bool)),
|
||||||
this, SLOT(updateIndexDefaultIcons(bool)));
|
this, SLOT(updateWidgetsDefaultIcons(bool)));
|
||||||
connect(m_iconsUi->customIconsRadio, SIGNAL(toggled(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->addButton, SIGNAL(clicked()), SLOT(addCustomIcon()));
|
||||||
connect(m_iconsUi->deleteButton, SIGNAL(clicked()), SLOT(removeCustomIcon()));
|
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) {
|
if (check) {
|
||||||
QModelIndex index = m_iconsUi->defaultIconsView->currentIndex();
|
QModelIndex index = m_iconsUi->defaultIconsView->currentIndex();
|
||||||
@ -469,10 +469,12 @@ void EditEntryWidget::updateIndexDefaultIcons(bool check)
|
|||||||
setCurrentIndex(index, QItemSelectionModel::ClearAndSelect);
|
setCurrentIndex(index, QItemSelectionModel::ClearAndSelect);
|
||||||
}
|
}
|
||||||
m_iconsUi->customIconsView->selectionModel()->clearSelection();
|
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) {
|
if (check) {
|
||||||
QModelIndex index = m_iconsUi->customIconsView->currentIndex();
|
QModelIndex index = m_iconsUi->customIconsView->currentIndex();
|
||||||
@ -484,6 +486,8 @@ void EditEntryWidget::updateIndexCustomIcons(bool check)
|
|||||||
setCurrentIndex(index, QItemSelectionModel::ClearAndSelect);
|
setCurrentIndex(index, QItemSelectionModel::ClearAndSelect);
|
||||||
}
|
}
|
||||||
m_iconsUi->defaultIconsView->selectionModel()->clearSelection();
|
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 removeCurrentAttachment();
|
||||||
void addCustomIcon();
|
void addCustomIcon();
|
||||||
void removeCustomIcon();
|
void removeCustomIcon();
|
||||||
void updateIndexDefaultIcons(bool checked);
|
void updateWidgetsDefaultIcons(bool checked);
|
||||||
void updateIndexCustomIcons(bool checked);
|
void updateWidgetsCustomIcons(bool checked);
|
||||||
void updateRadioButtonDefaultIcons();
|
void updateRadioButtonDefaultIcons();
|
||||||
void updateRadioButtonCustomIcons();
|
void updateRadioButtonCustomIcons();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user