From 5888922df1926ed3c5e08553d9c9440434b912a8 Mon Sep 17 00:00:00 2001 From: molan-git <59296158+molan-git@users.noreply.github.com> Date: Fri, 24 Jan 2020 22:09:36 +0100 Subject: [PATCH] Delete MyList.qml --- qml/pages/components/MyList.qml | 188 -------------------------------- 1 file changed, 188 deletions(-) delete mode 100644 qml/pages/components/MyList.qml diff --git a/qml/pages/components/MyList.qml b/qml/pages/components/MyList.qml deleted file mode 100644 index b2f0626..0000000 --- a/qml/pages/components/MyList.qml +++ /dev/null @@ -1,188 +0,0 @@ -import QtQuick 2.2 -import Sailfish.Silica 1.0 -import "../../lib/API.js" as Logic -import "." - -SilicaListView { - id: myList - property string type; - property string title - property string vwPlaceholderText: qsTr("Loading") - property string vwPlaceholderHint: qsTr("please wait...") - property string description - property ListModel mdl: [] - property variant params: [] - property var locale: Qt.locale() - property bool autoLoadMore : true; - property bool loadStarted : false; - property int scrollOffset; - property string action: "" - property variant vars - property variant conf - property bool notifier : false; - model: mdl - signal notify (string what, int num) - onNotify: { - console.log(what + " - " + num) - } - - - - signal openDrawer (bool setDrawer) - onOpenDrawer: { - //console.log("Open drawer: " + setDrawer) - } - signal send (string notice) - onSend: { - console.log("LIST send signal emitted with notice: " + notice) - } - - - BusyIndicator { - size: BusyIndicatorSize.Large - running: myList.model.count === 0 && !viewPlaceHolder.visible - anchors.centerIn: parent - } - - header: PageHeader { - title: myList.title - description: myList.description - } - - - - ViewPlaceholder { - id: viewPlaceHolder - enabled: model.count === 0 - text: vwPlaceholderText - hintText: vwPlaceholderHint - } - - PullDownMenu { - MenuItem { - text: qsTr("Settings") - onClicked: { - pageStack.push(Qt.resolvedUrl("../Settings.qml"), {}) - } - } - - MenuItem { - text: qsTr("Load more") - onClicked: { - loadData("prepend") - } - } - } - clip: true - section { - property: 'section' - delegate: SectionHeader { - height: Theme.itemSizeExtraSmall - text: Format.formatDate(section, Formatter.DateMedium) - } - } - - delegate: VisualContainer { - } //Toot {} - - add: Transition { - NumberAnimation { property: "opacity"; from: 0; to: 1.0; duration: 800 } - NumberAnimation { property: "x"; duration: 800; easing.type: Easing.InOutBack } - } - - remove: Transition { - NumberAnimation { properties: "x,y"; duration: 800; easing.type: Easing.InOutBack } - } - - onCountChanged: { - loadStarted = false; - /*contentY = scrollOffset - console.log("CountChanged!")*/ - - } - - footer: Item{ - visible: autoLoadMore - width: parent.width - height: Theme.itemSizeLarge - Button { - anchors.horizontalCenter: parent.horizontalCenter - anchors.margins: Theme.paddingSmall - anchors.bottomMargin: Theme.paddingLarge - visible: false - onClicked: { - loadData("append") - } - } - BusyIndicator { - size: BusyIndicatorSize.Small - running: loadStarted; - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - } - } - onContentYChanged: { - - if (Math.abs(contentY - scrollOffset) > Theme.itemSizeMedium) { - openDrawer(contentY - scrollOffset > 0 ? false : true ) - scrollOffset = contentY - } - - if(contentY+height > footerItem.y && !loadStarted && autoLoadMore){ - loadData("append") - loadStarted = true; - } - } - VerticalScrollDecorator {} - - WorkerScript { - id: worker - source: "../../lib/Worker.js" - onMessage: { - if (messageObject.error){ - console.log(JSON.stringify(messageObject)) - } - if (messageObject.fireNotification && notifier){ - Logic.notifier(messageObject.data) - } - - } - } - - Component.onCompleted: { - loadData("prepend") - } - - Timer { - triggeredOnStart: false; interval: 5*60*1000; running: true; repeat: true - onTriggered: { - console.log(title + ' ' +Date().toString()) - loadData("prepend") - } - } - function loadData(mode){ - var p = []; - if (params.length) - for(var i = 0; i