on xenial help sign in
Only default to not loading images if we're on limited bandwidth
29c44caAlbert Astals
debian/control+1
@@ -36,6 +36,7 @@ Build-Depends: cmake,
36 qml-module-qtquick-xmllistmodel,
36 qml-module-qtquick-xmllistmodel,
37 qml-module-qtquick2,
37 qml-module-qtquick2,
38 qml-module-qttest,
38 qml-module-qttest,
39+ qml-module-ubuntu-connectivity,
39 qt5-default,
40 qt5-default,
40 qtbase5-dev (>= 5.2.1),
41 qtbase5-dev (>= 5.2.1),
41 qtbase5-dev-tools,
42 qtbase5-dev-tools,
plugins/Dash/CardCreator.js+5−4
@@ -84,8 +84,8 @@ var kArtShapeHolderCode = 'Item { \n\
84 } \n\
84 } \n\
85 image: Image { \n\
85 image: Image { \n\
86 objectName: "artImage"; \n\
86 objectName: "artImage"; \n\
87− property bool everShown: false; \n\
87+ property bool doLoadSource: !NetworkingStatus.limitedBandwith; \n\
88− source: { if (root.visible) everShown = true; return everShown && cardData && cardData["art"] || ""; } \n\
88+ source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["art"] || ""; } \n\
89 cache: true; \n\
89 cache: true; \n\
90 asynchronous: root.asynchronous; \n\
90 asynchronous: root.asynchronous; \n\
91 fillMode: Image.PreserveAspectCrop; \n\
91 fillMode: Image.PreserveAspectCrop; \n\
@@ -196,8 +196,8 @@ var kMascotImageCode = 'Image { \n\
196 objectName: "mascotImage"; \n\
196 objectName: "mascotImage"; \n\
197 anchors { %1 } \n\
197 anchors { %1 } \n\
198 readonly property int maxSize: Math.max(width, height) * 4; \n\
198 readonly property int maxSize: Math.max(width, height) * 4; \n\
199− property bool everShown: false; \n\
199+ property bool doLoadSource: !NetworkingStatus.limitedBandwith; \n\
200− source: { if (root.visible) everShown = true; return everShown && cardData && cardData["mascot"] || ""; } \n\
200+ source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["mascot"] || ""; } \n\
201 width: units.gu(6); \n\
201 width: units.gu(6); \n\
202 height: units.gu(5.625); \n\
202 height: units.gu(5.625); \n\
203 sourceSize { width: maxSize; height: maxSize } \n\
203 sourceSize { width: maxSize; height: maxSize } \n\
@@ -654,6 +654,7 @@ function cardString(template, components) {
654function createCardComponent(parent, template, components) {
654function createCardComponent(parent, template, components) {
655 var imports = 'import QtQuick 2.2; \n\
655 var imports = 'import QtQuick 2.2; \n\
656 import Ubuntu.Components 1.1; \n\
656 import Ubuntu.Components 1.1; \n\
657+ import Ubuntu.Connectivity 1.0; \n\
657 import Dash 0.1;\n';
658 import Dash 0.1;\n';
658 var card = cardString(template, components);
659 var card = cardString(template, components);
659 var code = imports + 'Component {\n' + card + '}\n';
660 var code = imports + 'Component {\n' + card + '}\n';