Skip to content

Commit

Permalink
feat:[#22] view output after successful install
Browse files Browse the repository at this point in the history
- add logs button to done screen
- add quit button to install screen
- configure install screen for viewing logs
  • Loading branch information
jardon committed Oct 28, 2024
1 parent d771bca commit f687c2b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
10 changes: 10 additions & 0 deletions vanilla_sideload/gtk/view-install-done.ui
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,19 @@
<property name="label" translatable="yes">Done</property>
<style>
<class name="pill"/>
<class name="suggested-action"/>
</style>
</object>
</child>
<child>
<object class="GtkButton" id="btn_logs">
<property name="label">View Logs</property>
<property name="visible">true</property>
<style>
<class name="pill"/>
</style>
</object>
</child>
</object>
</child>
</object>
Expand Down
12 changes: 12 additions & 0 deletions vanilla_sideload/gtk/view-install.ui
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@
</style>
</object>
</child>
<child>
<object class="GtkButton" id="btn_quit">
<property name="action-name">app.quit</property>
<property name="label" translatable="yes">Done</property>
<property name="visible">False</property>
<property name="halign">center</property>
<style>
<class name="pill"/>
<class name="suggested-action"/>
</style>
</object>
</child>
</object>
</child>
</object>
Expand Down
1 change: 1 addition & 0 deletions vanilla_sideload/views/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class SideloaderInstall(Adw.Bin):
box_console_main: Gtk.Box = Gtk.Template.Child()
box_console: Gtk.Box = Gtk.Template.Child()
btn_console: Gtk.Button = Gtk.Template.Child()
btn_quit: Gtk.Button = Gtk.Template.Child()

__pkg: DebPackage
__console: Vte.Terminal
Expand Down
1 change: 1 addition & 0 deletions vanilla_sideload/views/install_done.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class SideloaderInstallDone(Adw.Bin):
__gtype_name__ = "SideloaderInstallDone"

status = Gtk.Template.Child()
btn_logs = Gtk.Template.Child()

def __init__(self, package_name: Text, **kwargs):
super().__init__(**kwargs)
Expand Down
14 changes: 11 additions & 3 deletions vanilla_sideload/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,13 @@ def callback(result: Any, error: Optional[Exception]) -> None:
self.bin_main.set_child(view_loading)

def __build_install_ui(self) -> None:
view_install = SideloaderInstall(self, self.__pkg)
view_install.connect("done", self.__on_install_done)
self.bin_main.set_child(view_install)
self.view_install = SideloaderInstall(self, self.__pkg)
self.view_install.connect("done", self.__on_install_done)
self.bin_main.set_child(self.view_install)

def __on_install_done(self, view_install: SideloaderInstall, *args: Any) -> None:
view_install_done = SideloaderInstallDone(self.__pkg.name)
view_install_done.btn_logs.connect("clicked", self.__on_view_logs)
self.bin_main.set_child(view_install_done)

def __build_uninstall_ui(self) -> None:
Expand All @@ -114,3 +115,10 @@ def __read_package_info(self) -> None:

def __read_installed_package_info(self) -> None:
raise NotImplementedError("Not implemented yet")

def __on_view_logs(self, *args):
self.view_install.btn_console.set_visible(False)
self.view_install.progress_bar.set_visible(False)
self.view_install.btn_quit.set_visible(True)
self.view_install.box_console_main.show()
self.bin_main.set_child(self.view_install)

0 comments on commit f687c2b

Please sign in to comment.