From 2a78fc7b384f5c7b3d837bee0318df23819cf43d Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Tue, 24 Sep 2019 14:29:09 -0700 Subject: [PATCH] Remove the auto refresh list of resource because it takes too much time, instead user has to press refresh button --- .../cache/cash/ResourceCacheInspector.qml | 58 +++++++++++-------- .../utilities/lib/prop/style/PiButton.qml | 3 + 2 files changed, 38 insertions(+), 23 deletions(-) diff --git a/scripts/developer/utilities/cache/cash/ResourceCacheInspector.qml b/scripts/developer/utilities/cache/cash/ResourceCacheInspector.qml index 9b1ab907f9..fdf3137caf 100644 --- a/scripts/developer/utilities/cache/cash/ResourceCacheInspector.qml +++ b/scripts/developer/utilities/cache/cash/ResourceCacheInspector.qml @@ -58,10 +58,11 @@ Item { needFreshList = true } - Timer { + + /* Timer { interval: 2000; running: true; repeat: true onTriggered: pullFreshValues() - } + }*/ function pullFreshValues() { if (needFreshList) { @@ -138,34 +139,46 @@ Item { anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right - margin: global.horizontalMargin - + Item { anchors.left: parent.left anchors.right: parent.right height: totalCount.height - Prop.PropScalar { - id: totalCount + Prop.PropButton { + id: refreshButton anchors.left: parent.left - anchors.right: parent.horizontalCenter - label: "Count" - object: root.cache - property: "numTotal" - integral: true - readOnly: true - onSourceValueVarChanged: { updateItemListFromCache() } + anchors.verticalCenter: parent.verticalCenter + text: "Refresh" + color: needFreshList ? global.colorOrangeAccent : global.fontColor + onPressed: { pullFreshValues() } } - Prop.PropScalar { - id: cachedCount - anchors.left: parent.horizontalCenter + + Item { + anchors.left: refreshButton.right anchors.right: parent.right - label: "Cached" - object: root.cache - property: "numCached" - integral: true - readOnly: true - onSourceValueVarChanged: { updateItemListFromCache() } + Prop.PropScalar { + id: totalCount + anchors.left: parent.left + anchors.right: parent.horizontalCenter + label: "Count" + object: root.cache + property: "numTotal" + integral: true + readOnly: true + onSourceValueVarChanged: { updateItemListFromCache() } + } + Prop.PropScalar { + id: cachedCount + anchors.left: parent.horizontalCenter + anchors.right: parent.right + label: "Cached" + object: root.cache + property: "numCached" + integral: true + readOnly: true + onSourceValueVarChanged: { updateItemListFromCache() } + } } } Item { @@ -210,7 +223,6 @@ Item { opacity: (nameFilter.text.length > 0) ? 1.0 : 0.5 } } - Prop.Prop } Component { diff --git a/scripts/developer/utilities/lib/prop/style/PiButton.qml b/scripts/developer/utilities/lib/prop/style/PiButton.qml index 654d47e76d..5469431d81 100644 --- a/scripts/developer/utilities/lib/prop/style/PiButton.qml +++ b/scripts/developer/utilities/lib/prop/style/PiButton.qml @@ -16,10 +16,13 @@ Button { id: control text: "" spacing: 0 + property alias color: theContentItem.color contentItem: PiText { + id: theContentItem text: control.text horizontalAlignment: Text.AlignHCenter + color: global.fontColor } background: Rectangle {