summaryrefslogtreecommitdiffstats
path: root/basicsuite
diff options
context:
space:
mode:
Diffstat (limited to 'basicsuite')
-rw-r--r--basicsuite/qt5-everywhere/demos/gridrssnews/main.qml26
-rw-r--r--basicsuite/qt5-everywhere/demos/radio/radio.qml24
-rw-r--r--basicsuite/qt5-everywhere/demos/rssnews/rssnews.qml20
-rw-r--r--basicsuite/qt5-everywhere/demos/video/VideoSelector.qml23
4 files changed, 93 insertions, 0 deletions
diff --git a/basicsuite/qt5-everywhere/demos/gridrssnews/main.qml b/basicsuite/qt5-everywhere/demos/gridrssnews/main.qml
index 3041242..2856cfb 100644
--- a/basicsuite/qt5-everywhere/demos/gridrssnews/main.qml
+++ b/basicsuite/qt5-everywhere/demos/gridrssnews/main.qml
@@ -74,6 +74,8 @@ Rectangle {
onStatusChanged: {
if (status == XmlListModel.Ready) {
playbanner.start();
+ } else if (status == XmlListModel.Error) {
+ networkErrorMessage.start();
}
}
}
@@ -139,6 +141,21 @@ Rectangle {
pageSize: grid.visibleArea.widthRatio
}
+ Item {
+ id: networkErrorBox
+ opacity: 0
+ anchors.fill: parent
+
+ Text {
+ anchors.centerIn: parent
+ text: qsTr("Sorry! No network connection")
+ font.family: uiFont;
+ font.pixelSize: appHeaderFontSize;
+ color: textColor
+ smooth: true
+ }
+ }
+
SequentialAnimation {
id: playbanner
running: false
@@ -146,5 +163,14 @@ Rectangle {
NumberAnimation { target: grid; property: "opacity"; to: 1.0; duration: 300}
}
+ NumberAnimation {
+ id: networkErrorMessage
+ running: false
+ target: networkErrorBox
+ property: "opacity"
+ to: 1.0
+ duration: 300
+ }
+
}
diff --git a/basicsuite/qt5-everywhere/demos/radio/radio.qml b/basicsuite/qt5-everywhere/demos/radio/radio.qml
index 9bd7152..e81c567 100644
--- a/basicsuite/qt5-everywhere/demos/radio/radio.qml
+++ b/basicsuite/qt5-everywhere/demos/radio/radio.qml
@@ -102,6 +102,22 @@ FocusScope {
radius: height/2
+ Item {
+ id: networkErrorBox
+ opacity: 0
+ anchors.fill: parent
+
+ Text {
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+ anchors.rightMargin: parent.width * 0.1
+ text: qsTr("Sorry! No network connection")
+ font.pixelSize: stationList.height*.1;
+ color: "white"
+ smooth: true
+ }
+ }
+
PathView {
enabled: root.activeFocus
id: stationList
@@ -214,6 +230,14 @@ FocusScope {
query: "/radio/channel"
XmlRole {name: "title"; query: "title/string()"}
XmlRole {name: "url"; query: "url/string()"}
+
+ onStatusChanged: {
+ if (status == XmlListModel.Ready) {
+ networkErrorBox.opacity = 0;
+ } else if (status == XmlListModel.Error) {
+ networkErrorBox.opacity = 1;
+ }
+ }
}
VolumeButton {
diff --git a/basicsuite/qt5-everywhere/demos/rssnews/rssnews.qml b/basicsuite/qt5-everywhere/demos/rssnews/rssnews.qml
index 5bb1868..213d9e8 100644
--- a/basicsuite/qt5-everywhere/demos/rssnews/rssnews.qml
+++ b/basicsuite/qt5-everywhere/demos/rssnews/rssnews.qml
@@ -67,6 +67,14 @@ Rectangle {
XmlRole { name: "title"; query: "title/string()" }
XmlRole { name: "link"; query: "link/string()" }
XmlRole { name: "description"; query: "description/string()" }
+
+ onStatusChanged: {
+ if (status == XmlListModel.Error) {
+ networkErrorBox.opacity = 1.0
+ } else if (status == XmlListModel.Ready) {
+ networkErrorBox.opacity = 0.0
+ }
+ }
}
Row {
@@ -93,9 +101,21 @@ Rectangle {
width: window.width - window.listWidth; height: window.height
model: feedModel
delegate: NewsDelegate {}
+
+ Item {
+ id: networkErrorBox
+ opacity: 0
+ anchors.fill: parent
+
+ Text {
+ anchors.centerIn: parent
+ text: qsTr("Sorry! No network connection")
+ }
+ }
}
}
+
ScrollBar { scrollArea: list; height: list.height; width: 8; anchors.right: window.right }
Rectangle { x: window.listWidth; height: window.height; width: 1; color: "#cccccc" }
}
diff --git a/basicsuite/qt5-everywhere/demos/video/VideoSelector.qml b/basicsuite/qt5-everywhere/demos/video/VideoSelector.qml
index df3e3e2..8ce8d83 100644
--- a/basicsuite/qt5-everywhere/demos/video/VideoSelector.qml
+++ b/basicsuite/qt5-everywhere/demos/video/VideoSelector.qml
@@ -67,6 +67,29 @@ Item {
XmlRole { name: "thumbnail"; query: "thumbnail/string()" }
XmlRole { name: "title"; query: "title/string()" }
XmlRole { name: "link"; query: "link/string()" }
+
+ onStatusChanged: {
+ if (status == XmlListModel.Ready) {
+ networkErrorBox.opacity = 0.0
+ } else if (status == XmlListModel.Error) {
+ networkErrorBox.opacity = 1.0
+ }
+ }
+ }
+
+ Item {
+ id: networkErrorBox
+ opacity: 0
+ anchors.fill: parent
+
+ Text {
+ anchors.centerIn: parent
+ text: qsTr("Sorry! No network connection")
+ font.family: uiFont;
+ font.pixelSize: tileFontSize * 2;
+ color: textColor
+ smooth: true
+ }
}
// Grid view