Skip to content

Commit

Permalink
fix[#23] detect failure and report to user
Browse files Browse the repository at this point in the history
  • Loading branch information
jardon committed Dec 5, 2024
1 parent f687c2b commit 89b1620
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions vanilla_sideload/views/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ def on_response(dialog: Adw.MessageDialog, response: Text) -> None:
def on_vte_child_exited(
self, console: Vte.Terminal, status: int, *args: Any
) -> None:
if not bool(status):
self.emit("done", True)
self.emit("done", bool(status))

def __on_console_clicked(self, btn: Gtk.Button) -> None:
status: bool = not self.box_console_main.get_visible()
Expand Down
5 changes: 5 additions & 0 deletions vanilla_sideload/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,13 @@ def __build_install_ui(self) -> None:
self.bin_main.set_child(self.view_install)

def __on_install_done(self, view_install: SideloaderInstall, *args: Any) -> None:
success = args[0]
view_install_done = SideloaderInstallDone(self.__pkg.name)
view_install_done.btn_logs.connect("clicked", self.__on_view_logs)
if not success:
view_install_done.status.set_title(_("Installation Failed"))
view_install_done.status.set_description(_("The package installation was unsuccessful"))
# view_install_done.set_icon(Gtk.Image.new_from_icon_name("dialog-error-symbolic", Gtk.IconSize.LARGE))
self.bin_main.set_child(view_install_done)

def __build_uninstall_ui(self) -> None:
Expand Down

0 comments on commit 89b1620

Please sign in to comment.