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
=== modified file 'plugins/background/Components/AddRemove.qml'
--- plugins/background/Components/AddRemove.qml 2014-07-07 11:47:06 +0000
+++ plugins/background/Components/AddRemove.qml 2014-09-05 14:01:00 +0000
@@ -99,5 +99,4 @@
99 enteredQueueMode();99 enteredQueueMode();
100 }100 }
101 }101 }
102
103}102}
104103
=== modified file 'plugins/background/MainPage.qml'
--- plugins/background/MainPage.qml 2014-08-27 22:18:55 +0000
+++ plugins/background/MainPage.qml 2014-09-05 14:01:00 +0000
@@ -61,7 +61,9 @@
61 // a callback that pushes the preview stack61 // a callback that pushes the preview stack
62 onTriggered: {62 onTriggered: {
63 startContentTransfer(function(uri) {63 startContentTransfer(function(uri) {
64 pageStack.push(Qt.resolvedUrl("Preview.qml"), {uri: uri});64 pageStack.push(Qt.resolvedUrl("Preview.qml"), {
65 uri: uri, imported: true
66 });
65 // set Connection target67 // set Connection target
66 selectedItemConnection.target = pageStack.currentPage;68 selectedItemConnection.target = pageStack.currentPage;
67 });69 });
@@ -189,10 +191,17 @@
189 trans.state = ContentTransfer.Finalized;191 trans.state = ContentTransfer.Finalized;
190 }192 }
191 }193 }
192 // if we did an import, clean up194
193 if ((target.state === "cancelled") &&195 if ((target.state === "cancelled") &&
194 (trans && trans.state === ContentTransfer.Collected)) {196 (trans && trans.state === ContentTransfer.Collected)) {
195 backgroundPanel.rmFile(target.uri);197
198 if (target.imported) {
199 // if we just did an import, remove the image if the user
200 // cancels
201 backgroundPanel.rmFile(target.uri);
202 } else {
203 backgroundPanel.prepareBackgroundFile(target.uri, true);
204 }
196 trans.state = ContentTransfer.Finalized;205 trans.state = ContentTransfer.Finalized;
197 }206 }
198 }207 }
199208
=== modified file 'plugins/background/Preview.qml'
--- plugins/background/Preview.qml 2014-06-26 09:39:57 +0000
+++ plugins/background/Preview.qml 2014-09-05 14:01:00 +0000
@@ -28,6 +28,9 @@
28 anchors.fill: parent28 anchors.fill: parent
2929
30 property string uri30 property string uri
31
32 // whether an image was just imported from e.g. contentHub
33 property bool imported: false
31 signal save34 signal save
32 property Item headerStyle: header.__styleInstance ?35 property Item headerStyle: header.__styleInstance ?
33 header.__styleInstance : null36 header.__styleInstance : null
@@ -94,7 +97,8 @@
9497
95 Button {98 Button {
96 objectName: "cancelButton"99 objectName: "cancelButton"
97 text: i18n.tr("Cancel")100 text: preview.imported ?
101 i18n.tr("Remove image") : i18n.tr("Cancel")
98 width: (previewButtons.width-units.gu(2)*4)/2102 width: (previewButtons.width-units.gu(2)*4)/2
99 gradient: UbuntuColors.greyGradient103 gradient: UbuntuColors.greyGradient
100 onClicked: preview.state = "cancelled"104 onClicked: preview.state = "cancelled"
101105
=== modified file 'plugins/background/WallpaperGrid.qml'
--- plugins/background/WallpaperGrid.qml 2014-07-04 12:00:55 +0000
+++ plugins/background/WallpaperGrid.qml 2014-09-05 14:01:00 +0000
@@ -179,35 +179,11 @@
179 id: emptyItemForCaller179 id: emptyItemForCaller
180 anchors.centerIn: parent180 anchors.centerIn: parent
181 }181 }
182 ActionSelectionPopover {
183 id: actPop
184 caller: emptyItemForCaller
185 delegate: ListItem.Standard {
186 text: action.text
187 }
188 actions: ActionList {
189 Action {
190 text: i18n.tr("Remove")
191 onTriggered: {
192 // removing current background, revert to default
193 if (modelData === current) {
194 Utilities.revertBackgroundToDefault();
195 }
196 backgroundPanel.rmFile(modelData);
197 }
198 }
199 }
200 }
201 MouseArea {182 MouseArea {
202 id: imgMouseArea183 id: imgMouseArea
203 anchors.fill: parent184 anchors.fill: parent
204 onPressAndHold: {
205 if (editable && (grid.state === "")) {
206 actPop.show();
207 }
208 }
209 onClicked: {185 onClicked: {
210 if (!actPop.visible && (grid.state === "")) {186 if (grid.state === "") {
211 selected(modelData);187 selected(modelData);
212 }188 }
213189

Subscribers

People subscribed via source and target branches