Merge lp:~laney/ubuntu-system-settings/background-gsettings into lp:ubuntu-system-settings

Proposed by Iain Lane
Status: Merged
Approved by: Ken VanDine
Approved revision: 77
Merged at revision: 78
Proposed branch: lp:~laney/ubuntu-system-settings/background-gsettings
Merge into: lp:ubuntu-system-settings
Diff against target: 71 lines (+30/-1)
2 files modified
debian/control (+2/-0)
plugins/background/MainPage.qml (+28/-1)
To merge this branch: bzr merge lp:~laney/ubuntu-system-settings/background-gsettings
Reviewer Review Type Date Requested Status
Ken VanDine Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+171995@code.launchpad.net

Commit message

Read the user's background from GSettings

Description of the change

Read the background from GSettings.

There's a slightly ugly way of dealing with image loading failures, but it's pretty small so I think we can live with it.

On the device we don't appear to use GSettings (yet?) for the background, so this doesn't work there. Try it on the desktop.

Should I depend on gsettings-desktop-schemas too for org.gnome.desktop.background?

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

> Should I depend on gsettings-desktop-schemas too for org.gnome.desktop.background?

yes please

(not commenting on the other parts yet because I'm trying to wrap my head about the connections/signal stuff used there, would be good if Alberto or Ken could comment on that)

76. By Iain Lane

Don't use Connections - just update from onStatusChanged directly

77. By Iain Lane

Depend on gsettings-desktop-schemas

Revision history for this message
Iain Lane (laney) wrote :

On Fri, Jun 28, 2013 at 10:46:48AM -0000, Sebastien Bacher wrote:
> > Should I depend on gsettings-desktop-schemas too for org.gnome.desktop.background?
>
> yes please

Done.

>
> (not commenting on the other parts yet because I'm trying to wrap my head about the connections/signal stuff used there, would be good if Alberto or Ken could comment on that)

I just got rid of the Connections thing as it was unnecessary - should
be simpler now.

--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Love to see something using gsettings-qt!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2013-06-20 12:44:52 +0000
+++ debian/control 2013-06-28 10:58:30 +0000
@@ -21,6 +21,8 @@
21Architecture: i386 amd64 armhf21Architecture: i386 amd64 armhf
22Depends: ${misc:Depends},22Depends: ${misc:Depends},
23 ${shlibs:Depends},23 ${shlibs:Depends},
24 gsettings-desktop-schemas,
25 qtdeclarative5-gsettings1.0,
24 qtdeclarative5-ubuntu-ui-toolkit-plugin,26 qtdeclarative5-ubuntu-ui-toolkit-plugin,
25 libsystemsettings1 (= ${binary:Version}),27 libsystemsettings1 (= ${binary:Version}),
26Recommends: ubuntu-mobile-icons,28Recommends: ubuntu-mobile-icons,
2729
=== modified file 'plugins/background/MainPage.qml'
--- plugins/background/MainPage.qml 2013-06-20 13:17:10 +0000
+++ plugins/background/MainPage.qml 2013-06-28 10:58:30 +0000
@@ -19,6 +19,7 @@
19*/19*/
2020
21import QtQuick 2.021import QtQuick 2.0
22import GSettings 1.0
22import Ubuntu.Components 0.123import Ubuntu.Components 0.1
23import Ubuntu.Components.ListItems 0.1 as ListItem24import Ubuntu.Components.ListItems 0.1 as ListItem
24import SystemSettings 1.025import SystemSettings 1.0
@@ -28,6 +29,11 @@
28 id: mainPage29 id: mainPage
29 title: i18n.tr("Background")30 title: i18n.tr("Background")
3031
32 GSettings {
33 id: background
34 schema: "org.gnome.desktop.background"
35 }
36
31 Label {37 Label {
32 id: welcomeLabel38 id: welcomeLabel
3339
@@ -75,12 +81,33 @@
75 right: parent.right81 right: parent.right
76 }82 }
7783
78 source: "aeg.jpg"84 Component.onCompleted: updateImage()
7985
80 onClicked: pageStack.push(Utilities.createAlbumPage(86 onClicked: pageStack.push(Utilities.createAlbumPage(
81 i18n.tr("Home screen")))87 i18n.tr("Home screen")))
82 }88 }
8389
90 /* We don't have a good way of doing this after passing an invalid image to
91 SwappableImage, so test the image is valid /before/ showing it and show a
92 fallback if it isn't. */
93 function updateImage() {
94 // TODO: Doesn't yet fade when the background is changed, but probably
95 // not a huge issue. Will resolve itself when we switch to the SDK's
96 // CrossFadeImage
97 if (testImage.status == Image.Ready) {
98 homeImage.source = testImage.source
99 } else if (testImage.status == Image.Error) {
100 homeImage.source = "aeg.jpg"
101 }
102 }
103
104 Image {
105 id: testImage
106 source: background.pictureUri
107 visible: false
108 onStatusChanged: updateImage()
109 }
110
84111
85 ListItem.ThinDivider {112 ListItem.ThinDivider {
86 id: topDivider113 id: topDivider

Subscribers

People subscribed via source and target branches