[vlc-devel] [PATCH] Hitting ENTER in addon manager search field no longer makes tab content disappear

Valter Correia valtergilcorreia at gmail.com
Tue Oct 27 23:45:55 CET 2015


From: Valter Correia <valtergcorreia at ua.pt>

Interface-QT: Bugs #15162, #14553

---
 modules/gui/qt4/dialogs/plugins.cpp | 10 ++++++++++
 modules/gui/qt4/dialogs/plugins.hpp |  3 +++
 2 files changed, 13 insertions(+)

diff --git a/modules/gui/qt4/dialogs/plugins.cpp b/modules/gui/qt4/dialogs/plugins.cpp
index ea26029..9008ec5 100644
--- a/modules/gui/qt4/dialogs/plugins.cpp
+++ b/modules/gui/qt4/dialogs/plugins.cpp
@@ -489,6 +489,16 @@ AddonsTab::~AddonsTab()
     delete spinnerAnimation;
 }
 
+// Do not close on ESC or ENTER
+void AddonsTab::keyPressEvent( QKeyEvent *keyEvent )
+{
+    if( keyEvent->key() == Qt::Key_Return ||
+        keyEvent->key() == Qt::Key_Enter )
+        keyEvent->accept();
+    else
+        keyEvent->ignore();
+}
+
 bool AddonsTab::eventFilter( QObject *obj, QEvent *event )
 {
     if ( obj != addonsView->viewport() )
diff --git a/modules/gui/qt4/dialogs/plugins.hpp b/modules/gui/qt4/dialogs/plugins.hpp
index 9b3523e..1da97e3 100644
--- a/modules/gui/qt4/dialogs/plugins.hpp
+++ b/modules/gui/qt4/dialogs/plugins.hpp
@@ -130,6 +130,9 @@ class AddonsTab : public QVLCFrame
     Q_OBJECT
     friend class PluginDialog;
 
+protected:
+    void keyPressEvent( QKeyEvent *keyEvent ) Q_DECL_OVERRIDE;
+
 private slots:
     void moreInformation();
     void installChecked( int );
-- 
2.1.4



More information about the vlc-devel mailing list