Merge lp:~jonas-drange/ubuntu-system-settings/fix-1365167-numerous-custom-background-issues into lp:ubuntu-system-settings

Proposed by Jonas G. Drange
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 998
Merged at revision: 1022
Proposed branch: lp:~jonas-drange/ubuntu-system-settings/fix-1365167-numerous-custom-background-issues
Merge into: lp:ubuntu-system-settings
Diff against target: 108 lines (+18/-30)
4 files modified
plugins/background/Components/AddRemove.qml (+0/-1)
plugins/background/MainPage.qml (+12/-3)
plugins/background/Preview.qml (+5/-1)
plugins/background/WallpaperGrid.qml (+1/-25)
To merge this branch: bzr merge lp:~jonas-drange/ubuntu-system-settings/fix-1365167-numerous-custom-background-issues
Reviewer Review Type Date Requested Status
Sebastien Bacher (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+233376@code.launchpad.net

Commit message

[background] always keep custom images, and remove press-and-hold action.

Description of the change

[background] always keep custom images, and remove press-and-hold action.

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

The stacking fix works, the import workflow feels broken though (if you pick an image, you get a preview dialog, if you click cancel there it imports the image anyway ... maybe the buttons should be renamed "just import" "set as background" or something similar?)
Setting as "need info" because previous cancel was doing what the label says which felt more right

review: Needs Information
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, that looks better. Did you get feedback from design about the interactions and the strings used?

review: Needs Information
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
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

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/background/Components/AddRemove.qml'
2--- plugins/background/Components/AddRemove.qml 2014-07-07 11:47:06 +0000
3+++ plugins/background/Components/AddRemove.qml 2014-09-05 14:01:00 +0000
4@@ -99,5 +99,4 @@
5 enteredQueueMode();
6 }
7 }
8-
9 }
10
11=== modified file 'plugins/background/MainPage.qml'
12--- plugins/background/MainPage.qml 2014-08-27 22:18:55 +0000
13+++ plugins/background/MainPage.qml 2014-09-05 14:01:00 +0000
14@@ -61,7 +61,9 @@
15 // a callback that pushes the preview stack
16 onTriggered: {
17 startContentTransfer(function(uri) {
18- pageStack.push(Qt.resolvedUrl("Preview.qml"), {uri: uri});
19+ pageStack.push(Qt.resolvedUrl("Preview.qml"), {
20+ uri: uri, imported: true
21+ });
22 // set Connection target
23 selectedItemConnection.target = pageStack.currentPage;
24 });
25@@ -189,10 +191,17 @@
26 trans.state = ContentTransfer.Finalized;
27 }
28 }
29- // if we did an import, clean up
30+
31 if ((target.state === "cancelled") &&
32 (trans && trans.state === ContentTransfer.Collected)) {
33- backgroundPanel.rmFile(target.uri);
34+
35+ if (target.imported) {
36+ // if we just did an import, remove the image if the user
37+ // cancels
38+ backgroundPanel.rmFile(target.uri);
39+ } else {
40+ backgroundPanel.prepareBackgroundFile(target.uri, true);
41+ }
42 trans.state = ContentTransfer.Finalized;
43 }
44 }
45
46=== modified file 'plugins/background/Preview.qml'
47--- plugins/background/Preview.qml 2014-06-26 09:39:57 +0000
48+++ plugins/background/Preview.qml 2014-09-05 14:01:00 +0000
49@@ -28,6 +28,9 @@
50 anchors.fill: parent
51
52 property string uri
53+
54+ // whether an image was just imported from e.g. contentHub
55+ property bool imported: false
56 signal save
57 property Item headerStyle: header.__styleInstance ?
58 header.__styleInstance : null
59@@ -94,7 +97,8 @@
60
61 Button {
62 objectName: "cancelButton"
63- text: i18n.tr("Cancel")
64+ text: preview.imported ?
65+ i18n.tr("Remove image") : i18n.tr("Cancel")
66 width: (previewButtons.width-units.gu(2)*4)/2
67 gradient: UbuntuColors.greyGradient
68 onClicked: preview.state = "cancelled"
69
70=== modified file 'plugins/background/WallpaperGrid.qml'
71--- plugins/background/WallpaperGrid.qml 2014-07-04 12:00:55 +0000
72+++ plugins/background/WallpaperGrid.qml 2014-09-05 14:01:00 +0000
73@@ -179,35 +179,11 @@
74 id: emptyItemForCaller
75 anchors.centerIn: parent
76 }
77- ActionSelectionPopover {
78- id: actPop
79- caller: emptyItemForCaller
80- delegate: ListItem.Standard {
81- text: action.text
82- }
83- actions: ActionList {
84- Action {
85- text: i18n.tr("Remove")
86- onTriggered: {
87- // removing current background, revert to default
88- if (modelData === current) {
89- Utilities.revertBackgroundToDefault();
90- }
91- backgroundPanel.rmFile(modelData);
92- }
93- }
94- }
95- }
96 MouseArea {
97 id: imgMouseArea
98 anchors.fill: parent
99- onPressAndHold: {
100- if (editable && (grid.state === "")) {
101- actPop.show();
102- }
103- }
104 onClicked: {
105- if (!actPop.visible && (grid.state === "")) {
106+ if (grid.state === "") {
107 selected(modelData);
108 }
109

Subscribers

People subscribed via source and target branches