Commit 151a7cdf authored by Clément Stenac's avatar Clément Stenac

* Reverse sort the playlist when clicking twice on the column header

parent 85ed45c9
......@@ -2,7 +2,7 @@
* playlist.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: playlist.cpp,v 1.24 2003/11/17 00:06:19 sigmunau Exp $
* $Id: playlist.cpp,v 1.25 2003/11/21 13:20:41 zorglub Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
*
......@@ -156,6 +156,11 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
vlc_mutex_init( p_intf, &lock );
SetIcon( *p_intf->p_sys->p_icon );
i_title_sorted = 0;
i_author_sorted = 0;
i_group_sorted = 0;
var_Create( p_intf, "random", VLC_VAR_BOOL );
var_Change( p_intf, "random", VLC_VAR_INHERITVALUE, & val, NULL );
var_Create( p_intf, "loop", VLC_VAR_BOOL );
......@@ -676,13 +681,40 @@ void Playlist::OnColSelect( wxListEvent& event )
switch( event.GetColumn() )
{
case 0:
playlist_SortTitle( p_playlist, 0 );
if( i_title_sorted != 1 )
{
playlist_SortTitle( p_playlist, 0 );
i_title_sorted = 1;
}
else
{
playlist_SortTitle( p_playlist, 1 );
i_title_sorted = -1;
}
break;
case 1:
playlist_SortAuthor( p_playlist, 0 );
if( i_author_sorted != 1 )
{
playlist_SortAuthor( p_playlist, 0 );
i_author_sorted = 1;
}
else
{
playlist_SortAuthor( p_playlist, 1 );
i_author_sorted = -1;
}
break;
case 2:
playlist_SortGroup( p_playlist, 0 );
if( i_group_sorted != 1 )
{
playlist_SortGroup( p_playlist, 0 );
i_group_sorted = 1;
}
else
{
playlist_SortGroup( p_playlist, 1 );
i_group_sorted = -1;
}
break;
default:
break;
......
......@@ -2,7 +2,7 @@
* wxwindows.h: private wxWindows interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: wxwindows.h,v 1.70 2003/11/17 00:06:19 sigmunau Exp $
* $Id: wxwindows.h,v 1.71 2003/11/21 13:20:41 zorglub Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -778,6 +778,10 @@ private:
wxTreeCtrl *treeview;
int i_update_counter;
int i_sort_mode;
int i_title_sorted;
int i_author_sorted;
int i_group_sorted;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment