@@ -14,7 +14,6 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18import QtQuick 2.0
17import QtQuick 2.0
19import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
20import "../Components"
19import "../Components"
@@ -29,17 +28,12 @@ FocusScope {
29 height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
28 height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
31 property real edgeSize: units.gu(2)
30 property real edgeSize: units.gu(2)
32 property url defaultBackground: shell.width >= units.gu(60) ? "../graphics/tablet_background.jpg" : "../graphics/phone_background.jpg"
32 property url defaultBackground: shell.width >= units.gu(60) ? "../graphics/tablet_background.jpg" : "../graphics/phone_background.jpg"
33 property url background
33 property url background
34−
34+ property url backgroundSource
35− GSettings {
35+ property url backgroundFinal: backgroundSource != undefined && backgroundSource != "" ? backgroundSource : shell.defaultBackground
36− id: backgroundSettings
36+ onBackgroundFinalChanged: shell.background = backgroundFinal
37− schema.id: "org.gnome.desktop.background"
39− property url gSettingsPicture: backgroundSettings.pictureUri != undefined && backgroundSettings.pictureUri.length > 0 ? backgroundSettings.pictureUri : shell.defaultBackground
40− onGSettingsPictureChanged: {
41− shell.background = gSettingsPicture
44 // This is a dummy image that is needed to determine if the picture url
38 // This is a dummy image that is needed to determine if the picture url
45 // in backgroundSettings points to a valid picture file.
39 // in backgroundSettings points to a valid picture file.
@@ -56,8 +50,13 @@ FocusScope {
56 sourceSize.height: 0
50 sourceSize.height: 0
57 sourceSize.width: 0
51 sourceSize.width: 0
58 onStatusChanged: {
52 onStatusChanged: {
53+ if (status == Image.Error) {
59− if (status == Image.Error && source != shell.defaultBackground) {
54+ if (source != shell.defaultBackground) {
60− shell.background = defaultBackground
55+ shell.background = defaultBackground
57+ // In case even our default background fails to load...
58+ shell.background = "data:image/svg+xml,<svg><rect width='100%' height='100%' fill='#000'/></svg>"