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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
import QtQuick 2.4
import Lomiri.Components 1.3
import "../components"
// C++ Plugin
import OwncloudSync 1.0
FileBrowser{
id:fileBrowser
caller: caller
folderModel: folderListModel
rootPath: "/"
property string paramUsername: ""
property string paramPassword: ""
property string paramServerUrl: ""
WebdavFolderListModel{
id: folderListModel
showDirs: true
showFiles: false
showHidden: true
username: fileBrowser.paramUsername
password: fileBrowser.paramPassword
serverUrl: fileBrowser.paramServerUrl
folder: caller.text ? caller.text : fileBrowser.rootPath
onFolderChanged: {
connectionStatus.spinner = true
connectionStatus.status = i18n.tr("Loading")
connectionStatus.indicationIcon = "updating"
connectionStatus.autoHide = true
}
onCountChanged: {
connectionStatus.hide()
fileBrowser.showNoChildFolders = true
}
onErrorOccured: {
connectionStatus.spinner = false
connectionStatus.status = i18n.tr("Check your connection or try again!") + "<br>(" + folderListModel.errorMsg + ")"
connectionStatus.indicationIcon = "error"
connectionStatus.autoHide = false
fileBrowser.header.trailingActionBar.actions = []
fileBrowser.header.leadingActionBar.actions = []
// Indicate error
fileBrowser.errorOccured = true
}
function newFolder(folderPath){
console.log(folderPath)
folderListModel.newWebDavFolder(folderPath)
}
}
PopupStatusBox{
id: connectionStatus
autoHide: false
anchors{left: parent.left; right:parent.right; bottom: parent.bottom;}
}
}
|