Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
5d3edb82
Commit
5d3edb82
authored
Dec 13, 2004
by
bigben
Browse files
Implements sorting of the current node from context menu
parent
c5d68965
Changes
5
Hide whitespace changes
Inline
Side-by-side
extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib
View file @
5d3edb82
...
...
@@ -395,6 +395,8 @@
playItem = id;
searchItem = id;
selectAll = id;
sortNodeByAuthor = id;
sortNodeByName = id;
};
CLASS = VLCPlaylist;
LANGUAGE = ObjC;
...
...
@@ -407,6 +409,8 @@
"o_mi_play" = id;
"o_mi_save_playlist" = id;
"o_mi_selectall" = id;
"o_mi_sort_author" = id;
"o_mi_sort_name" = id;
"o_outline_view" = id;
"o_random_ckb" = id;
"o_search_field" = id;
...
...
extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib
View file @
5d3edb82
...
...
@@ -3,7 +3,7 @@
<plist
version=
"1.0"
>
<dict>
<key>
IBDocumentLocation
</key>
<string>
94 10
4 505 517 0 0 1024 746
</string>
<string>
230 -8
4 505 517 0 0 1024 746
</string>
<key>
IBEditorPositions
</key>
<dict>
<key>
1617
</key>
...
...
@@ -13,7 +13,7 @@
<key>
29
</key>
<string>
84 667 419 44 0 0 1024 746
</string>
<key>
915
</key>
<string>
620 32
6 1
00
1
3
0 0 0 1024 746
</string>
<string>
731 41
6 1
65
1
8
0 0 0 1024 746
</string>
</dict>
<key>
IBFramework Version
</key>
<string>
364.0
</string>
...
...
extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib
View file @
5d3edb82
No preview for this file type
modules/gui/macosx/playlist.h
View file @
5d3edb82
...
...
@@ -52,6 +52,8 @@
IBOutlet
id
o_mi_delete
;
IBOutlet
id
o_mi_info
;
IBOutlet
id
o_mi_selectall
;
IBOutlet
id
o_mi_sort_name
;
IBOutlet
id
o_mi_sort_author
;
NSImage
*
o_descendingSortingImage
;
NSImage
*
o_ascendingSortingImage
;
...
...
@@ -68,10 +70,13 @@
-
(
NSMenu
*
)
menuForEvent
:(
NSEvent
*
)
o_event
;
-
(
void
)
playlistUpdated
;
-
(
void
)
sortNode
:(
int
)
i_mode
;
-
(
IBAction
)
playItem
:(
id
)
sender
;
-
(
IBAction
)
deleteItem
:(
id
)
sender
;
-
(
IBAction
)
selectAll
:(
id
)
sender
;
-
(
IBAction
)
sortNodeByName
:(
id
)
sender
;
-
(
IBAction
)
sortNodeByAuthor
:(
id
)
sender
;
-
(
void
)
appendArray
:(
NSArray
*
)
o_array
atPos
:(
int
)
i_position
enqueue
:(
BOOL
)
b_enqueue
;
...
...
modules/gui/macosx/playlist.m
View file @
5d3edb82
...
...
@@ -152,6 +152,8 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
[
o_mi_delete
setTitle
:
_NS
(
"Delete"
)];
[
o_mi_selectall
setTitle
:
_NS
(
"Select All"
)];
[
o_mi_info
setTitle
:
_NS
(
"Properties"
)];
[
o_mi_sort_name
setTitle
:
_NS
(
"Sort Node by Name"
)];
[
o_mi_sort_author
setTitle
:
_NS
(
"Sort Node by Author"
)];
[[
o_tc_name
headerCell
]
setStringValue
:
_NS
(
"Name"
)];
[[
o_tc_author
headerCell
]
setStringValue
:
_NS
(
"Author"
)];
[[
o_tc_duration
headerCell
]
setStringValue
:
_NS
(
"Duration"
)];
...
...
@@ -318,6 +320,65 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
}
}
-
(
IBAction
)
sortNodeByName
:(
id
)
sender
{
[
self
sortNode
:
SORT_TITLE
];
}
-
(
IBAction
)
sortNodeByAuthor
:(
id
)
sender
{
[
self
sortNode
:
SORT_AUTHOR
];
}
-
(
void
)
sortNode
:(
int
)
i_mode
{
playlist_t
*
p_playlist
=
vlc_object_find
(
VLCIntf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
playlist_item_t
*
p_item
;
if
(
p_playlist
==
NULL
)
{
return
;
}
if
([
o_outline_view
selectedRow
]
>
-
1
)
{
p_item
=
[[
o_outline_view
itemAtRow
:
[
o_outline_view
selectedRow
]]
pointerValue
];
}
else
/*If no item is selected, sort the whole playlist*/
{
playlist_view_t
*
p_view
=
playlist_ViewFind
(
p_playlist
,
VIEW_SIMPLE
);
p_item
=
p_view
->
p_root
;
}
if
(
p_item
->
i_children
>
-
1
)
{
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
playlist_RecursiveNodeSort
(
p_playlist
,
p_item
,
i_mode
,
ORDER_NORMAL
);
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
}
else
{
int
i
;
for
(
i
=
0
;
i
<
p_item
->
i_parents
;
i
++
)
{
if
(
p_item
->
pp_parents
[
i
]
->
i_view
==
VIEW_SIMPLE
)
{
vlc_mutex_lock
(
&
p_playlist
->
object_lock
);
playlist_RecursiveNodeSort
(
p_playlist
,
p_item
->
pp_parents
[
i
]
->
p_parent
,
i_mode
,
ORDER_NORMAL
);
vlc_mutex_unlock
(
&
p_playlist
->
object_lock
);
break
;
}
}
}
vlc_object_release
(
p_playlist
);
[
self
playlistUpdated
];
}
-
(
void
)
appendArray
:(
NSArray
*
)
o_array
atPos
:(
int
)
i_position
enqueue
:(
BOOL
)
b_enqueue
{
int
i_item
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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