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
5a38d2b2
Commit
5a38d2b2
authored
Aug 18, 2009
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: implement PLModel::popupAddNode()
parent
c54fe5a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.cpp
+33
-2
modules/gui/qt4/components/playlist/playlist_model.hpp
modules/gui/qt4/components/playlist/playlist_model.hpp
+1
-0
No files found.
modules/gui/qt4/components/playlist/playlist_model.cpp
View file @
5a38d2b2
...
...
@@ -948,7 +948,20 @@ void PLModel::popup( QModelIndex & index, QPoint &point, QModelIndexList list )
{
i_popup_item
=
p_item
->
i_id
;
i_popup_parent
=
p_item
->
p_parent
?
p_item
->
p_parent
->
i_id
:
-
1
;
bool
node
=
p_item
->
i_children
>
-
1
;
bool
tree
=
false
;
if
(
node
)
{
/* check whether we are in tree view */
playlist_item_t
*
p_up
=
p_item
;
while
(
p_up
)
{
if
(
p_up
==
p_playlist
->
p_root_category
)
tree
=
true
;
p_up
=
p_up
->
p_parent
;
}
}
PL_UNLOCK
;
current_selection
=
list
;
QMenu
*
menu
=
new
QMenu
;
menu
->
addAction
(
qtr
(
I_POP_PLAY
),
this
,
SLOT
(
popupPlay
()
)
);
...
...
@@ -958,11 +971,12 @@ void PLModel::popup( QModelIndex & index, QPoint &point, QModelIndexList list )
menu
->
addAction
(
qtr
(
I_POP_SAVE
),
this
,
SLOT
(
popupSave
()
)
);
menu
->
addSeparator
();
menu
->
addAction
(
qtr
(
I_POP_INFO
),
this
,
SLOT
(
popupInfo
()
)
);
if
(
p_item
->
i_children
>
-
1
)
if
(
node
)
{
menu
->
addSeparator
();
menu
->
addAction
(
qtr
(
I_POP_SORT
),
this
,
SLOT
(
popupSort
()
)
);
menu
->
addAction
(
qtr
(
I_POP_ADD
),
this
,
SLOT
(
popupAdd
()
)
);
if
(
tree
);
menu
->
addAction
(
qtr
(
I_POP_ADD
),
this
,
SLOT
(
popupAddNode
()
)
);
}
menu
->
addSeparator
();
menu
->
addAction
(
qtr
(
I_POP_EXPLORE
),
this
,
SLOT
(
popupExplore
()
)
);
...
...
@@ -1096,6 +1110,23 @@ void PLModel::popupExplore()
PL_UNLOCK
;
}
#include <QInputDialog>
void
PLModel
::
popupAddNode
()
{
bool
ok
;
QString
name
=
QInputDialog
::
getText
(
PlaylistDialog
::
getInstance
(
p_intf
),
QString
(
"Add node"
),
QString
(
"Enter name for new node"
),
QLineEdit
::
Normal
,
QString
(),
&
ok
);
if
(
!
ok
||
name
.
isEmpty
()
)
return
;
PL_LOCK
;
playlist_item_t
*
p_item
=
playlist_ItemGetById
(
p_playlist
,
i_popup_item
);
if
(
p_item
)
{
playlist_NodeCreate
(
p_playlist
,
qtu
(
name
),
p_item
,
0
,
NULL
);
}
PL_UNLOCK
;
}
/**********************************************************************
* Playlist callbacks
**********************************************************************/
...
...
modules/gui/qt4/components/playlist/playlist_model.hpp
View file @
5a38d2b2
...
...
@@ -186,6 +186,7 @@ private slots:
void
popupStream
();
void
popupSave
();
void
popupExplore
();
void
popupAddNode
();
void
viewchanged
(
int
);
void
ProcessInputItemUpdate
(
input_item_t
*
);
void
ProcessInputItemUpdate
(
input_thread_t
*
p_input
);
...
...
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