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
0c323ab0
Commit
0c323ab0
authored
Feb 14, 2010
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: include Add File/Directory/Advanced Open actions in playlist right-click menu
parent
cc4cabdf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
20 deletions
+37
-20
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.cpp
+32
-11
modules/gui/qt4/components/playlist/playlist_model.hpp
modules/gui/qt4/components/playlist/playlist_model.hpp
+1
-1
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
+4
-8
No files found.
modules/gui/qt4/components/playlist/playlist_model.cpp
View file @
0c323ab0
...
...
@@ -869,7 +869,7 @@ void PLModel::search( const QString& search_text, const QModelIndex & idx, bool
}
/*********** Popup *********/
void
PLModel
::
popup
(
const
QModelIndex
&
index
,
const
QPoint
&
point
,
const
QModelIndexList
&
list
)
bool
PLModel
::
popup
(
const
QModelIndex
&
index
,
const
QPoint
&
point
,
const
QModelIndexList
&
list
)
{
int
i_id
=
index
.
isValid
()
?
itemId
(
index
)
:
rootItem
->
i_id
;
...
...
@@ -877,12 +877,14 @@ void PLModel::popup( const QModelIndex & index, const QPoint &point, const QMode
playlist_item_t
*
p_item
=
playlist_ItemGetById
(
p_playlist
,
i_id
);
if
(
!
p_item
)
{
PL_UNLOCK
;
return
;
PL_UNLOCK
;
return
false
;
}
i_popup_item
=
index
.
isValid
()
?
p_item
->
i_id
:
-
1
;
i_popup_parent
=
index
.
isValid
()
?
(
p_item
->
p_parent
?
p_item
->
p_parent
->
i_id
:
-
1
)
:
(
p_i
tem
->
i_id
);
(
rootI
tem
->
i_id
);
i_popup_column
=
index
.
column
();
bool
tree
=
var_InheritBool
(
p_intf
,
"playlist-tree"
);
...
...
@@ -901,22 +903,41 @@ void PLModel::popup( const QModelIndex & index, const QPoint &point, const QMode
menu
.
addAction
(
qtr
(
I_POP_SAVE
),
this
,
SLOT
(
popupSave
()
)
);
menu
.
addSeparator
();
menu
.
addAction
(
qtr
(
I_POP_INFO
),
this
,
SLOT
(
popupInfo
()
)
);
menu
.
addAction
(
qtr
(
I_POP_EXPLORE
),
this
,
SLOT
(
popupExplore
()
)
);
}
if
(
canEdit
()
)
{
menu
.
addSeparator
();
QMenu
*
sort_menu
=
menu
.
addMenu
(
qtr
(
"Sort by "
)
+
if
(
tree
)
menu
.
addAction
(
qtr
(
I_POP_ADD
)
+
QString
(
"..."
),
this
,
SLOT
(
popupAddNode
()
)
);
if
(
rootItem
->
i_id
==
THEPL
->
p_playing
->
i_id
)
{
menu
.
addAction
(
qtr
(
I_PL_ADDF
),
THEDP
,
SLOT
(
simplePLAppendDialog
())
);
menu
.
addAction
(
qtr
(
I_PL_ADDDIR
),
THEDP
,
SLOT
(
PLAppendDir
())
);
menu
.
addAction
(
qtr
(
I_OP_ADVOP
),
THEDP
,
SLOT
(
PLAppendDialog
())
);
}
else
if
(
THEPL
->
p_media_library
&&
rootItem
->
i_id
==
THEPL
->
p_media_library
->
i_id
)
{
menu
.
addAction
(
qtr
(
I_PL_ADDF
),
THEDP
,
SLOT
(
simpleMLAppendDialog
())
);
menu
.
addAction
(
qtr
(
I_PL_ADDDIR
),
THEDP
,
SLOT
(
MLAppendDir
()
)
);
menu
.
addAction
(
qtr
(
I_OP_ADVOP
),
THEDP
,
SLOT
(
MLAppendDialog
()
)
);
}
}
if
(
i_popup_item
>
-
1
)
{
menu
.
addSeparator
();
QMenu
*
sort_menu
=
menu
.
addMenu
(
qtr
(
"Sort by"
)
+
QString
(
" "
)
+
qfu
(
psz_column_title
(
columnToMeta
(
index
.
column
()
)
)
)
);
sort_menu
->
addAction
(
qtr
(
"Ascending"
),
this
,
SLOT
(
popupSortAsc
()
)
);
sort_menu
->
addAction
(
qtr
(
"Descending"
),
this
,
SLOT
(
popupSortDesc
()
)
);
}
if
(
tree
&&
canEdit
()
)
menu
.
addAction
(
qtr
(
I_POP_ADD
),
this
,
SLOT
(
popupAddNode
()
)
);
if
(
i_popup_item
>
-
1
)
if
(
!
menu
.
isEmpty
()
)
{
menu
.
addSeparator
();
menu
.
addAction
(
qtr
(
I_POP_EXPLORE
),
this
,
SLOT
(
popupExplore
()
)
);
menu
.
exec
(
point
);
return
true
;
}
if
(
!
menu
.
isEmpty
()
)
menu
.
exec
(
point
)
;
else
return
false
;
}
void
PLModel
::
popupDel
()
...
...
@@ -1009,7 +1030,7 @@ void PLModel::popupAddNode()
{
bool
ok
;
QString
name
=
QInputDialog
::
getText
(
PlaylistDialog
::
getInstance
(
p_intf
),
qtr
(
I_POP_ADD
),
qtr
(
"Enter name for new
node
:"
),
qtr
(
I_POP_ADD
),
qtr
(
"Enter name for new
folder
:"
),
QLineEdit
::
Normal
,
QString
(),
&
ok
);
if
(
!
ok
||
name
.
isEmpty
()
)
return
;
PL_LOCK
;
...
...
modules/gui/qt4/components/playlist/playlist_model.hpp
View file @
0c323ab0
...
...
@@ -94,7 +94,7 @@ public:
static
int
columnToMeta
(
int
column
);
/* Actions */
void
popup
(
const
QModelIndex
&
index
,
const
QPoint
&
point
,
const
QModelIndexList
&
list
);
bool
popup
(
const
QModelIndex
&
index
,
const
QPoint
&
point
,
const
QModelIndexList
&
list
);
void
doDelete
(
QModelIndexList
selected
);
void
search
(
const
QString
&
search_text
,
const
QModelIndex
&
root
,
bool
b_recursive
);
void
sort
(
int
column
,
Qt
::
SortOrder
order
);
...
...
modules/gui/qt4/components/playlist/standardpanel.cpp
View file @
0c323ab0
...
...
@@ -216,15 +216,11 @@ void StandardPLPanel::popupPlView( const QPoint &point )
{
QModelIndex
index
=
currentView
->
indexAt
(
point
);
QPoint
globalPoint
=
currentView
->
viewport
()
->
mapToGlobal
(
point
);
if
(
!
index
.
isValid
()
){
QItemSelectionModel
*
selection
=
currentView
->
selectionModel
();
QModelIndexList
list
=
selection
->
selectedIndexes
();
if
(
!
model
->
popup
(
index
,
globalPoint
,
list
)
)
QVLCMenu
::
PopupMenu
(
p_intf
,
true
);
}
else
{
QItemSelectionModel
*
selection
=
currentView
->
selectionModel
();
QModelIndexList
list
=
selection
->
selectedIndexes
();
model
->
popup
(
index
,
globalPoint
,
list
);
}
}
void
StandardPLPanel
::
popupSelectColumn
(
QPoint
pos
)
...
...
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