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
a99d1a2c
Commit
a99d1a2c
authored
Feb 10, 2010
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: update playlist dialog on rootChanged signal from model
parent
79081134
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
31 deletions
+28
-31
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.cpp
+2
-1
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+25
-30
modules/gui/qt4/components/playlist/standardpanel.hpp
modules/gui/qt4/components/playlist/standardpanel.hpp
+1
-0
No files found.
modules/gui/qt4/components/playlist/playlist_model.cpp
View file @
a99d1a2c
...
...
@@ -665,6 +665,8 @@ void PLModel::rebuild( playlist_item_t *p_root, bool b_first )
/* And signal the view */
reset
();
if
(
p_root
)
emit
rootChanged
();
}
void
PLModel
::
takeItem
(
PLItem
*
item
)
...
...
@@ -713,7 +715,6 @@ void PLModel::removeItem( PLItem *item )
{
rootItem
=
NULL
;
rebuild
(
p_playlist
->
p_playing
);
emit
rootChanged
();
}
}
...
...
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
a99d1a2c
...
...
@@ -138,6 +138,7 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
CONNECT
(
model
,
currentChanged
(
const
QModelIndex
&
),
this
,
handleExpansion
(
const
QModelIndex
&
)
);
CONNECT
(
model
,
rootChanged
(),
this
,
handleRootChange
()
);
}
StandardPLPanel
::~
StandardPLPanel
()
...
...
@@ -161,6 +162,30 @@ void StandardPLPanel::handleExpansion( const QModelIndex& index )
currentView
->
scrollTo
(
index
);
}
void
StandardPLPanel
::
handleRootChange
()
{
/* needed for popupAdd() */
PLItem
*
root
=
model
->
getItem
(
QModelIndex
()
);
currentRootId
=
root
->
id
();
locationBar
->
setIndex
(
QModelIndex
()
);
/* enable/disable adding */
if
(
currentRootId
==
THEPL
->
p_playing
->
i_id
)
{
addButton
->
setEnabled
(
true
);
addButton
->
setToolTip
(
qtr
(
I_PL_ADDPL
)
);
}
else
if
(
THEPL
->
p_media_library
&&
currentRootId
==
THEPL
->
p_media_library
->
i_id
)
{
addButton
->
setEnabled
(
true
);
addButton
->
setToolTip
(
qtr
(
I_PL_ADDML
)
);
}
else
addButton
->
setEnabled
(
false
);
}
/* PopupAdd Menu for the Add Menu */
void
StandardPLPanel
::
popupAdd
()
{
...
...
@@ -233,37 +258,7 @@ void StandardPLPanel::search( const QString& searchText )
/* This activated by the selector selection */
void
StandardPLPanel
::
setRoot
(
playlist_item_t
*
p_item
)
{
QPL_LOCK
;
assert
(
p_item
);
/* needed for popupAdd() */
currentRootId
=
p_item
->
i_id
;
/* cosmetics, ..still need playlist locking.. */
/*char *psz_title = input_item_GetName( p_item->p_input );
title->setText( qfu(psz_title) );
free( psz_title );*/
QPL_UNLOCK
;
/* do THE job */
model
->
rebuild
(
p_item
);
locationBar
->
setIndex
(
QModelIndex
()
);
/* enable/disable adding */
if
(
p_item
==
THEPL
->
p_playing
)
{
addButton
->
setEnabled
(
true
);
addButton
->
setToolTip
(
qtr
(
I_PL_ADDPL
)
);
}
else
if
(
THEPL
->
p_media_library
&&
p_item
==
THEPL
->
p_media_library
)
{
addButton
->
setEnabled
(
true
);
addButton
->
setToolTip
(
qtr
(
I_PL_ADDML
)
);
}
else
addButton
->
setEnabled
(
false
);
}
void
StandardPLPanel
::
removeItem
(
int
i_id
)
...
...
modules/gui/qt4/components/playlist/standardpanel.hpp
View file @
a99d1a2c
...
...
@@ -98,6 +98,7 @@ public slots:
private
slots
:
void
deleteSelection
();
void
handleExpansion
(
const
QModelIndex
&
);
void
handleRootChange
();
void
gotoPlayingItem
();
void
search
(
const
QString
&
searchText
);
void
popupAdd
();
...
...
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