]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/playlist/standardpanel.cpp
Last patch to close #1479 (add a column with the track id)
[vlc] / modules / gui / qt4 / components / playlist / standardpanel.cpp
index 16376efde8685016f94eb5d60f433257e21da9c2..058a53381d917ed7fd2f75d51ed48f676bfc839e 100644 (file)
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include "qt4.hpp"
 #include "dialogs_provider.hpp"
-#include "playlist_model.hpp"
+#include "components/playlist/playlist_model.hpp"
 #include "components/playlist/panels.hpp"
 #include "util/customwidgets.hpp"
 
@@ -133,6 +136,12 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
     BUTTONACT( repeatButton, toggleRepeat() );
     buttons->addWidget( repeatButton );
 
+    /* Goto */
+    gotoPlayingButton = new QPushButton( "X" , this );
+    gotoPlayingButton->setToolTip( qtr( "Show the current item" ));
+    BUTTONACT( gotoPlayingButton, gotoPlayingItem() );
+    buttons->addWidget( gotoPlayingButton );
+
     /* A Spacer and the search possibilities */
     QSpacerItem *spacer = new QSpacerItem( 10, 20 );
     buttons->addItem( spacer );
@@ -193,6 +202,11 @@ void StandardPLPanel::toggleRandom()
     randomButton->setToolTip( prev ? qtr( I_PL_NORANDOM ) : qtr(I_PL_RANDOM ) );
 }
 
+void StandardPLPanel::gotoPlayingItem()
+{
+    view->scrollTo( view->currentIndex() );
+}
+
 void StandardPLPanel::handleExpansion( const QModelIndex &index )
 {
     if( model->isCurrent( index ) )
@@ -261,13 +275,14 @@ void StandardPLPanel::popupSelectColumn( QPoint pos )
     CONNECT( ContextUpdateMapper, mapped( int ),  model, viewchanged( int ) );
 
     ADD_META_ACTION( TITLE );
-    ADD_META_ACTION( ARTIST );
     ADD_META_ACTION( DURATION );
-    ADD_META_ACTION( COLLECTION );
+    ADD_META_ACTION( ARTIST );
     ADD_META_ACTION( GENRE );
+    ADD_META_ACTION( COLLECTION );
     ADD_META_ACTION( SEQ_NUM );
-    ADD_META_ACTION( RATING );
     ADD_META_ACTION( DESCRIPTION );
+    ADD_META_ACTION( RATING );
+    ADD_META_ACTION( TRACKID );
 
 #undef ADD_META_ACTION
 
@@ -311,7 +326,7 @@ void StandardPLPanel::removeItem( int i_id )
     model->removeItem( i_id );
 }
 
-/* Delete and Suppr key remove the selection 
+/* Delete and Suppr key remove the selection
    FilterKey function and code function */
 void StandardPLPanel::keyPressEvent( QKeyEvent *e )
 {