Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
9ee8da32
Commit
9ee8da32
authored
Mar 25, 2004
by
zorglub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't save an empty playlist
Fix refcount problem
parent
491b9e70
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
14 deletions
+23
-14
modules/gui/wxwindows/playlist.cpp
modules/gui/wxwindows/playlist.cpp
+23
-14
No files found.
modules/gui/wxwindows/playlist.cpp
View file @
9ee8da32
...
...
@@ -2,7 +2,7 @@
* playlist.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2004 VideoLAN
* $Id
: playlist.cpp,v 1.49 2004/02/29 14:05:45 zorglub Exp
$
* $Id$
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
*
...
...
@@ -594,6 +594,23 @@ void Playlist::OnSave( wxCommandEvent& WXUNUSED(event) )
}
formats
[]
=
{{
_
(
"M3U file"
),
"*.m3u"
,
"export-m3u"
},
{
_
(
"PLS file"
),
"*.pls"
,
"export-pls"
}};
wxString
filter
=
wxT
(
""
);
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
!
p_playlist
)
{
return
;
}
if
(
p_playlist
->
i_size
==
0
)
{
wxMessageBox
(
wxU
(
_
(
"Playlist is empty"
)
),
wxU
(
_
(
"Can't save"
)),
wxICON_WARNING
|
wxOK
,
this
);
vlc_object_release
(
p_playlist
);
return
;
}
for
(
unsigned
int
i
=
0
;
i
<
sizeof
(
formats
)
/
sizeof
(
formats
[
0
]);
i
++
)
{
filter
.
Append
(
wxU
(
formats
[
i
].
psz_desc
)
);
...
...
@@ -605,13 +622,6 @@ void Playlist::OnSave( wxCommandEvent& WXUNUSED(event) )
wxT
(
""
),
wxT
(
""
),
filter
,
wxSAVE
);
if
(
dialog
.
ShowModal
()
==
wxID_OK
)
{
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_intf
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
p_playlist
)
{
if
(
dialog
.
GetFilename
().
mb_str
()
)
{
...
...
@@ -622,7 +632,6 @@ void Playlist::OnSave( wxCommandEvent& WXUNUSED(event) )
vlc_object_release
(
p_playlist
);
}
}
void
Playlist
::
OnOpen
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
...
...
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