[vlc-devel] commit: Qt: the Add button on playlist panel is gone (Jakob Leben )

git version control git at videolan.org
Sun Feb 14 06:43:06 CET 2010


vlc | branch: master | Jakob Leben <jleben at videolan.org> | Sun Feb 14 05:51:49 2010 +0100| [1497d96c75ae009b92d25fbe2c4fd4e47777dd61] | committer: Jakob Leben 

Qt: the Add button on playlist panel is gone

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

 .../gui/qt4/components/playlist/standardpanel.cpp  |   56 ++------------------
 .../gui/qt4/components/playlist/standardpanel.hpp  |    2 -
 2 files changed, 4 insertions(+), 54 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/standardpanel.cpp b/modules/gui/qt4/components/playlist/standardpanel.cpp
index 357d75f..55d5029 100644
--- a/modules/gui/qt4/components/playlist/standardpanel.cpp
+++ b/modules/gui/qt4/components/playlist/standardpanel.cpp
@@ -77,12 +77,12 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
 
     locationBar = new LocationBar( model );
     locationBar->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Preferred );
-    layout->addWidget( locationBar, 0, 1 );
-    layout->setColumnStretch( 1, 100 );
+    layout->addWidget( locationBar, 0, 0 );
+    layout->setColumnStretch( 0, 100 );
     CONNECT( locationBar, invoked( const QModelIndex & ),
              this, browseInto( const QModelIndex & ) );
 
-    layout->setColumnStretch( 2, 1 );
+    layout->setColumnStretch( 1, 1 );
 
     searchEdit = new SearchLineEdit( this );
     searchEdit->setMaximumWidth( 250 );
@@ -92,17 +92,10 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
              this, search( const QString& ) );
     layout->setColumnStretch( 3, 50 );
 
-    /* Add item to the playlist button */
-    addButton = new QToolButton;
-    addButton->setIcon( QIcon( ":/buttons/playlist/playlist_add" ) );
-    addButton->setMaximumWidth( 30 );
-    BUTTONACT( addButton, popupAdd() );
-    layout->addWidget( addButton, 0, 0 );
-
     /* Button to switch views */
     QToolButton *viewButton = new QToolButton( this );
     viewButton->setIcon( style()->standardIcon( QStyle::SP_FileDialogDetailedView ) );
-    layout->addWidget( viewButton, 0, 4 );
+    layout->addWidget( viewButton, 0, 2 );
 
     /* View selection menu */
     viewSelectionMapper = new QSignalMapper( this );
@@ -168,48 +161,7 @@ void StandardPLPanel::handleExpansion( const QModelIndex& index )
 
 void StandardPLPanel::handleRootChange()
 {
-    /* needed for popupAdd() */
-    PLItem *root = model->getItem( QModelIndex() );
-    currentRootId = root->id();
-
     browseInto();
-
-    /* enable/disable adding */
-    if( currentRootId == THEPL->p_playing->i_id )
-    {
-        addButton->setEnabled( true );
-        addButton->setToolTip( qtr(I_PL_ADDPL) );
-    }
-    else if( THEPL->p_media_library &&
-             currentRootId == THEPL->p_media_library->i_id )
-    {
-        addButton->setEnabled( true );
-        addButton->setToolTip( qtr(I_PL_ADDML) );
-    }
-    else
-        addButton->setEnabled( false );
-}
-
-/* PopupAdd Menu for the Add Menu */
-void StandardPLPanel::popupAdd()
-{
-    QMenu popup;
-    if( currentRootId == THEPL->p_playing->i_id )
-    {
-        popup.addAction( qtr(I_PL_ADDF), THEDP, SLOT( simplePLAppendDialog()) );
-        popup.addAction( qtr(I_PL_ADDDIR), THEDP, SLOT( PLAppendDir()) );
-        popup.addAction( qtr(I_OP_ADVOP), THEDP, SLOT( PLAppendDialog()) );
-    }
-    else if( THEPL->p_media_library &&
-                currentRootId == THEPL->p_media_library->i_id )
-    {
-        popup.addAction( qtr(I_PL_ADDF), THEDP, SLOT( simpleMLAppendDialog()) );
-        popup.addAction( qtr(I_PL_ADDDIR), THEDP, SLOT( MLAppendDir() ) );
-        popup.addAction( qtr(I_OP_ADVOP), THEDP, SLOT( MLAppendDialog() ) );
-    }
-
-    popup.exec( QCursor::pos() - addButton->mapFromGlobal( QCursor::pos() )
-                        + QPoint( 0, addButton->height() ) );
 }
 
 void StandardPLPanel::popupPlView( const QPoint &point )
diff --git a/modules/gui/qt4/components/playlist/standardpanel.hpp b/modules/gui/qt4/components/playlist/standardpanel.hpp
index 1983d60..6885f82 100644
--- a/modules/gui/qt4/components/playlist/standardpanel.hpp
+++ b/modules/gui/qt4/components/playlist/standardpanel.hpp
@@ -74,7 +74,6 @@ private:
 
     QWidget     *parent;
     QLabel      *title;
-    QToolButton *addButton;
     QGridLayout *layout;
     LocationBar *locationBar;
     SearchLineEdit *searchEdit;
@@ -109,7 +108,6 @@ private slots:
     void handleRootChange();
     void gotoPlayingItem();
     void search( const QString& searchText );
-    void popupAdd();
     void popupSelectColumn( QPoint );
     void popupPlView( const QPoint & );
     void toggleColumnShown( int );




More information about the vlc-devel mailing list