on xenial help sign in
Read background from GSettings
commit5eb6bce17882efa508f9247ba323bc524057181e authorAndrea Cimitan <andrea.cimitan@canonical.com> dateTue 16 Jul 2013, 10:50 (13 years ago) parent5a4e317
2 files changed+23
Shell.qml+21 debian/control+2
Shell.qml+21
@@ -15,6 +15,7 @@
1515 */
1616
1717import QtQuick 2.0
18+import GSettings 1.0
1819import Ubuntu.Application 0.1
1920import Ubuntu.Components 0.1
2021import Ubuntu.Gestures 0.1
@@ -112,6 +113,26 @@ FocusScope {
112113 }
113114 }
114115
116+ GSettings {
117+ id: backgroundSettings
118+ schema: "org.gnome.desktop.background"
119+ }
120+
121+ function updateImage() {
122+ if (testImage.status == Image.Ready) {
123+ shell.background = testImage.source
124+ } else if (testImage.status == Image.Error) {
125+ shell.background = shell.default_background
126+ }
127+ }
128+
129+ Image {
130+ id: testImage
131+ source: backgroundSettings.pictureUri
132+ visible: false
133+ onStatusChanged: updateImage()
134+ }
135+
115136 VolumeControl {
116137 id: volumeControl
117138 }
debian/control+2
@@ -4,6 +4,7 @@ Priority: optional
44Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
55Build-Depends: cmake,
66 debhelper (>= 9),
7+ gsettings-desktop-schemas,
78 libdee-qt5-dev (>= 3.0),
89 libgl1-mesa-dev[!armhf] | libgl-dev[!armhf],
910 libgl1-mesa-dri,
@@ -30,6 +31,7 @@ Build-Depends: cmake,
3031 qtbase5-private-dev,
3132 qtdeclarative5-dev,
3233 qtdeclarative5-dev-tools,
34+ qtdeclarative5-gsettings1.0,
3335 qtdeclarative5-private-dev,
3436 qtdeclarative5-qtquick2-plugin,
3537 qtdeclarative5-test-plugin,