]> git.sesse.net Git - vlc/commitdiff
Qt: make help dialog use standard buttons
authorFrancois Cartegnie <fcvlcdev@free.fr>
Thu, 23 Sep 2010 19:07:19 +0000 (21:07 +0200)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Fri, 24 Sep 2010 21:03:02 +0000 (23:03 +0200)
modules/gui/qt4/dialogs/help.cpp

index a5d77a9703881c5d42a5059a1ca1d1cdc995c170..fce2509c3ea90ec92a63c57001106ca7dd6ba1ab 100644 (file)
@@ -55,17 +55,18 @@ HelpDialog::HelpDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
     setWindowRole( "vlc-help" );
     setMinimumSize( 350, 300 );
 
-    QGridLayout *layout = new QGridLayout( this );
+    QVBoxLayout *layout = new QVBoxLayout( this );
     QTextBrowser *helpBrowser = new QTextBrowser( this );
     helpBrowser->setOpenExternalLinks( true );
     helpBrowser->setHtml( qtr(I_LONGHELP) );
-    QPushButton *closeButton = new QPushButton( qtr( "&Close" ) );
-    closeButton->setDefault( true );
+    QDialogButtonBox *closeButtonBox =
+         new QDialogButtonBox( QDialogButtonBox::Close, Qt::Horizontal, this );
+    closeButtonBox->setFocus();
 
-    layout->addWidget( helpBrowser, 0, 0, 1, 0 );
-    layout->addWidget( closeButton, 1, 3 );
+    layout->addWidget( helpBrowser );
+    layout->addWidget( closeButtonBox );
 
-    BUTTONACT( closeButton, close() );
+    CONNECT( closeButtonBox, rejected(), this, close() );
     readSettings( "Help", QSize( 500, 450 ) );
 }