mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
quit autotype dialog with esc key
This commit is contained in:
parent
9c641ddf6b
commit
e4088d5e6c
@ -58,6 +58,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, SIGNAL(rejected()), SLOT(reject()));
|
||||||
connect(m_view->model(), SIGNAL(rowsRemoved(QModelIndex,int,int)), SLOT(entryRemoved()));
|
connect(m_view->model(), SIGNAL(rowsRemoved(QModelIndex,int,int)), SLOT(entryRemoved()));
|
||||||
layout->addWidget(m_view);
|
layout->addWidget(m_view);
|
||||||
|
|
||||||
|
@ -17,7 +17,9 @@
|
|||||||
|
|
||||||
#include "AutoTypeSelectView.h"
|
#include "AutoTypeSelectView.h"
|
||||||
|
|
||||||
|
#include <QKeyEvent>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
AutoTypeSelectView::AutoTypeSelectView(QWidget* parent)
|
AutoTypeSelectView::AutoTypeSelectView(QWidget* parent)
|
||||||
: EntryView(parent)
|
: EntryView(parent)
|
||||||
@ -54,3 +56,18 @@ void AutoTypeSelectView::selectFirstEntry()
|
|||||||
setCurrentIndex(index);
|
setCurrentIndex(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AutoTypeSelectView::keyReleaseEvent(QKeyEvent* e)
|
||||||
|
{
|
||||||
|
qDebug() << e->key();
|
||||||
|
|
||||||
|
if (!e->modifiers() || (e->modifiers() & Qt::KeypadModifier && e->key() == Qt::Key_Enter)) {
|
||||||
|
if (e->key() == Qt::Key_Escape) {
|
||||||
|
emit rejected();
|
||||||
|
} else {
|
||||||
|
e->ignore();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
e->ignore();
|
||||||
|
}
|
||||||
|
}
|
@ -31,9 +31,13 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void mouseMoveEvent(QMouseEvent* event) override;
|
void mouseMoveEvent(QMouseEvent* event) override;
|
||||||
|
void keyReleaseEvent(QKeyEvent* e) override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void selectFirstEntry();
|
void selectFirstEntry();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void rejected();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // KEEPASSX_AUTOTYPESELECTVIEW_H
|
#endif // KEEPASSX_AUTOTYPESELECTVIEW_H
|
||||||
|
Loading…
Reference in New Issue
Block a user