[vlc-commits] Qt: EPG Dialog: use DialogButtonBox

Francois Cartegnie git at videolan.org
Sat Mar 5 16:25:46 CET 2011


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Mar  4 22:08:13 2011 +0100| [9cac200d6fb86f579814ad9d393d768599e5d6c4] | committer: Francois Cartegnie

Qt: EPG Dialog: use DialogButtonBox

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

 modules/gui/qt4/dialogs/epg.cpp |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt4/dialogs/epg.cpp b/modules/gui/qt4/dialogs/epg.cpp
index 6d66bc8..008b21e 100644
--- a/modules/gui/qt4/dialogs/epg.cpp
+++ b/modules/gui/qt4/dialogs/epg.cpp
@@ -34,6 +34,7 @@
 #include <QGroupBox>
 #include <QPushButton>
 #include <QTextEdit>
+#include <QDialogButtonBox>
 
 #include "qt4.hpp"
 #include "input_manager.hpp"
@@ -73,15 +74,18 @@ EpgDialog::EpgDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf )
     CONNECT( epg, itemSelectionChanged( EPGEvent *), this, showEvent( EPGEvent *) );
     CONNECT( THEMIM->getIM(), epgChanged(), this, updateInfos() );
 
+    QDialogButtonBox *buttonsBox = new QDialogButtonBox( this );
+
 #if 0
     QPushButton *update = new QPushButton( qtr( "Update" ) ); // Temporary to test
-    boxLayout->addWidget( update, 0, Qt::AlignRight );
+    buttonsBox->addButton( update, QDialogButtonBox::ActionRole );
     BUTTONACT( update, updateInfos() );
 #endif
 
-    QPushButton *close = new QPushButton( qtr( "&Close" ) );
-    boxLayout->addWidget( close, 0, Qt::AlignRight );
-    BUTTONACT( close, close() );
+    buttonsBox->addButton( new QPushButton( qtr( "&Close" ) ),
+                           QDialogButtonBox::RejectRole );
+    boxLayout->addWidget( buttonsBox );
+    CONNECT( buttonsBox, rejected(), this, close() );
 
     updateInfos();
     readSettings( "EPGDialog", QSize( 650, 450 ) );



More information about the vlc-commits mailing list