Merge lp:~michael-sheldon/content-hub/download-manager-with-snapdecision-unity8 into lp:~ken-vandine/content-hub/download-manager-with-snapdecision

Proposed by Michael Sheldon
Status: Merged
Merged at revision: 88
Proposed branch: lp:~michael-sheldon/content-hub/download-manager-with-snapdecision-unity8
Merge into: lp:~ken-vandine/content-hub/download-manager-with-snapdecision
Diff against target: 53 lines (+22/-2)
1 file modified
src/com/ubuntu/content/detail/service.cpp (+22/-2)
To merge this branch: bzr merge lp:~michael-sheldon/content-hub/download-manager-with-snapdecision-unity8
Reviewer Review Type Date Requested Status
Ken VanDine Pending
Review via email: mp+214506@code.launchpad.net

Commit message

Make snap decision compatible with unity8

Description of the change

Unity8 no longer displays snap decisions with only one button (by design: bug #1301685), and also doesn't display decisions with NULL text, this branch adds a "Dismiss" option and makes a few small styling changes (highlights the "Open" button and displays the "Save" icon).

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/com/ubuntu/content/detail/service.cpp'
--- src/com/ubuntu/content/detail/service.cpp 2014-04-03 19:13:47 +0000
+++ src/com/ubuntu/content/detail/service.cpp 2014-04-07 10:21:52 +0000
@@ -184,6 +184,14 @@
184 && st != cuc::Transfer::aborted);184 && st != cuc::Transfer::aborted);
185}185}
186186
187void action_dismiss(NotifyNotification *notification, char *action, gpointer data)
188{
189 TRACE() << Q_FUNC_INFO;
190 Q_UNUSED(notification);
191 Q_UNUSED(action);
192 Q_UNUSED(data);
193}
194
187void action_accept(NotifyNotification *notification, char *action, gpointer data)195void action_accept(NotifyNotification *notification, char *action, gpointer data)
188{196{
189 TRACE() << Q_FUNC_INFO;197 TRACE() << Q_FUNC_INFO;
@@ -201,13 +209,18 @@
201 NotifyNotification* notification;209 NotifyNotification* notification;
202210
203 notification = notify_notification_new ("Download Complete",211 notification = notify_notification_new ("Download Complete",
204 NULL,212 "",
205 NULL);213 "save");
214
206 notify_notification_set_hint_string(notification,215 notify_notification_set_hint_string(notification,
207 "x-canonical-snap-decisions",216 "x-canonical-snap-decisions",
208 "true");217 "true");
209218
210219
220 notify_notification_set_hint_string(notification,
221 "x-canonical-private-button-tint",
222 "true");
223
211 notify_notification_add_action (notification,224 notify_notification_add_action (notification,
212 "action_accept",225 "action_accept",
213 "Open",226 "Open",
@@ -215,6 +228,13 @@
215 t,228 t,
216 NULL);229 NULL);
217230
231 notify_notification_add_action (notification,
232 "action_dismiss",
233 "Dismiss",
234 action_dismiss,
235 t,
236 NULL);
237
218 GError *error = NULL;238 GError *error = NULL;
219 if (!notify_notification_show(notification, &error)) {239 if (!notify_notification_show(notification, &error)) {
220 qWarning() << "Failed to show snap decision:" << error->message;240 qWarning() << "Failed to show snap decision:" << error->message;

Subscribers

People subscribed via source and target branches

to all changes: