]> git.sesse.net Git - vlc/commitdiff
Qt4 - Make GNOME/KDE fanboys happy.
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 28 Jun 2007 17:55:00 +0000 (17:55 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 28 Jun 2007 17:55:00 +0000 (17:55 +0000)
Remove unneeded code. Without qt4.2, you can't compile this GUI anyway.

modules/gui/qt4/dialogs/interaction.cpp
modules/gui/qt4/util/qvlcframe.hpp

index 1d843cbbc5f39066de8692992277bc1d325d5894..e73fab73fd68488ef6ddf4b7b72344e36eca0d7b 100644 (file)
@@ -31,6 +31,7 @@
 #include <QPushButton>
 #include <QProgressBar>
 #include <QMessageBox>
+#include <QDialogButtonBox>
 
 #include <assert.h>
 
@@ -136,10 +137,27 @@ InteractionDialog::InteractionDialog( intf_thread_t *_p_intf,
     else
     /* Custom box, finish it */
     {
-        QVLCFrame::doButtons( dialog, layout,
-                              &defaultButton, p_dialog->psz_default_button,
-                              &altButton, p_dialog->psz_alternate_button,
-                              &otherButton, p_dialog->psz_other_button );
+        QDialogButtonBox *buttonBox = new QDialogButtonBox;
+
+        if( p_dialog->psz_default_button )
+        {
+            defaultButton = new QPushButton;
+            defaultButton->setFocus();
+            defaultButton->setText( qfu( p_dialog->psz_default_button ) );
+            buttonBox->addButton( defaultButton, QDialogButtonBox::AcceptRole );
+        }
+        if( p_dialog->psz_alternate_button )
+        {
+            altButton = new QPushButton;
+            altButton->setText( qfu( p_dialog->psz_alternate_button ) );
+            buttonBox->addButton( altButton, QDialogButtonBox::RejectRole );
+        }
+        if( p_dialog->psz_other_button )
+        {
+            otherButton = new QPushButton;
+            otherButton->setText( qfu( p_dialog->psz_other_button ) );
+            buttonBox->addButton( otherButton, QDialogButtonBox::ActionRole );
+        }
         if( p_dialog->psz_default_button )
             BUTTONACT( defaultButton, defaultB() );
         if( p_dialog->psz_alternate_button )
index 5acbee51a6409d49f3b6cba4734d15666a9c0987..ef8235c365b92abb3eecc573c4b5697f01574330 100644 (file)
 class QVLCFrame : public QWidget
 {
 public:
-    static QHBoxLayout* doButtons( QWidget *w, QBoxLayout *l,
-                               QPushButton **defaul, char *psz_default,
-                               QPushButton **alt, char *psz_alt,
-                               QPushButton **other, char *psz_other )
-    {
-#ifdef QT42
-#else
-        QHBoxLayout *buttons_layout = new QHBoxLayout;
-        QSpacerItem *spacerItem = new QSpacerItem( 40, 20,
-                               QSizePolicy::Expanding, QSizePolicy::Minimum);
-        buttons_layout->addItem( spacerItem );
-
-        if( psz_default )
-        {
-            *defaul = new QPushButton(0);
-            (*defaul)->setFocus();
-            buttons_layout->addWidget( *defaul );
-            (*defaul)->setText( qfu( psz_default ) );
-        }
-        if( psz_alt )
-        {
-            *alt = new QPushButton(0);
-            buttons_layout->addWidget( *alt );
-            (*alt)->setText( qfu( psz_alt ) );
-        }
-        if( psz_other )
-        {
-            *other = new QPushButton( 0 );
-            buttons_layout->addWidget( *other );
-            (*other)->setText( qfu( psz_other ) );
-        }
-        if( l )
-            l->addLayout( buttons_layout );
-#endif
-        return buttons_layout;
-    };
-
     QVLCFrame( intf_thread_t *_p_intf ) : QWidget( NULL ), p_intf( _p_intf )
     {    };
     virtual ~QVLCFrame()   {};