Merge lp:~diegosarmentero/ubuntu-system-settings/not-credentials into lp:ubuntu-system-settings

Proposed by Diego Sarmentero
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 709
Merged at revision: 719
Proposed branch: lp:~diegosarmentero/ubuntu-system-settings/not-credentials
Merge into: lp:ubuntu-system-settings
Diff against target: 149 lines (+48/-25)
1 file modified
plugins/system-update/PageComponent.qml (+48/-25)
To merge this branch: bzr merge lp:~diegosarmentero/ubuntu-system-settings/not-credentials
Reviewer Review Type Date Requested Status
Sebastien Bacher (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+219691@code.launchpad.net

Commit message

- Not dismiss Credentials warning with other messages.

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 :

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/system-update/PageComponent.qml'
2--- plugins/system-update/PageComponent.qml 2014-05-13 14:30:04 +0000
3+++ plugins/system-update/PageComponent.qml 2014-05-15 12:31:03 +0000
4@@ -37,6 +37,8 @@
5 property bool installAll: false
6 property int updatesAvailable: 0
7
8+ property var notificationAction;
9+
10 DeviceInfo {
11 id: deviceInfo
12 }
13@@ -76,7 +78,6 @@
14 states: [
15 State {
16 name: "SEARCHING"
17- PropertyChanges { target: notification; visible: false}
18 PropertyChanges { target: installAllButton; visible: false}
19 PropertyChanges { target: checkForUpdatesArea; visible: true}
20 PropertyChanges { target: updateNotification; visible: false}
21@@ -90,10 +91,6 @@
22 },
23 State {
24 name: "SYSTEMUPDATEFAILED"
25- PropertyChanges { target: notification; text: i18n.tr("System update has failed.")}
26- PropertyChanges { target: notification; onClicked: undefined }
27- PropertyChanges { target: notification; progression: false}
28- PropertyChanges { target: notification; visible: true}
29 PropertyChanges { target: installingImageUpdate; visible: false}
30 PropertyChanges { target: installAllButton; visible: false}
31 PropertyChanges { target: checkForUpdatesArea; visible: false}
32@@ -104,16 +101,6 @@
33 PropertyChanges { target: updateList; visible: true}
34 PropertyChanges { target: installAllButton; visible: true}
35 PropertyChanges { target: updateNotification; visible: false}
36- },
37- State {
38- name: "NOCREDENTIALS"
39- PropertyChanges { target: updateList; visible: true}
40- PropertyChanges { target: notification; text: i18n.tr("Please log into your Ubuntu One account.")}
41- PropertyChanges { target: notification; onClicked: root.open_online_accounts() }
42- PropertyChanges { target: notification; progression: true}
43- PropertyChanges { target: notification; visible: true}
44- PropertyChanges { target: updateNotification; text: i18n.tr("Credentials not found")}
45- PropertyChanges { target: updateNotification; visible: true}
46 }
47 ]
48
49@@ -126,22 +113,19 @@
50 objectName: "updateManager"
51
52 Component.onCompleted: {
53+ credentialsNotification.visible = false;
54 root.state = "SEARCHING";
55 updateManager.checkUpdates();
56 }
57
58 onUpdateAvailableFound: {
59- if (updateManager.model.length > 0) {
60- root.updatesAvailable = updateManager.model.length;
61- root.state = "UPDATE";
62- root.installAll = downloading
63- } else {
64- root.state = "NOUPDATES";
65- }
66+ root.updatesAvailable = updateManager.model.length;
67+ root.state = "UPDATE";
68+ root.installAll = downloading;
69 }
70
71 onUpdatesNotFound: {
72- if (root.state != "NOCREDENTIALS") {
73+ if (!credentialsNotification.visible) {
74 root.state = "NOUPDATES";
75 }
76 }
77@@ -151,7 +135,10 @@
78 }
79
80 onCredentialsNotFound: {
81- root.state = "NOCREDENTIALS";
82+ credentialsNotification.visible = true;
83+ notification.text = i18n.tr("Please log into your Ubuntu One account.");
84+ notification.progression = true;
85+ notificationAction = root.open_online_accounts;
86 }
87
88 onSystemUpdateDownloaded: {
89@@ -163,7 +150,11 @@
90 root.state = "SYSTEMUPDATEFAILED";
91 if (lastReason) {
92 notification.text = lastReason;
93+ } else {
94+ notification.text = i18n.tr("System update has failed.");
95 }
96+ notification.progression = false;
97+ notificationAction = undefined;
98 }
99
100 onUpdateProcessFailed: {
101@@ -434,8 +425,14 @@
102 ListItem.Standard {
103 id: notification
104 objectName: "notification"
105- visible: false
106+ visible: updateNotification.visible || credentialsNotification.visible ? true : false
107 anchors.bottom: configuration.top
108+
109+ onClicked: {
110+ if (notificationAction) {
111+ notificationAction();
112+ }
113+ }
114 }
115
116 ListItem.SingleValue {
117@@ -483,6 +480,32 @@
118 }
119
120 Rectangle {
121+ id: credentialsNotification
122+ objectName: "credentialsNotification"
123+ anchors {
124+ left: parent.left
125+ right: parent.right
126+ top: installAllButton.bottom
127+ bottom: notification.visible ? notification.top : configuration.top
128+ margins: units.gu(2)
129+ bottomMargin: 0
130+ }
131+ visible: false
132+
133+ color: "transparent"
134+
135+ Column {
136+ anchors.centerIn: parent
137+
138+ Label {
139+ text: i18n.tr("Credentials not found")
140+ anchors.horizontalCenter: parent.horizontalCenter
141+ fontSize: "large"
142+ }
143+ }
144+ }
145+
146+ Rectangle {
147 id: installingImageUpdate
148 objectName: "installingImageUpdate"
149 anchors.fill: parent

Subscribers

People subscribed via source and target branches