]> git.sesse.net Git - vlc/commitdiff
Qt: better hotkeys change management.
authorJean-Baptiste Kempf <jb@videolan.org>
Sat, 2 May 2009 21:58:46 +0000 (23:58 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Sat, 2 May 2009 21:58:46 +0000 (23:58 +0200)
Close #2245

modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/components/preferences_widgets.hpp

index 99963390d9998fbef92a975f8b90b9d7d68301b4..d1e255de6dc56569dbfd00842ef31f121d09a613 100644 (file)
@@ -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;
index 05a27c5d94b4473fb410612fc2b9dadd394c4578..99aea1cbaff33a1a1bdede438b680b28a18aa0f3 100644 (file)
@@ -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;
 };