Merge lp:~donadigo/appcenter/install-notify-canceled into lp:~elementary-apps/appcenter/appcenter

Proposed by Adam Bieńkowski
Status: Rejected
Rejected by: Adam Bieńkowski
Proposed branch: lp:~donadigo/appcenter/install-notify-canceled
Merge into: lp:~elementary-apps/appcenter/appcenter
Diff against target: 71 lines (+17/-12) (has conflicts)
2 files modified
src/Core/Client.vala (+8/-0)
src/Core/Package.vala (+9/-12)
Text conflict in src/Core/Client.vala
To merge this branch: bzr merge lp:~donadigo/appcenter/install-notify-canceled
Reviewer Review Type Date Requested Status
Danielle Foré Approve
Cody Garver (community) Abstain
Review via email: mp+298052@code.launchpad.net

Commit message

Check if the action was canceled if yes, do not send the notification

Description of the change

Fixes bug #1592291: "Application installed Notification even if you canceled".

Check if the action was canceled if yes, do not send the notification.

To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) wrote :

I'm unable to review this because I can't get any installation to cancel, they just keep installing...

review: Abstain
Revision history for this message
Danielle Foré (danrabbit) wrote :

Following the steps from the bug report, I can still reproduce this issue. I didn't notice the first time around, but the report says to cancel *from the auth dialog*

review: Needs Fixing
Revision history for this message
Danielle Foré (danrabbit) wrote :

Can confirm this now addressed the issue :)

review: Approve
Revision history for this message
Danielle Foré (danrabbit) wrote :

Hm it looks like I get no installation notifications now though haha

211. By Adam Bieńkowski

Actually fix the issue

Unmerged revisions

211. By Adam Bieńkowski

Actually fix the issue

210. By Adam Bieńkowski

Do not send notification when not installed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Core/Client.vala'
--- src/Core/Client.vala 2016-06-28 21:47:23 +0000
+++ src/Core/Client.vala 2016-07-01 21:55:42 +0000
@@ -97,6 +97,7 @@
97 }97 }
98 }98 }
9999
100<<<<<<< TREE
100 public AppStream.Component? get_extension (string extension) throws GLib.Error {101 public AppStream.Component? get_extension (string extension) throws GLib.Error {
101 try {102 try {
102 return appstream_database.get_component_by_id (extension); 103 return appstream_database.get_component_by_id (extension);
@@ -108,6 +109,10 @@
108 }109 }
109110
110 public async void install_package (Package package, Pk.ProgressCallback cb, GLib.Cancellable cancellable) throws GLib.Error {111 public async void install_package (Package package, Pk.ProgressCallback cb, GLib.Cancellable cancellable) throws GLib.Error {
112=======
113 public async Pk.Exit install_package (Package package, Pk.ProgressCallback cb, GLib.Cancellable cancellable) throws GLib.Error {
114 Pk.Exit exit_status = Pk.Exit.UNKNOWN;
115>>>>>>> MERGE-SOURCE
111 AppCenter.Task install_task = request_task ();116 AppCenter.Task install_task = request_task ();
112 AppCenter.Task search_task = request_task ();117 AppCenter.Task search_task = request_task ();
113 string[] packages_ids = {};118 string[] packages_ids = {};
@@ -130,6 +135,8 @@
130 release_task (install_task);135 release_task (install_task);
131 throw new GLib.IOError.FAILED (Pk.Exit.enum_to_string (results.get_exit_code ()));136 throw new GLib.IOError.FAILED (Pk.Exit.enum_to_string (results.get_exit_code ()));
132 }137 }
138
139 exit_status = results.get_exit_code ();
133 } catch (Error e) {140 } catch (Error e) {
134 release_task (search_task);141 release_task (search_task);
135 release_task (install_task);142 release_task (install_task);
@@ -138,6 +145,7 @@
138145
139 release_task (search_task);146 release_task (search_task);
140 release_task (install_task);147 release_task (install_task);
148 return exit_status;
141 }149 }
142150
143 public async void update_package (Package package, Pk.ProgressCallback cb, GLib.Cancellable cancellable) throws GLib.Error {151 public async void update_package (Package package, Pk.ProgressCallback cb, GLib.Cancellable cancellable) throws GLib.Error {
144152
=== modified file 'src/Core/Package.vala'
--- src/Core/Package.vala 2016-06-29 21:40:17 +0000
+++ src/Core/Package.vala 2016-07-01 21:55:42 +0000
@@ -75,18 +75,15 @@
75 var application = (Gtk.Application)Application.get_default ();75 var application = (Gtk.Application)Application.get_default ();
76 var window = application.get_active_window ().get_window ();76 var window = application.get_active_window ().get_window ();
7777
78 yield AppCenterCore.Client.get_default ().install_package (this, (progress, type) => { 78 var exit_status = yield AppCenterCore.Client.get_default ().install_package (this, (progress, type) => {change_information.ProgressCallback (progress, type);}, action_cancellable);
79 if (type == Pk.ProgressType.STATUS && progress.status == Pk.Status.FINISHED && (window.get_state () & Gdk.WindowState.FOCUSED) == 0) {79 if (exit_status == Pk.Exit.SUCCESS && (window.get_state () & Gdk.WindowState.FOCUSED) == 0) {
80 var notification = new Notification (_("Application installed"));80 var notification = new Notification (_("Application installed"));
81 notification.set_body (_("%s has been successfully installed").printf (get_name ()));81 notification.set_body (_("%s has been successfully installed").printf (get_name ()));
82 notification.set_icon (new ThemedIcon ("system-software-install"));82 notification.set_icon (new ThemedIcon ("system-software-install"));
83 notification.set_default_action ("app.open-application");83 notification.set_default_action ("app.open-application");
8484
85 application.send_notification ("installed", notification);85 application.send_notification ("installed", notification);
86 }86 }
87
88 change_information.ProgressCallback (progress, type);
89 }, action_cancellable);
9087
91 installed_packages.add_all (change_information.changes);88 installed_packages.add_all (change_information.changes);
92 change_information.clear ();89 change_information.clear ();

Subscribers

People subscribed via source and target branches