mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Close AutoTypeSelectDialog when there are no entries left.
This happens when the entries were deleted or the database has been closed.
This commit is contained in:
parent
21a80101ba
commit
095bf158b6
@ -51,6 +51,7 @@ AutoTypeSelectDialog::AutoTypeSelectDialog(QWidget* parent)
|
||||
|
||||
connect(m_view, SIGNAL(activated(QModelIndex)), SLOT(emitEntryActivated(QModelIndex)));
|
||||
connect(m_view, SIGNAL(clicked(QModelIndex)), SLOT(emitEntryActivated(QModelIndex)));
|
||||
connect(m_view->model(), SIGNAL(rowsRemoved(QModelIndex,int,int)), SLOT(entryRemoved()));
|
||||
layout->addWidget(m_view);
|
||||
|
||||
QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel, Qt::Horizontal, this);
|
||||
@ -76,3 +77,10 @@ void AutoTypeSelectDialog::emitEntryActivated(const QModelIndex& index)
|
||||
accept();
|
||||
Q_EMIT entryActivated(entry, m_sequences[entry]);
|
||||
}
|
||||
|
||||
void AutoTypeSelectDialog::entryRemoved()
|
||||
{
|
||||
if (m_view->model()->rowCount() == 0) {
|
||||
reject();
|
||||
}
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ Q_SIGNALS:
|
||||
|
||||
private Q_SLOTS:
|
||||
void emitEntryActivated(const QModelIndex& index);
|
||||
void entryRemoved();
|
||||
|
||||
private:
|
||||
AutoTypeSelectView* const m_view;
|
||||
|
Loading…
Reference in New Issue
Block a user