]> git.sesse.net Git - vlc/commitdiff
Qt: remove random and repeat buttons from playlist
authorJean-Baptiste Kempf <jb@videolan.org>
Sun, 29 Nov 2009 23:21:56 +0000 (00:21 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 4 Dec 2009 06:21:39 +0000 (07:21 +0100)
And clean the code.

modules/gui/qt4/components/playlist/panels.hpp
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.hpp
modules/gui/qt4/components/playlist/standardpanel.cpp

index 7499c40e3d3261807e8ff69cb24c9ac3167f0fab..42694097d1c5a84e8e9d58dcf5c7469eb1557554 100644 (file)
@@ -62,7 +62,7 @@ private:
     QWidget *parent;
     QLabel *title;
     QTreeView *view;
-    QPushButton *repeatButton, *randomButton, *addButton, *gotoPlayingButton;
+    QPushButton *addButton, *gotoPlayingButton;
     int currentRootId;
     QSignalMapper *selectColumnsSigMapper;
 
@@ -72,8 +72,6 @@ public slots:
 private slots:
     void deleteSelection();
     void handleExpansion( const QModelIndex& );
-    void toggleRandom();
-    void toggleRepeat();
     void gotoPlayingItem();
     void doPopup( QModelIndex index, QPoint point );
     void search( const QString& searchText );
index 09236151530cf1379ae3dcad9632daa355f01872..3d0e6f18fbf115065288a8438275a086542ef8a7 100644 (file)
@@ -456,35 +456,6 @@ QStringList PLModel::selectedURIs()
     return lst;
 }
 
-/************************* General playlist status ***********************/
-
-bool PLModel::hasRandom()
-{
-    return var_GetBool( p_playlist, "random" );
-}
-bool PLModel::hasRepeat()
-{
-    return var_GetBool( p_playlist, "repeat" );
-}
-bool PLModel::hasLoop()
-{
-    return var_GetBool( p_playlist, "loop" );
-}
-void PLModel::setLoop( bool on )
-{
-    var_SetBool( p_playlist, "loop", on ? true:false );
-    config_PutInt( p_playlist, "loop", on ? 1: 0 );
-}
-void PLModel::setRepeat( bool on )
-{
-    var_SetBool( p_playlist, "repeat", on ? true:false );
-    config_PutInt( p_playlist, "repeat", on ? 1: 0 );
-}
-void PLModel::setRandom( bool on )
-{
-    var_SetBool( p_playlist, "random", on ? true:false );
-    config_PutInt( p_playlist, "random", on ? 1: 0 );
-}
 
 /************************* Lookups *****************************/
 
index ddfab8eaff6c25e2b25b12f129cf090c103d9a13..cade3379b8f31f4d2c65b5c58f6f2465fd41a7cd 100644 (file)
@@ -81,7 +81,6 @@ public:
 
     /* Lookups */
     QStringList selectedURIs();
-    bool hasRandom(); bool hasLoop(); bool hasRepeat();
     QModelIndex index( PLItem *, int c ) const;
     QModelIndex currentIndex( ) { return index( currentItem, 0 ); };
     bool isCurrent( const QModelIndex &index ) const;
@@ -144,9 +143,6 @@ signals:
 public slots:
     void activateItem( const QModelIndex &index );
     void activateItem( playlist_item_t *p_item );
-    void setRandom( bool );
-    void setLoop( bool );
-    void setRepeat( bool );
 
 private slots:
     void popupPlay();
index 923a14cb040c8041df98bf3bedce763afd354bea..adee4045ae3cb2a6d02260f1f19ad8bbe24c4b38 100644 (file)
@@ -1,10 +1,11 @@
 /*****************************************************************************
  * standardpanel.cpp : The "standard" playlist panel : just a treeview
  ****************************************************************************
- * Copyright (C) 2000-2005 the VideoLAN team
+ * Copyright (C) 2000-2009 VideoLAN
  * $Id$
  *
  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
+ *          JB Kempf
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -118,38 +119,6 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
     BUTTONACT( addButton, popupAdd() );
     buttons->addWidget( addButton );
 
-    /* Random 2-state button */
-    randomButton = new QPushButton( this );
-    randomButton->setIcon( QIcon( ":/buttons/playlist/shuffle_on" ));
-    randomButton->setToolTip( qtr( I_PL_RANDOM ));
-    randomButton->setCheckable( true );
-    randomButton->setChecked( model->hasRandom() );
-    BUTTONACT( randomButton, toggleRandom() );
-    buttons->addWidget( randomButton );
-
-    /* Repeat 3-state button */
-    repeatButton = new QPushButton( this );
-    repeatButton->setToolTip( qtr( "Click to toggle between loop one, loop all" ) );
-    repeatButton->setCheckable( true );
-
-    if( model->hasRepeat() )
-    {
-        repeatButton->setIcon( QIcon( ":/buttons/playlist/repeat_one" ) );
-        repeatButton->setChecked( true );
-    }
-    else if( model->hasLoop() )
-    {
-        repeatButton->setIcon( QIcon( ":/buttons/playlist/repeat_all" ) );
-        repeatButton->setChecked( true );
-    }
-    else
-    {
-        repeatButton->setIcon( QIcon( ":/buttons/playlist/repeat_one" ) );
-        repeatButton->setChecked( false );
-    }
-    BUTTONACT( repeatButton, toggleRepeat() );
-    buttons->addWidget( repeatButton );
-
     /* Goto */
     gotoPlayingButton = new QPushButton;
     BUTTON_SET_ACT_I( gotoPlayingButton, "", buttons/playlist/jump_to,
@@ -186,36 +155,6 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
     CONNECT( selectColumnsSigMapper, mapped( int ), this, toggleColumnShown( int ) );
 }
 
-/* Function to toggle between the Repeat states */
-void StandardPLPanel::toggleRepeat()
-{
-    if( model->hasRepeat() )
-    {
-        model->setRepeat( false ); model->setLoop( true );
-        repeatButton->setIcon( QIcon( ":/buttons/playlist/repeat_all" ) );
-        repeatButton->setChecked( true );
-    }
-    else if( model->hasLoop() )
-    {
-        model->setRepeat( false ) ; model->setLoop( false );
-        repeatButton->setChecked( false );
-        repeatButton->setIcon( QIcon( ":/buttons/playlist/repeat_one" ) );
-    }
-    else
-    {
-        model->setRepeat( true ); model->setLoop( false );
-        repeatButton->setChecked( true );
-        repeatButton->setIcon( QIcon( ":/buttons/playlist/repeat_one" ) );
-    }
-}
-
-/* Function to toggle between the Random states */
-void StandardPLPanel::toggleRandom()
-{
-    bool prev = model->hasRandom();
-    model->setRandom( !prev );
-}
-
 void StandardPLPanel::gotoPlayingItem()
 {
     view->scrollTo( model->currentIndex() );