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
64119e13
Commit
64119e13
authored
May 03, 2011
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: MLModel creation and assignation
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
9a68967d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
21 deletions
+39
-21
modules/gui/qt4/components/playlist/playlist.cpp
modules/gui/qt4/components/playlist/playlist.cpp
+3
-1
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+33
-19
modules/gui/qt4/components/playlist/standardpanel.hpp
modules/gui/qt4/components/playlist/standardpanel.hpp
+3
-1
No files found.
modules/gui/qt4/components/playlist/playlist.cpp
View file @
64119e13
...
...
@@ -30,6 +30,7 @@
#include "components/playlist/standardpanel.hpp"
/* MainView */
#include "components/playlist/selector.hpp"
/* PLSelector */
#include "components/playlist/playlist_model.hpp"
/* PLModel */
#include "components/playlist/ml_model.hpp"
/* MLModel */
#include "components/interface_widgets.hpp"
/* CoverArtLabel */
#include "util/searchlineedit.hpp"
...
...
@@ -93,7 +94,8 @@ PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
setMinimumWidth
(
400
);
PLModel
*
model
=
new
PLModel
(
p_playlist
,
p_intf
,
p_root
,
this
);
mainView
=
new
StandardPLPanel
(
this
,
p_intf
,
p_root
,
selector
,
model
);
MLModel
*
mlmodel
=
new
MLModel
(
p_intf
,
this
);
mainView
=
new
StandardPLPanel
(
this
,
p_intf
,
p_root
,
selector
,
model
,
mlmodel
);
/* Location Bar */
locationBar
=
new
LocationBar
(
model
);
...
...
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
64119e13
...
...
@@ -29,6 +29,7 @@
#include "components/playlist/standardpanel.hpp"
#include "components/playlist/playlist_model.hpp"
/* PLModel */
#include "components/playlist/ml_model.hpp"
/* MLModel */
#include "components/playlist/views.hpp"
/* 3 views */
#include "components/playlist/selector.hpp"
/* PLSelector */
#include "menus.hpp"
/* Popup */
...
...
@@ -53,9 +54,11 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
intf_thread_t
*
_p_intf
,
playlist_item_t
*
p_root
,
PLSelector
*
_p_selector
,
PLModel
*
_p_model
)
PLModel
*
_p_model
,
MLModel
*
_p_plmodel
)
:
QWidget
(
_parent
),
p_intf
(
_p_intf
),
p_selector
(
_p_selector
),
model
(
_p_model
)
p_selector
(
_p_selector
),
model
(
_p_model
),
mlmodel
(
_p_plmodel
)
{
viewStack
=
new
QStackedLayout
(
this
);
viewStack
->
setSpacing
(
0
);
viewStack
->
setMargin
(
0
);
...
...
@@ -191,10 +194,18 @@ void StandardPLPanel::searchDelayed( const QString& searchText )
/* This activated by the selector selection */
void
StandardPLPanel
::
setRoot
(
playlist_item_t
*
p_item
,
bool
b
)
{
if
(
b
)
//SQLML
return
;
model
->
rebuild
(
p_item
);
if
(
b
)
{
msg_Dbg
(
p_intf
,
"Setting the SQL ML"
);
currentView
->
setModel
(
mlmodel
);
}
else
{
msg_Dbg
(
p_intf
,
"Normal PL/ML or SD"
);
if
(
currentView
->
model
()
!=
model
)
currentView
->
setModel
(
model
);
model
->
rebuild
(
p_item
);
}
}
void
StandardPLPanel
::
browseInto
(
const
QModelIndex
&
index
)
...
...
@@ -409,20 +420,23 @@ void StandardPLPanel::cycleViews()
void
StandardPLPanel
::
activate
(
const
QModelIndex
&
index
)
{
/* If we are not a leaf node */
if
(
!
index
.
data
(
PLModel
::
IsLeafNodeRole
).
toBool
()
)
if
(
currentView
->
model
()
==
model
)
{
if
(
currentView
!=
treeView
)
browseInto
(
index
);
}
else
{
playlist_Lock
(
THEPL
);
playlist_item_t
*
p_item
=
playlist_ItemGetById
(
THEPL
,
model
->
itemId
(
index
)
);
p_item
->
i_flags
|=
PLAYLIST_SUBITEM_STOP_FLAG
;
lastActivatedId
=
p_item
->
p_input
->
i_id
;
playlist_Unlock
(
THEPL
);
model
->
activateItem
(
index
);
/* If we are not a leaf node */
if
(
!
index
.
data
(
PLModel
::
IsLeafNodeRole
).
toBool
()
)
{
if
(
currentView
!=
treeView
)
browseInto
(
index
);
}
else
{
playlist_Lock
(
THEPL
);
playlist_item_t
*
p_item
=
playlist_ItemGetById
(
THEPL
,
model
->
itemId
(
index
)
);
p_item
->
i_flags
|=
PLAYLIST_SUBITEM_STOP_FLAG
;
lastActivatedId
=
p_item
->
p_input
->
i_id
;
playlist_Unlock
(
THEPL
);
model
->
activateItem
(
index
);
}
}
}
...
...
modules/gui/qt4/components/playlist/standardpanel.hpp
View file @
64119e13
...
...
@@ -37,6 +37,7 @@
class
QSignalMapper
;
class
PLModel
;
class
MLModel
;
class
QKeyEvent
;
class
QWheelEvent
;
class
QStackedLayout
;
...
...
@@ -58,7 +59,7 @@ class StandardPLPanel: public QWidget
public:
StandardPLPanel
(
PlaylistWidget
*
,
intf_thread_t
*
,
playlist_item_t
*
,
PLSelector
*
,
PLModel
*
);
playlist_item_t
*
,
PLSelector
*
,
PLModel
*
,
MLModel
*
);
virtual
~
StandardPLPanel
();
enum
{
ICON_VIEW
=
0
,
...
...
@@ -72,6 +73,7 @@ public:
protected:
PLModel
*
model
;
MLModel
*
mlmodel
;
virtual
void
wheelEvent
(
QWheelEvent
*
e
);
private:
intf_thread_t
*
p_intf
;
...
...
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