mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-27 14:57:09 -05: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(activated(QModelIndex)), SLOT(emitEntryActivated(QModelIndex)));
|
||||||
connect(m_view, SIGNAL(clicked(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);
|
layout->addWidget(m_view);
|
||||||
|
|
||||||
QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel, Qt::Horizontal, this);
|
QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel, Qt::Horizontal, this);
|
||||||
@ -76,3 +77,10 @@ void AutoTypeSelectDialog::emitEntryActivated(const QModelIndex& index)
|
|||||||
accept();
|
accept();
|
||||||
Q_EMIT entryActivated(entry, m_sequences[entry]);
|
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:
|
private Q_SLOTS:
|
||||||
void emitEntryActivated(const QModelIndex& index);
|
void emitEntryActivated(const QModelIndex& index);
|
||||||
|
void entryRemoved();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AutoTypeSelectView* const m_view;
|
AutoTypeSelectView* const m_view;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user