Merge lp:~mardy/ubuntu-system-settings-online-accounts/lp1231729 into lp:ubuntu-system-settings-online-accounts

Proposed by Alberto Mardegan
Status: Merged
Approved by: Ken VanDine
Approved revision: 51
Merged at revision: 56
Proposed branch: lp:~mardy/ubuntu-system-settings-online-accounts/lp1231729
Merge into: lp:ubuntu-system-settings-online-accounts
Diff against target: 110 lines (+39/-12)
3 files modified
src/AccountEditPage.qml (+5/-1)
src/AccountItem.qml (+27/-3)
src/AccountsPage.qml (+7/-8)
To merge this branch: bzr merge lp:~mardy/ubuntu-system-settings-online-accounts/lp1231729
Reviewer Review Type Date Requested Status
Ken VanDine Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+188808@code.launchpad.net

Commit message

Delay destruction of the delegate until the edit page is popped

Use ListView.delayRemove feature to delay the destruction of the delegate until
we have removed the edit page from the stack.

Description of the change

Delay destruction of the delegate until the edit page is popped

Use ListView.delayRemove feature to delay the destruction of the delegate until
we have removed the edit page from the stack.

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
Ken VanDine (ken-vandine) wrote :

Looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/AccountEditPage.qml'
2--- src/AccountEditPage.qml 2013-06-05 11:33:39 +0000
3+++ src/AccountEditPage.qml 2013-10-02 10:50:40 +0000
4@@ -22,8 +22,12 @@
5 import "constants.js" as Constants
6
7 Page {
8+ id: root
9+
10 property variant accountHandle
11
12+ signal finished
13+
14 title: account.provider.displayName
15
16 Account {
17@@ -42,7 +46,7 @@
18 target: loader.item
19 onFinished: {
20 console.log("====== PLUGIN FINISHED ======")
21- pageStack.pop()
22+ root.finished()
23 }
24 }
25 }
26
27=== modified file 'src/AccountItem.qml'
28--- src/AccountItem.qml 2013-05-30 13:00:54 +0000
29+++ src/AccountItem.qml 2013-10-02 10:50:40 +0000
30@@ -22,7 +22,10 @@
31 import Ubuntu.OnlineAccounts 0.1
32
33 ListItem.Subtitled {
34+ property variant accountHandle
35 property variant globalServiceHandle
36+ property variant __editPage: null
37+ property bool running: false
38
39 text: providerName
40 subText: displayName
41@@ -30,8 +33,29 @@
42 progression: true
43 opacity: globalService.enabled ? 1 : 0.5
44
45- resources: AccountService {
46- id: globalService
47- objectHandle: globalServiceHandle
48+ resources: [
49+ AccountService {
50+ id: globalService
51+ objectHandle: globalServiceHandle
52+ },
53+ Component {
54+ id: accountEditPage
55+ AccountEditPage {}
56+ }
57+ ]
58+
59+ onClicked: {
60+ __editPage = accountEditPage.createObject(null, {
61+ "accountHandle": accountHandle })
62+ __editPage.finished.connect(__onEditFinished)
63+ pageStack.push(__editPage)
64+ running = true;
65+ }
66+
67+ function __onEditFinished() {
68+ __editPage.destroy(1000)
69+ __editPage = null
70+ pageStack.pop()
71+ running = false
72 }
73 }
74
75=== modified file 'src/AccountsPage.qml'
76--- src/AccountsPage.qml 2013-07-11 10:06:49 +0000
77+++ src/AccountsPage.qml 2013-10-02 10:50:40 +0000
78@@ -30,15 +30,19 @@
79 anchors.left: parent.left
80 anchors.right: parent.right
81
82- Repeater {
83+ ListView {
84+ anchors.left: parent.left
85+ anchors.right: parent.right
86+ interactive: false
87+ height: contentHeight
88 model: accountsModel
89
90 delegate: AccountItem {
91+ ListView.delayRemove: running
92 text: providerName
93 subText: displayName
94+ accountHandle: account
95 globalServiceHandle: accountService
96- onClicked: pageStack.push(accountEditPage,
97- { accountHandle: account })
98 }
99 }
100
101@@ -58,9 +62,4 @@
102 id: newAccountPage
103 NewAccountPage {}
104 }
105-
106- Component {
107- id: accountEditPage
108- AccountEditPage {}
109- }
110 }

Subscribers

People subscribed via source and target branches