Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
cc84ac38
Commit
cc84ac38
authored
Apr 23, 2005
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete selection (either by menu or key)
parent
40a8f626
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
26 deletions
+53
-26
modules/gui/wxwindows/playlist.cpp
modules/gui/wxwindows/playlist.cpp
+50
-26
modules/gui/wxwindows/wxwindows.h
modules/gui/wxwindows/wxwindows.h
+3
-0
No files found.
modules/gui/wxwindows/playlist.cpp
View file @
cc84ac38
...
@@ -158,6 +158,7 @@ BEGIN_EVENT_TABLE(Playlist, wxFrame)
...
@@ -158,6 +158,7 @@ BEGIN_EVENT_TABLE(Playlist, wxFrame)
/* Tree control events */
/* Tree control events */
EVT_TREE_ITEM_ACTIVATED
(
TreeCtrl_Event
,
Playlist
::
OnActivateItem
)
EVT_TREE_ITEM_ACTIVATED
(
TreeCtrl_Event
,
Playlist
::
OnActivateItem
)
EVT_TREE_KEY_DOWN
(
-
1
,
Playlist
::
OnKeyDown
)
EVT_CONTEXT_MENU
(
Playlist
::
OnPopup
)
EVT_CONTEXT_MENU
(
Playlist
::
OnPopup
)
...
@@ -845,6 +846,36 @@ void Playlist::UpdatePlaylist()
...
@@ -845,6 +846,36 @@ void Playlist::UpdatePlaylist()
/*****************************************************************************
/*****************************************************************************
* Private methods.
* Private methods.
*****************************************************************************/
*****************************************************************************/
void
Playlist
::
DeleteTreeItem
(
wxTreeItemId
item
)
{
PlaylistItem
*
p_wxitem
;
playlist_item_t
*
p_item
;
p_wxitem
=
(
PlaylistItem
*
)
treectrl
->
GetItemData
(
item
);
LockPlaylist
(
p_intf
->
p_sys
,
p_playlist
);
p_item
=
playlist_ItemGetById
(
p_playlist
,
p_wxitem
->
i_id
);
if
(
!
p_item
)
{
UnlockPlaylist
(
p_intf
->
p_sys
,
p_playlist
);
return
;
}
if
(
p_item
->
i_children
==
-
1
)
{
UnlockPlaylist
(
p_intf
->
p_sys
,
p_playlist
);
DeleteItem
(
p_item
->
input
.
i_id
);
}
else
{
UnlockPlaylist
(
p_intf
->
p_sys
,
p_playlist
);
DeleteNode
(
p_item
);
}
RemoveItem
(
item
);
}
void
Playlist
::
DeleteItem
(
int
item_id
)
void
Playlist
::
DeleteItem
(
int
item_id
)
{
{
playlist_LockDelete
(
p_playlist
,
item_id
);
playlist_LockDelete
(
p_playlist
,
item_id
);
...
@@ -999,11 +1030,26 @@ void Playlist::OnSearch( wxCommandEvent& WXUNUSED(event) )
...
@@ -999,11 +1030,26 @@ void Playlist::OnSearch( wxCommandEvent& WXUNUSED(event) )
**********************************************************************/
**********************************************************************/
void
Playlist
::
OnInvertSelection
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
void
Playlist
::
OnInvertSelection
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
{
{
// InvertSelection( treectrl, treectrl->GetRootItem() );
}
void
Playlist
::
RecursiveDeleteSelection
(
wxTreeItemId
root
)
{
wxTreeItemIdValue
cookie
;
wxTreeItemId
child
=
treectrl
->
GetFirstChild
(
root
,
cookie
);
while
(
child
.
IsOk
()
)
{
if
(
treectrl
->
ItemHasChildren
(
child
)
)
RecursiveDeleteSelection
(
child
);
else
if
(
treectrl
->
IsSelected
(
child
)
)
DeleteTreeItem
(
child
);
child
=
treectrl
->
GetNextChild
(
root
,
cookie
);
}
}
}
void
Playlist
::
OnDeleteSelection
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
void
Playlist
::
OnDeleteSelection
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
{
{
Re
build
(
VLC_TRUE
);
Re
cursiveDeleteSelection
(
treectrl
->
GetRootItem
()
);
}
}
void
Playlist
::
OnSelectAll
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
void
Playlist
::
OnSelectAll
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
...
@@ -1345,29 +1391,7 @@ void Playlist::Preparse()
...
@@ -1345,29 +1391,7 @@ void Playlist::Preparse()
void
Playlist
::
OnPopupDel
(
wxCommandEvent
&
event
)
void
Playlist
::
OnPopupDel
(
wxCommandEvent
&
event
)
{
{
PlaylistItem
*
p_wxitem
;
DeleteTreeItem
(
i_wx_popup_item
);
playlist_item_t
*
p_item
;
p_wxitem
=
(
PlaylistItem
*
)
treectrl
->
GetItemData
(
i_wx_popup_item
);
LockPlaylist
(
p_intf
->
p_sys
,
p_playlist
);
p_item
=
playlist_ItemGetById
(
p_playlist
,
p_wxitem
->
i_id
);
if
(
!
p_item
)
{
UnlockPlaylist
(
p_intf
->
p_sys
,
p_playlist
);
return
;
}
if
(
p_item
->
i_children
==
-
1
)
{
UnlockPlaylist
(
p_intf
->
p_sys
,
p_playlist
);
DeleteItem
(
p_item
->
input
.
i_id
);
}
else
{
UnlockPlaylist
(
p_intf
->
p_sys
,
p_playlist
);
DeleteNode
(
p_item
);
}
}
}
void
Playlist
::
OnPopupSort
(
wxCommandEvent
&
event
)
void
Playlist
::
OnPopupSort
(
wxCommandEvent
&
event
)
...
...
modules/gui/wxwindows/wxwindows.h
View file @
cc84ac38
...
@@ -860,9 +860,12 @@ public:
...
@@ -860,9 +860,12 @@ public:
private:
private:
void
RemoveItem
(
int
);
void
RemoveItem
(
int
);
void
DeleteTreeItem
(
wxTreeItemId
);
void
DeleteItem
(
int
item
);
void
DeleteItem
(
int
item
);
void
DeleteNode
(
playlist_item_t
*
node
);
void
DeleteNode
(
playlist_item_t
*
node
);
void
RecursiveDeleteSelection
(
wxTreeItemId
);
/* Event handlers (these functions should _not_ be virtual) */
/* Event handlers (these functions should _not_ be virtual) */
/* Menu Handlers */
/* Menu Handlers */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment