[vlc-commits] Qt: plugins dialog, fix keyevents

Jean-Baptiste Kempf git at videolan.org
Mon Aug 8 20:30:11 CEST 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Aug  8 20:27:55 2011 +0200| [e616d0df270639389cdb29d89e858603fdfeb3af] | committer: Jean-Baptiste Kempf

Qt: plugins dialog, fix keyevents

Close #5167

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e616d0df270639389cdb29d89e858603fdfeb3af
---

 modules/gui/qt4/dialogs/plugins.cpp |   15 ++++++++++++++-
 modules/gui/qt4/dialogs/plugins.hpp |    3 +++
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/modules/gui/qt4/dialogs/plugins.cpp b/modules/gui/qt4/dialogs/plugins.cpp
index effda54..2e99fb7 100644
--- a/modules/gui/qt4/dialogs/plugins.cpp
+++ b/modules/gui/qt4/dialogs/plugins.cpp
@@ -169,6 +169,15 @@ PluginTab::~PluginTab()
                              treePlugins->header()->saveState() );
 }
 
+void PluginTab::keyPressEvent( QKeyEvent *keyEvent )
+{
+    if( keyEvent->key() == Qt::Key_Return ||
+        keyEvent->key() == Qt::Key_Enter )
+        keyEvent->accept();
+    else
+        keyEvent->ignore();
+}
+
 bool PluginTreeItem::operator< ( const QTreeWidgetItem & other ) const
 {
     int col = treeWidget()->sortColumn();
@@ -236,7 +245,11 @@ ExtensionTab::~ExtensionTab()
 // Do not close on ESC or ENTER
 void ExtensionTab::keyPressEvent( QKeyEvent *keyEvent )
 {
-    keyEvent->ignore();
+    if( keyEvent->key() == Qt::Key_Return ||
+        keyEvent->key() == Qt::Key_Enter )
+        keyEvent->accept();
+    else
+        keyEvent->ignore();
 }
 
 // Show more information
diff --git a/modules/gui/qt4/dialogs/plugins.hpp b/modules/gui/qt4/dialogs/plugins.hpp
index c61de2a..20ba740 100644
--- a/modules/gui/qt4/dialogs/plugins.hpp
+++ b/modules/gui/qt4/dialogs/plugins.hpp
@@ -70,6 +70,9 @@ class PluginTab : public QVLCFrame
 {
     Q_OBJECT
 
+protected:
+    virtual void keyPressEvent( QKeyEvent *keyEvent );
+
 private:
     PluginTab( intf_thread_t *p_intf );
     virtual ~PluginTab();



More information about the vlc-commits mailing list