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
a4f1bc2b
Commit
a4f1bc2b
authored
Nov 22, 2011
by
Edward Wang
Committed by
Jean-Baptiste Kempf
Nov 22, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: implement playlist empty button
Close #4999 Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
b19aaff6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
modules/gui/qt4/components/playlist/playlist.cpp
modules/gui/qt4/components/playlist/playlist.cpp
+20
-0
modules/gui/qt4/components/playlist/playlist.hpp
modules/gui/qt4/components/playlist/playlist.hpp
+1
-0
No files found.
modules/gui/qt4/components/playlist/playlist.cpp
View file @
a4f1bc2b
...
...
@@ -112,6 +112,13 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
layout
->
addLayout
(
topbarLayout
,
0
,
1
);
topbarLayout
->
setSpacing
(
10
);
/* Button to clear playlist */
QToolButton
*
clearPlaylistButton
=
new
QToolButton
(
this
);
clearPlaylistButton
->
setIcon
(
style
()
->
standardIcon
(
QStyle
::
SP_TrashIcon
)
);
clearPlaylistButton
->
setToolTip
(
qtr
(
"Clear playlist"
)
);
topbarLayout
->
addWidget
(
clearPlaylistButton
);
CONNECT
(
clearPlaylistButton
,
clicked
(),
this
,
clearPlaylist
()
);
/* Button to switch views */
QToolButton
*
viewButton
=
new
QToolButton
(
this
);
viewButton
->
setIcon
(
style
()
->
standardIcon
(
QStyle
::
SP_FileDialogDetailedView
)
);
...
...
@@ -249,6 +256,19 @@ void PlaylistWidget::changeView( const QModelIndex& index )
viewActions
[
i
]
->
setChecked
(
true
);
}
void
PlaylistWidget
::
clearPlaylist
()
{
PLModel
*
model
=
PLModel
::
getPLModel
(
p_intf
);
if
(
model
->
rowCount
()
<
1
)
return
;
QModelIndexList
*
l
=
new
QModelIndexList
();
for
(
int
i
=
0
;
i
<
model
->
rowCount
();
i
++
)
{
QModelIndex
indexrecord
=
model
->
index
(
i
,
0
,
QModelIndex
()
);
l
->
append
(
indexrecord
);
}
model
->
doDelete
(
*
l
);
}
#include <QSignalMapper>
#include <QMenu>
#include <QPainter>
...
...
modules/gui/qt4/components/playlist/playlist.hpp
View file @
a4f1bc2b
...
...
@@ -75,6 +75,7 @@ protected:
virtual
void
closeEvent
(
QCloseEvent
*
);
private
slots
:
void
changeView
(
const
QModelIndex
&
index
);
void
clearPlaylist
();
};
#ifdef Q_WS_MAC
...
...
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