From f07882d76d1221c1a60e016429212abb07fd9db1 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Tue, 17 Feb 2015 21:49:00 +0100 Subject: Level navigation tree Load Level collection --- qml/pages/collections_list.qml | 64 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 qml/pages/collections_list.qml (limited to 'qml/pages/collections_list.qml') diff --git a/qml/pages/collections_list.qml b/qml/pages/collections_list.qml new file mode 100644 index 0000000..6701869 --- /dev/null +++ b/qml/pages/collections_list.qml @@ -0,0 +1,64 @@ +import QtQuick 2.0 +import Sailfish.Silica 1.0 + +import io.thp.pyotherside 1.3 + +Page { + width: Screen.width; height: Screen.height; + + signal openCollection(string path); + + Column { + Text { + id: txt; + text: qsTr("Select the collection to open"); + + } + + SilicaListView { + + width: parent.width; height: Screen.height; + + model: ListModel {id: levelsList} + + delegate: ListItem { + Label { + text: name + } + onClicked: { + openCollection(path); + pageStack.pop() + } + + } + } + + } + + + Python { + id:py + Component.onCompleted: { + var pythonpath = Qt.resolvedUrl('../python').substr('file://'.length); + addImportPath(pythonpath); + console.log(pythonpath); + + importModule('configuration', function() { + console.log('module loaded'); + console.log('Python version: ' + pythonVersion()); + }); + + setHandler('log', function (content) { + console.log(content); + }); + + call('configuration.get_levels', [pythonpath, StandardPaths.documents], function(result) { + result.forEach(function(elem) { + console.log(elem); + levelsList.append(elem); + }) + }); + } + } + +} -- cgit v1.2.3