Skip to content

Commit

Permalink
Throw a dialog on failure (#1496)
Browse files Browse the repository at this point in the history
Co-authored-by: Cassidy James Blaede <[email protected]>
  • Loading branch information
meisenzahl and cassidyjames committed Mar 2, 2021
1 parent 4f035b1 commit 6e18711
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,20 @@ public class AppCenter.MainWindow : Hdy.ApplicationWindow {
last_installed_package.launch ();
} catch (Error e) {
warning ("Failed to launch %s: %s".printf (last_installed_package.get_name (), e.message));

var message_dialog = new Granite.MessageDialog.with_image_from_icon_name (
_("Failed to launch “%s").printf (last_installed_package.get_name ()),
e.message,
"system-software-install",
Gtk.ButtonsType.CLOSE
);
message_dialog.badge_icon = new ThemedIcon ("dialog-error");
message_dialog.transient_for = this;

message_dialog.show_all ();
message_dialog.response.connect ((response_id) => {
message_dialog.destroy ();
});
}
}
});
Expand Down

0 comments on commit 6e18711

Please sign in to comment.