Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
157f43b7
Commit
157f43b7
authored
Nov 30, 2009
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: playlist code cosmetics
parent
99b1edc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+20
-20
No files found.
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
157f43b7
...
@@ -55,27 +55,32 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
...
@@ -55,27 +55,32 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
playlist_item_t
*
p_root
)
:
playlist_item_t
*
p_root
)
:
QWidget
(
_parent
),
p_intf
(
_p_intf
)
QWidget
(
_parent
),
p_intf
(
_p_intf
)
{
{
model
=
new
PLModel
(
p_playlist
,
p_intf
,
p_root
,
this
);
QVBoxLayout
*
layout
=
new
QVBoxLayout
(
this
);
QVBoxLayout
*
layout
=
new
QVBoxLayout
();
layout
->
setSpacing
(
0
);
layout
->
setMargin
(
0
);
layout
->
setSpacing
(
0
);
layout
->
setMargin
(
0
);
model
=
new
PLModel
(
p_playlist
,
p_intf
,
p_root
,
this
);
/* Create and configure the QTreeView */
/* Create and configure the QTreeView */
view
=
new
QVLCTreeView
;
view
=
new
QVLCTreeView
;
view
->
setModel
(
model
);
view
->
setModel
(
model
);
view
->
setIconSize
(
QSize
(
20
,
20
)
);
view
->
setIconSize
(
QSize
(
20
,
20
)
);
view
->
setAlternatingRowColors
(
true
);
view
->
setAlternatingRowColors
(
true
);
view
->
setAnimated
(
true
);
view
->
setAnimated
(
true
);
view
->
setUniformRowHeights
(
true
);
view
->
setSortingEnabled
(
true
);
view
->
header
()
->
setSortIndicator
(
-
1
,
Qt
::
AscendingOrder
);
view
->
header
()
->
setSortIndicatorShown
(
true
);
view
->
header
()
->
setClickable
(
true
);
view
->
header
()
->
setContextMenuPolicy
(
Qt
::
CustomContextMenu
);
view
->
setSelectionBehavior
(
QAbstractItemView
::
SelectRows
);
view
->
setSelectionBehavior
(
QAbstractItemView
::
SelectRows
);
view
->
setSelectionMode
(
QAbstractItemView
::
ExtendedSelection
);
view
->
setSelectionMode
(
QAbstractItemView
::
ExtendedSelection
);
view
->
setDragEnabled
(
true
);
view
->
setDragEnabled
(
true
);
view
->
setAcceptDrops
(
true
);
view
->
setAcceptDrops
(
true
);
view
->
setDropIndicatorShown
(
true
);
view
->
setDropIndicatorShown
(
true
);
view
->
header
()
->
setSortIndicator
(
-
1
,
Qt
::
AscendingOrder
);
view
->
setUniformRowHeights
(
true
);
view
->
setSortingEnabled
(
true
);
/* Saved Settings */
getSettings
()
->
beginGroup
(
"Playlist"
);
getSettings
()
->
beginGroup
(
"Playlist"
);
if
(
getSettings
()
->
contains
(
"headerStateV2"
)
)
if
(
getSettings
()
->
contains
(
"headerStateV2"
)
)
{
{
...
@@ -84,17 +89,13 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
...
@@ -84,17 +89,13 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
}
}
else
else
{
{
int
m
,
c
;
for
(
int
m
=
1
,
c
=
0
;
m
!=
COLUMN_END
;
m
<<=
1
,
c
++
)
for
(
m
=
1
,
c
=
0
;
m
!=
COLUMN_END
;
m
<<=
1
,
c
++
)
{
{
view
->
setColumnHidden
(
c
,
!
(
m
&
COLUMN_DEFAULT
)
);
view
->
setColumnHidden
(
c
,
!
(
m
&
COLUMN_DEFAULT
)
);
if
(
m
==
COLUMN_TITLE
)
view
->
header
()
->
resizeSection
(
c
,
200
);
if
(
m
==
COLUMN_TITLE
)
view
->
header
()
->
resizeSection
(
c
,
200
);
else
if
(
m
==
COLUMN_DURATION
)
view
->
header
()
->
resizeSection
(
c
,
80
);
else
if
(
m
==
COLUMN_DURATION
)
view
->
header
()
->
resizeSection
(
c
,
80
);
}
}
}
}
view
->
header
()
->
setSortIndicatorShown
(
true
);
view
->
header
()
->
setClickable
(
true
);
view
->
header
()
->
setContextMenuPolicy
(
Qt
::
CustomContextMenu
);
getSettings
()
->
endGroup
();
getSettings
()
->
endGroup
();
/* Connections for the TreeView */
/* Connections for the TreeView */
...
@@ -149,12 +150,18 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
...
@@ -149,12 +150,18 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
layout
->
addWidget
(
view
);
layout
->
addWidget
(
view
);
layout
->
addLayout
(
buttons
);
layout
->
addLayout
(
buttons
);
// layout->addWidget( bar );
// layout->addWidget( bar );
setLayout
(
layout
);
selectColumnsSigMapper
=
new
QSignalMapper
(
this
);
selectColumnsSigMapper
=
new
QSignalMapper
(
this
);
CONNECT
(
selectColumnsSigMapper
,
mapped
(
int
),
this
,
toggleColumnShown
(
int
)
);
CONNECT
(
selectColumnsSigMapper
,
mapped
(
int
),
this
,
toggleColumnShown
(
int
)
);
}
}
StandardPLPanel
::~
StandardPLPanel
()
{
getSettings
()
->
beginGroup
(
"Playlist"
);
getSettings
()
->
setValue
(
"headerStateV2"
,
view
->
header
()
->
saveState
()
);
getSettings
()
->
endGroup
();
}
void
StandardPLPanel
::
gotoPlayingItem
()
void
StandardPLPanel
::
gotoPlayingItem
()
{
{
view
->
scrollTo
(
model
->
currentIndex
()
);
view
->
scrollTo
(
model
->
currentIndex
()
);
...
@@ -292,10 +299,3 @@ void StandardPLPanel::deleteSelection()
...
@@ -292,10 +299,3 @@ void StandardPLPanel::deleteSelection()
model
->
doDelete
(
list
);
model
->
doDelete
(
list
);
}
}
StandardPLPanel
::~
StandardPLPanel
()
{
getSettings
()
->
beginGroup
(
"Playlist"
);
getSettings
()
->
setValue
(
"headerStateV2"
,
view
->
header
()
->
saveState
()
);
getSettings
()
->
endGroup
();
}
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