Merge lp:~sil2100/ubuntu-system-settings/background_fallback_workaround into lp:ubuntu-system-settings

Proposed by Łukasz Zemczak
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 439
Merged at revision: 448
Proposed branch: lp:~sil2100/ubuntu-system-settings/background_fallback_workaround
Merge into: lp:ubuntu-system-settings
Diff against target: 49 lines (+5/-4)
2 files modified
plugins/background/MainPage.qml (+5/-2)
plugins/background/background.pro (+0/-2)
To merge this branch: bzr merge lp:~sil2100/ubuntu-system-settings/background_fallback_workaround
Reviewer Review Type Date Requested Status
Sebastien Bacher (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+189918@code.launchpad.net

Commit message

Remove the included fallback images, use the ones that unity8 uses - we do it in the same way that unity8 does, but oh well, it's a workaround for now anyway

Description of the change

- Problem:

We have a snail and cogs as fallback images. SNAILS!

- Fix:

So, this fix is a temporary workaround for now, as the topic is still fresh. Please read up about the rationale:

Unity8 offers default fallback background images in its code. These are hardcoded and selected in the same way as I made it - a different one for tablet and phone. I decided to move the same thing here so that we have the very same visuals in settings as in the shell itself.
The thing I am recommending in the end is using the default value from GSettings. This is nice, but I think we still need to have a 'final' fallback in case someone overrides the default value to an invalid image, or the image gets broken etc. So anyway this change could get in I think.
Resetting to default value is a different game, and I have a branch for that already - using the default from GSettings. So we won't use the fallback there. In that fix/branch I will add all the default value GSettings functionality. Anyway it would make sense to have this in, no?

Since I am using absolute paths to the Unity8 graphics, I was thinking of maybe adding a dependency? But on the other hand, I guess ubuntu-system-settings makes no sense without unity8 anyway.

Please comment!

- Tests:

N/A

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 :

Thanks for the work, small comment:

> import "MainPage"

that feels weird ... in fact that source is not used anymore I think, and doesn't match the new design, we should probably just clean it from the vcs.

Otherwise the usual way to do that is to declare a priority in ChangeImage and have the value set in the stack.push from the main UI ... since nothing is doing the pushing here, just declare the property and use it (if you want to keep the source)

> + property string fallback: mainPage.defaultBackground

do you need the "mainPage" there? you should be able to just use "defaultBackground"

review: Needs Fixing
439. By Łukasz Zemczak

As mentioned by seb, ChangeImage is no longer used and we shouldn't care about that one. Also, unneeded mainPage prefix - QML noobishness

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Thanks for the review! Corrected the issues. I didn't know if there are any plans for ChangeImage so I hacked it in the fastest way possible. I guess let's get rid of it in the nearest refactoring/cleanup merge - for now I guess no need to worry about it at all.

But if needed, I can always remove it here in this merge, but I learned that it's best to do refactoring in separate merges - indeed it's easier to track later on!

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Learned from you Sebastien, so that it's clear ;p !

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

looks fine, thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/background/MainPage.qml'
2--- plugins/background/MainPage.qml 2013-10-10 09:53:25 +0000
3+++ plugins/background/MainPage.qml 2013-10-10 14:56:00 +0000
4@@ -32,6 +32,9 @@
5 id: mainPage
6 title: i18n.tr("Background")
7
8+ /* TODO: For now hardcoded paths, later we'll use GSettings */
9+ property string defaultBackground: mainPage.width >= units.gu(60) ? "/usr/share/unity8/graphics/tablet_background.jpg" : "/usr/share/unity8/graphics/phone_background.jpg"
10+
11 UbuntuBackgroundPanel {
12 id: backgroundPanel
13
14@@ -202,7 +205,7 @@
15
16 Image {
17 id: testWelcomeImage
18- property string fallback: "darkeningclockwork.jpg"
19+ property string fallback: defaultBackground
20 visible: false
21 onStatusChanged: updateImage(testWelcomeImage,
22 welcomeImage)
23@@ -210,7 +213,7 @@
24
25 Image {
26 id: testHomeImage
27- property string fallback: "aeg.jpg"
28+ property string fallback: defaultBackground
29 source: background.pictureUri
30 visible: false
31 onStatusChanged: updateImage(testHomeImage,
32
33=== removed file 'plugins/background/aeg.jpg'
34Binary files plugins/background/aeg.jpg 2013-06-19 17:00:05 +0000 and plugins/background/aeg.jpg 1970-01-01 00:00:00 +0000 differ
35=== modified file 'plugins/background/background.pro'
36--- plugins/background/background.pro 2013-09-16 18:16:51 +0000
37+++ plugins/background/background.pro 2013-10-10 14:56:00 +0000
38@@ -15,8 +15,6 @@
39 $${QML_SOURCES}
40
41 images.files = \
42- aeg.jpg \
43- darkeningclockwork.jpg \
44 homeoverlay.svg \
45 welcomeoverlay.svg
46 images.path = $${PLUGIN_QML_DIR}/$${TARGET}
47
48=== removed file 'plugins/background/darkeningclockwork.jpg'
49Binary files plugins/background/darkeningclockwork.jpg 2013-06-19 18:37:34 +0000 and plugins/background/darkeningclockwork.jpg 1970-01-01 00:00:00 +0000 differ

Subscribers

People subscribed via source and target branches