[vlc-devel] commit: Qt: better hotkeys change management. (Jean-Baptiste Kempf )

git version control git at videolan.org
Sat May 2 23:59:32 CEST 2009


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat May  2 23:58:46 2009 +0200| [62d7d384fea12553833425d784bbea9e5d28cf6a] | committer: Jean-Baptiste Kempf 

Qt: better hotkeys change management.

Close #2245

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

 modules/gui/qt4/components/preferences_widgets.cpp |   11 +++++++----
 modules/gui/qt4/components/preferences_widgets.hpp |    2 +-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp
index 9996339..d1e255d 100644
--- a/modules/gui/qt4/components/preferences_widgets.cpp
+++ b/modules/gui/qt4/components/preferences_widgets.cpp
@@ -1326,6 +1326,10 @@ KeyInputDialog::KeyInputDialog( QTreeWidget *_table,
     selected = new QLabel( qtr( "Press the new keys for " ) + keyToChange );
     vLayout->addWidget( selected , Qt::AlignCenter );
 
+    warning = new QLabel;
+    warning->hide();
+    vLayout->insertWidget( 1, warning );
+
     buttonBox = new QDialogButtonBox;
     QPushButton *ok = new QPushButton( qtr("OK") );
     QPushButton *cancel = new QPushButton( qtr("Cancel") );
@@ -1347,12 +1351,11 @@ void KeyInputDialog::checkForConflicts( int i_vlckey )
 
     if( conflictList.size() &&
         conflictList[0]->data( 1, Qt::UserRole ).toInt() > 1 )
-        /* Avoid 0 or -1 that are the "Unset" states*/
+        /* Avoid 0 or -1 that are the "Unset" states */
     {
-        QLabel *warning = new QLabel(
-          qtr("Warning: the key is already assigned to \"") +
+        warning->setText( qtr("Warning: the key is already assigned to \"") +
           conflictList[0]->text( 0 ) + "\"" );
-        vLayout->insertWidget( 1, warning );
+        warning->show();
         buttonBox->show();
 
         conflicts = true;
diff --git a/modules/gui/qt4/components/preferences_widgets.hpp b/modules/gui/qt4/components/preferences_widgets.hpp
index 05a27c5..99aea1c 100644
--- a/modules/gui/qt4/components/preferences_widgets.hpp
+++ b/modules/gui/qt4/components/preferences_widgets.hpp
@@ -468,7 +468,7 @@ private:
     void checkForConflicts( int i_vlckey );
     void keyPressEvent( QKeyEvent *);
     void wheelEvent( QWheelEvent *);
-    QLabel *selected;
+    QLabel *selected, *warning;
     QVBoxLayout *vLayout;
     QDialogButtonBox *buttonBox;
 };




More information about the vlc-devel mailing list