on xenial help sign in
Only default to not loading images if we're on limited bandwidth
commit29c44caca0419e4742de26f1952f4cbe05672a17 authorAlbert Astals <albert.astals@canonical.com> dateWed 27 Aug 2014, 10:22 (12 years ago) parent95802a5
2 files changed+6−4
debian/control+1 plugins/Dash/CardCreator.js+5−4
debian/control+1
@@ -36,6 +36,7 @@ Build-Depends: cmake,
3636 qml-module-qtquick-xmllistmodel,
3737 qml-module-qtquick2,
3838 qml-module-qttest,
39+ qml-module-ubuntu-connectivity,
3940 qt5-default,
4041 qtbase5-dev (>= 5.2.1),
4142 qtbase5-dev-tools,
plugins/Dash/CardCreator.js+5−4
@@ -84,8 +84,8 @@ var kArtShapeHolderCode = 'Item { \n\
8484 } \n\
8585 image: Image { \n\
8686 objectName: "artImage"; \n\
87− property bool everShown: false; \n\
88− source: { if (root.visible) everShown = true; return everShown && cardData && cardData["art"] || ""; } \n\
87+ property bool doLoadSource: !NetworkingStatus.limitedBandwith; \n\
88+ source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["art"] || ""; } \n\
8989 cache: true; \n\
9090 asynchronous: root.asynchronous; \n\
9191 fillMode: Image.PreserveAspectCrop; \n\
@@ -196,8 +196,8 @@ var kMascotImageCode = 'Image { \n\
196196 objectName: "mascotImage"; \n\
197197 anchors { %1 } \n\
198198 readonly property int maxSize: Math.max(width, height) * 4; \n\
199− property bool everShown: false; \n\
200− source: { if (root.visible) everShown = true; return everShown && cardData && cardData["mascot"] || ""; } \n\
199+ property bool doLoadSource: !NetworkingStatus.limitedBandwith; \n\
200+ source: { if (root.visible) doLoadSource = true; return doLoadSource && cardData && cardData["mascot"] || ""; } \n\
201201 width: units.gu(6); \n\
202202 height: units.gu(5.625); \n\
203203 sourceSize { width: maxSize; height: maxSize } \n\
@@ -654,6 +654,7 @@ function cardString(template, components) {
654654function createCardComponent(parent, template, components) {
655655 var imports = 'import QtQuick 2.2; \n\
656656 import Ubuntu.Components 1.1; \n\
657+ import Ubuntu.Connectivity 1.0; \n\
657658 import Dash 0.1;\n';
658659 var card = cardString(template, components);
659660 var code = imports + 'Component {\n' + card + '}\n';