]> git.sesse.net Git - vlc/commitdiff
Qt4 - make GNOME and KDE people happy.
authorJean-Baptiste Kempf <jb@videolan.org>
Mon, 5 Nov 2007 23:12:08 +0000 (23:12 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 5 Nov 2007 23:12:08 +0000 (23:12 +0000)
modules/gui/qt4/components/preferences_widgets.cpp

index 4a5058bb8844542bda1b696bb4283f7dd964e2af..f488406fa7bdecaae16d4b09690502cf5472b7a4 100644 (file)
@@ -45,6 +45,7 @@
 #include <QGroupBox>
 #include <QTreeWidgetItem>
 #include <QSignalMapper>
+#include <QDialogButtonBox>
 
 QString formatTooltip(const QString & tooltip)
 {
@@ -1120,6 +1121,7 @@ KeyInputDialog::KeyInputDialog( QList<module_config_t*>& _values,
     values = _values;
     conflicts = false;
     keyToChange = _keyToChange;
+    
     setWindowTitle( qtr( "Hotkey for " ) + qfu( keyToChange)  );
 
     QVBoxLayout *l = new QVBoxLayout( this );
@@ -1128,16 +1130,16 @@ KeyInputDialog::KeyInputDialog( QList<module_config_t*>& _values,
     l->addWidget( selected , Qt::AlignCenter );
     l->addWidget( warning, Qt::AlignCenter );
 
-    QHBoxLayout *l2 = new QHBoxLayout();
+    QDialogButtonBox *buttonBox = new QDialogButtonBox;
     QPushButton *ok = new QPushButton( qtr("OK") );
-    l2->addWidget( ok );
     QPushButton *cancel = new QPushButton( qtr("Cancel") );
-    l2->addWidget( cancel );
-
-    BUTTONACT( ok, accept() );
-    BUTTONACT( cancel, reject() );
+    buttonBox->addButton( ok, QDialogButtonBox::AcceptRole );
+    buttonBox->addButton( cancel, QDialogButtonBox::RejectRole );
 
-    l->addLayout( l2 );
+    l->addWidget( buttonBox );
+    
+    CONNECT( buttonBox, accepted(), this, accept() );
+    CONNECT( buttonBox, rejected(), this, reject() );
 }
 
 void KeyInputDialog::checkForConflicts( int i_vlckey )