]> git.lyx.org Git - features.git/commitdiff
Fix rest of bug 3068.
authorJürgen Spitzmüller <spitz@lyx.org>
Mon, 8 Jan 2007 06:52:20 +0000 (06:52 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Mon, 8 Jan 2007 06:52:20 +0000 (06:52 +0000)
* src/frontends/qt4/QCitationDialog.[Ch]:
- implement KeyPressEvent, catch ESC key and clear params there as well

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16594 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/QCitationDialog.C
src/frontends/qt4/QCitationDialog.h

index 068de2d0ca8a24d6d909e6aad994b083a9a33102..77915b13d248514552682bebecc6427d362aed6a 100644 (file)
@@ -27,6 +27,7 @@
 #include <string>
 
 #include <QCloseEvent>
+#include <QKeyEvent>
 
 using std::vector;
 using std::string;
@@ -46,7 +47,7 @@ QCitationDialog::QCitationDialog(Dialog & dialog, QCitation * form)
 
        setWindowTitle(toqstr("LyX: " + getTitle()));
 
-       selectedLV->setModel(form_->selected());
+       selectedLV->setModel(form_->selected());
        availableLV->setModel(form_->available());
 
        connect(citationStyleCO, SIGNAL(activated(int)),
@@ -75,6 +76,18 @@ QCitationDialog::~QCitationDialog()
 }
 
 
+void QCitationDialog::keyPressEvent(QKeyEvent * event)
+{
+       if (event->key() == Qt::Key_Escape) {
+               form_->clearSelection();
+               form_->clearParams();
+               event->accept();
+               close();
+       } else
+               event->ignore();
+}
+
+
 void QCitationDialog::closeEvent(QCloseEvent * e)
 {
        form_->clearSelection();
index 73fc0eaf02a41efca5883bc982cfdac10596a73a..ff5200e5e1fc40d81345f8e45dba9fce9eb3d944 100644 (file)
@@ -16,6 +16,7 @@
 #include "ui/QCitationUi.h"
 
 #include <QCloseEvent>
+#include <QKeyEvent>
 
 namespace lyx {
 namespace frontend {
@@ -49,6 +50,7 @@ public:
 
 protected:
        void closeEvent (QCloseEvent * e);
+       void keyPressEvent (QKeyEvent * event);
 
 protected Q_SLOTS: