[vlc-devel] commit: Qt: remove random and repeat buttons from playlist ( Jean-Baptiste Kempf )
git version control
git at videolan.org
Fri Dec 4 07:21:47 CET 2009
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Nov 30 00:21:56 2009 +0100| [99b1edc0ffc7b5278b493c1160828d59db776ae0] | committer: Jean-Baptiste Kempf
Qt: remove random and repeat buttons from playlist
And clean the code.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=99b1edc0ffc7b5278b493c1160828d59db776ae0
---
modules/gui/qt4/components/playlist/panels.hpp | 4 +-
.../gui/qt4/components/playlist/playlist_model.cpp | 29 ---------
.../gui/qt4/components/playlist/playlist_model.hpp | 4 -
.../gui/qt4/components/playlist/standardpanel.cpp | 65 +-------------------
4 files changed, 3 insertions(+), 99 deletions(-)
diff --git a/modules/gui/qt4/components/playlist/panels.hpp b/modules/gui/qt4/components/playlist/panels.hpp
index 7499c40..4269409 100644
--- a/modules/gui/qt4/components/playlist/panels.hpp
+++ b/modules/gui/qt4/components/playlist/panels.hpp
@@ -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 );
diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index 0923615..3d0e6f1 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -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 *****************************/
diff --git a/modules/gui/qt4/components/playlist/playlist_model.hpp b/modules/gui/qt4/components/playlist/playlist_model.hpp
index ddfab8e..cade337 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.hpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.hpp
@@ -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();
diff --git a/modules/gui/qt4/components/playlist/standardpanel.cpp b/modules/gui/qt4/components/playlist/standardpanel.cpp
index 923a14c..adee404 100644
--- a/modules/gui/qt4/components/playlist/standardpanel.cpp
+++ b/modules/gui/qt4/components/playlist/standardpanel.cpp
@@ -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 at 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() );
More information about the vlc-devel
mailing list