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
b68fb123
Commit
b68fb123
authored
Jun 14, 2010
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qt4: allow dnd to file-input on convert-dialog
parent
2fddd625
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
0 deletions
+47
-0
modules/gui/qt4/components/open_panels.cpp
modules/gui/qt4/components/open_panels.cpp
+42
-0
modules/gui/qt4/components/open_panels.hpp
modules/gui/qt4/components/open_panels.hpp
+5
-0
No files found.
modules/gui/qt4/components/open_panels.cpp
View file @
b68fb123
...
...
@@ -47,6 +47,7 @@
#include <QScrollArea>
#include <QUrl>
#include <QStringListModel>
#include <QDropEvent>
#define I_DEVICE_TOOLTIP \
...
...
@@ -65,6 +66,8 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
/* Classic UI Setup */
ui
.
setupUi
(
this
);
setAcceptDrops
(
true
);
/* Set Filters for file selection */
/* QString fileTypes = "";
ADD_FILTER_MEDIA( fileTypes );
...
...
@@ -166,6 +169,45 @@ FileOpenPanel::~FileOpenPanel()
getSettings
()
->
setValue
(
"file-dialog-state"
,
dialogBox
->
saveState
()
);
}
void
FileOpenPanel
::
dragEnterEvent
(
QDragEnterEvent
*
event
)
{
event
->
acceptProposedAction
();
}
void
FileOpenPanel
::
dragMoveEvent
(
QDragMoveEvent
*
event
)
{
event
->
acceptProposedAction
();
}
void
FileOpenPanel
::
dragLeaveEvent
(
QDragLeaveEvent
*
event
)
{
event
->
accept
();
}
void
FileOpenPanel
::
dropEvent
(
QDropEvent
*
event
)
{
if
(
event
->
possibleActions
()
&
Qt
::
CopyAction
)
event
->
setDropAction
(
Qt
::
CopyAction
);
else
return
;
const
QMimeData
*
mimeData
=
event
->
mimeData
();
foreach
(
const
QUrl
&
url
,
mimeData
->
urls
()
)
{
if
(
url
.
isValid
()
)
{
QListWidgetItem
*
item
=
new
QListWidgetItem
(
toNativeSeparators
(
url
.
toLocalFile
()
),
ui
.
fileListWidg
);
item
->
setFlags
(
Qt
::
ItemIsEditable
|
Qt
::
ItemIsEnabled
);
ui
.
fileListWidg
->
addItem
(
item
);
}
}
updateMRL
();
updateButtons
();
event
->
accept
();
}
void
FileOpenPanel
::
browseFile
()
{
QStringList
files
=
QFileDialog
::
getOpenFileNames
(
this
,
qtr
(
"Select one or multiple files"
),
p_intf
->
p_sys
->
filepath
)
;
...
...
modules/gui/qt4/components/open_panels.hpp
View file @
b68fb123
...
...
@@ -62,6 +62,7 @@ class QWidget;
class
QLineEdit
;
class
QString
;
class
QStringListModel
;
class
QEvent
;
class
OpenPanel
:
public
QWidget
{
...
...
@@ -114,6 +115,10 @@ protected:
}
return
false
;
}
virtual
void
dropEvent
(
QDropEvent
*
);
virtual
void
dragEnterEvent
(
QDragEnterEvent
*
);
virtual
void
dragMoveEvent
(
QDragMoveEvent
*
);
virtual
void
dragLeaveEvent
(
QDragLeaveEvent
*
);
private:
Ui
::
OpenFile
ui
;
FileOpenBox
*
dialogBox
;
...
...
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