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
55678c1c
Commit
55678c1c
authored
Feb 10, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: addons: add support for vlp package drop
parent
d88a39ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
1 deletion
+43
-1
modules/gui/qt4/dialogs/plugins.cpp
modules/gui/qt4/dialogs/plugins.cpp
+43
-1
No files found.
modules/gui/qt4/dialogs/plugins.cpp
View file @
55678c1c
...
...
@@ -60,6 +60,7 @@
#include <QGraphicsColorizeEffect>
#include <QProgressBar>
#include <QTextEdit>
#include <QUrl>
static
QPixmap
*
loadPixmapFromData
(
char
*
,
int
size
);
...
...
@@ -298,7 +299,6 @@ void ExtensionTab::moreInformation()
dlg
.
exec
();
}
/* Add-ons tab */
AddonsTab
::
AddonsTab
(
intf_thread_t
*
p_intf_
)
:
QVLCFrame
(
p_intf_
)
{
...
...
@@ -348,6 +348,12 @@ AddonsTab::AddonsTab( intf_thread_t *p_intf_ ) : QVLCFrame( p_intf_ )
addonsView
->
setAlternatingRowColors
(
true
);
addonsView
->
setSelectionMode
(
QAbstractItemView
::
SingleSelection
);
// Drop packages
addonsView
->
setAcceptDrops
(
true
);
addonsView
->
setDefaultDropAction
(
Qt
::
CopyAction
);
addonsView
->
setDropIndicatorShown
(
true
);
addonsView
->
setDragDropMode
(
QAbstractItemView
::
DropOnly
);
// Model
AddonsListModel
*
model
=
new
AddonsListModel
(
AM
,
addonsView
);
addonsModel
=
new
AddonsSortFilterProxyModel
();
...
...
@@ -382,6 +388,9 @@ AddonsTab::~AddonsTab()
bool
AddonsTab
::
eventFilter
(
QObject
*
obj
,
QEvent
*
event
)
{
if
(
obj
!=
addonsView
->
viewport
()
)
return
false
;
switch
(
event
->
type
()
)
{
case
QEvent
:
:
Paint
:
...
...
@@ -420,6 +429,39 @@ bool AddonsTab::eventFilter( QObject *obj, QEvent *event )
AM
->
findNewAddons
();
}
break
;
case
QEvent
:
:
DragEnter
:
{
QDragEnterEvent
*
dragEvent
=
dynamic_cast
<
QDragEnterEvent
*>
(
event
);
QList
<
QUrl
>
urls
=
dragEvent
->
mimeData
()
->
urls
();
if
(
dragEvent
->
proposedAction
()
!=
Qt
::
CopyAction
||
urls
.
count
()
!=
1
||
urls
.
first
().
scheme
()
!=
"file"
||
!
urls
.
first
().
path
().
endsWith
(
".vlp"
)
)
return
false
;
dragEvent
->
acceptProposedAction
();
return
true
;
}
case
QEvent
:
:
DragMove
:
{
QDragMoveEvent
*
moveEvent
=
dynamic_cast
<
QDragMoveEvent
*>
(
event
);
if
(
moveEvent
->
proposedAction
()
!=
Qt
::
CopyAction
)
return
false
;
moveEvent
->
acceptProposedAction
();
return
true
;
}
case
QEvent
:
:
Drop
:
{
QDropEvent
*
dropEvent
=
dynamic_cast
<
QDropEvent
*>
(
event
);
if
(
dropEvent
->
proposedAction
()
!=
Qt
::
CopyAction
)
return
false
;
if
(
dropEvent
->
mimeData
()
->
urls
().
count
()
)
{
AddonsManager
*
AM
=
AddonsManager
::
getInstance
(
p_intf
);
AM
->
findDesignatedAddon
(
dropEvent
->
mimeData
()
->
urls
().
first
().
toString
()
);
dropEvent
->
acceptProposedAction
();
}
return
true
;
}
default:
break
;
}
...
...
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