Commit 151658d7 authored by camilo higuita's avatar camilo higuita

only load some dialogs when needed

parent d3814702
......@@ -47,6 +47,7 @@ Maui.ApplicationWindow
property alias mainPlaylist: mainPlaylist
property alias selectionBar: _selectionBar
property alias progressBar: progressBar
property alias dialog : _dialogLoader.item
Maui.App.iconName: "qrc:/assets/vvave.svg"
Maui.App.description: qsTr("VVAVE will handle your whole music collection by retreaving semantic information from the web. Just relax, enjoy and discover your new music ")
......@@ -345,6 +346,11 @@ visible: !mainlistEmpty
searchView.searchInput.forceActiveFocus()
}
Loader
{
id: _dialogLoader
}
InfoView
{
id: infoView
......@@ -352,14 +358,17 @@ visible: !mainlistEmpty
maxHeight: parent.height * 0.9
}
Maui.ShareDialog
Component
{
id: shareDialog
id: _shareDialogComponent
Maui.ShareDialog {}
}
Maui.FileDialog
Component
{
id: fmDialog
id: _fmDialogComponent
Maui.FileDialog { }
}
SourcesDialog
......@@ -433,9 +442,10 @@ visible: !mainlistEmpty
icon.name: "folder-add"
onTriggered:
{
fmDialog.settings.onlyDirs = false
fmDialog.settings.filterType = Maui.FMList.AUDIO
fmDialog.show(function(paths)
_dialogLoader.sourceComponent = _fmDialogComponent
root.dialog.settings.onlyDirs = false
root.dialog.settings.filterType = Maui.FMList.AUDIO
root.dialog.show(function(paths)
{
vvave.openUrls(paths)
})
......
......@@ -217,7 +217,6 @@ BabeList
onTriggered: goToAlbum()
}
onFavClicked:
{
list.fav(listView.currentIndex, !(list.get(listView.currentIndex).fav == "1"))
......@@ -262,8 +261,15 @@ BabeList
onShareClicked:
{
const url = list.get(listView.currentIndex).url
isAndroid ? Maui.Android.shareDialog("file://" + url) :
shareDialog.show([url])
if(isAndroid)
{
Maui.Android.shareDialog(url)
return
}
_dialogLoader.sourceComponent = _shareDialogComponent
root.dialog.show([url])
}
}
......
......@@ -90,16 +90,16 @@ Menu
}
MenuItem
{
visible: Maui.App.handleAccounts
text: qsTr("Copy to cloud")
onTriggered:
{
copyToClicked()
close()
}
}
// MenuItem
// {
// visible: Maui.App.handleAccounts
// text: qsTr("Copy to cloud")
// onTriggered:
// {
// copyToClicked()
// close()
// }
// }
MenuItem
{
......
......@@ -88,8 +88,14 @@ Menu
text: qsTr("Share...")
onTriggered:
{
isAndroid ? Maui.Android.shareDialog(_selectionBar.selectedPaths) :
shareDialog.show(_selectionBar.selectedPaths)
if(isAndroid)
{
Maui.Android.shareDialog(_selectionBar.selectedPaths)
return
}
_dialogLoader.sourceComponent = _shareDialogComponent
root.dialog.show(_selectionBar.selectedPaths)
close()
}
}
......
......@@ -28,8 +28,9 @@ Maui.Dialog
onAccepted:
{
fmDialog.settings.onlyDirs = true
fmDialog.show(function(paths)
_dialogLoader.sourceComponent = _fmDialogComponent
root.dialog.settings.onlyDirs = true
root.dialog.show(function(paths)
{
console.log("SCAN DIR <<", paths)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment