diff options
| author | Tomasz Sterna <tomek@xiaoka.com> | 2015-01-11 21:26:02 +0100 |
|---|---|---|
| committer | Tomasz Sterna <tomek@xiaoka.com> | 2015-01-11 21:26:02 +0100 |
| commit | f0e644896d34c4c354a978788cbb461db653484b (patch) | |
| tree | 31086457b3a8f7c30e94e20a287914dcdb3d3c95 /app/qml/pages/InstallAppDialog.qml | |
| parent | 341c38a31f4bde9a2f016b4d58a11b8beb2bae5a (diff) | |
Implemented "Add App file" dialog
Diffstat (limited to 'app/qml/pages/InstallAppDialog.qml')
| -rw-r--r-- | app/qml/pages/InstallAppDialog.qml | 70 |
1 files changed, 69 insertions, 1 deletions
diff --git a/app/qml/pages/InstallAppDialog.qml b/app/qml/pages/InstallAppDialog.qml index debb48f..ecc3d78 100644 --- a/app/qml/pages/InstallAppDialog.qml +++ b/app/qml/pages/InstallAppDialog.qml @@ -1,23 +1,91 @@ import QtQuick 2.0 import QtQml 2.1 import Sailfish.Silica 1.0 +import QtDocGallery 5.0 +import Sailfish.Pickers 1.0 Dialog { id: installAppPage property string selectedUuid; + Component { + id: appPicker + + PickerDialog { + id: appPickerDialog + title: qsTr("Select App files") + + SilicaListView { + id: listView + + currentIndex: -1 + anchors.fill: parent + + model: documentModel.model + + DocumentModel { + id: documentModel + selectedModel: _selectedModel + contentFilter: GalleryStartsWithFilter { + property: "filePath" + value: StandardPaths.documents + "/../Downloads" + } + } + + header: PageHeader { + id: pageHeader + title: appPickerDialog.title + } + + + delegate: DocumentItem { + id: documentItem + baseName: Theme.highlightText(documentModel.baseName(model.fileName), documentModel.filter, Theme.highlightColor) + extension: Theme.highlightText(documentModel.extension(model.fileName), documentModel.filter, Theme.highlightColor) + selected: model.selected + + ListView.onAdd: AddAnimation { target: documentItem; duration: _animationDuration } + ListView.onRemove: RemoveAnimation { target: documentItem; duration: _animationDuration } + onClicked: documentModel.updateSelected(index, !selected) + } + + VerticalScrollDecorator {} + } + } + + } + SilicaListView { id: appList anchors.fill: parent header: DialogHeader { - title: qsTr("Install app") + title: qsTr("Install App") defaultAcceptText: qsTr("Install") } VerticalScrollDecorator { flickable: flickable } + PullDownMenu { + MenuItem { + text: qsTr("Add App file...") + onClicked: { + var addApps = function() { + for(var i=0; i < picker.selectedContent.count; ++i) { + var appPath = picker.selectedContent.get(i).filePath + console.log(appPath) + pebbled.registerAppFile(appPath) + } + picker.selectedContentChanged.disconnect(addApps) + } + var picker = pageStack.push(appPicker) + picker.selectedContentChanged.connect(addApps) + } + + } + } + currentIndex: -1 delegate: ListItem { |
