mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-06-12 08:53:08 -04:00
Disable some menu actions while searching.
This commit is contained in:
parent
6b6c109903
commit
0e19b47755
3 changed files with 29 additions and 6 deletions
|
@ -25,6 +25,7 @@ EntryView::EntryView(QWidget* parent)
|
|||
: QTreeView(parent)
|
||||
, m_model(new EntryModel(this))
|
||||
, m_sortModel(new QSortFilterProxyModel(this))
|
||||
, m_inSearch(false)
|
||||
{
|
||||
m_sortModel->setSourceModel(m_model);
|
||||
m_sortModel->setDynamicSortFilter(true);
|
||||
|
@ -58,6 +59,11 @@ void EntryView::search(QList<Entry*> entries)
|
|||
Q_EMIT entrySelectionChanged();
|
||||
}
|
||||
|
||||
bool EntryView::inSearch()
|
||||
{
|
||||
return m_inSearch;
|
||||
}
|
||||
|
||||
void EntryView::emitEntryActivated(const QModelIndex& index)
|
||||
{
|
||||
Q_EMIT entryActivated(entryFromIndex(index));
|
||||
|
@ -98,9 +104,11 @@ Entry* EntryView::entryFromIndex(const QModelIndex& index)
|
|||
void EntryView::switchToSearch()
|
||||
{
|
||||
showColumn(0);
|
||||
m_inSearch = true;
|
||||
}
|
||||
|
||||
void EntryView::switchToView()
|
||||
{
|
||||
hideColumn(0);
|
||||
m_inSearch = false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue