-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMediaSelector.qml
More file actions
35 lines (31 loc) · 845 Bytes
/
MediaSelector.qml
File metadata and controls
35 lines (31 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.12
Item {
id: igs
signal fileSelected(string src);
signal filesSelected(var src);
function startSelector() {
filesDialog.open();
}
FileDialog {
id: filesDialog
folder: shortcuts.pictures
nameFilters: [ "*.mp4", "*.mov", "*.mp3", "*.avi" ]
title: qsTr("Select media file(s)")
selectExisting: true
selectFolder: false
selectMultiple: true
onAccepted: {
// XXX: Need to convert to string, otherwise sucka
if (fileUrl!="") {
var f=""+fileUrl
fileSelected(f);
} else {
console.debug(fileUrls)
filesSelected(fileUrls)
}
}
}
}