diff --git a/src/view/action_page.rs b/src/view/action_page.rs index dc4e71e5..8c7d850d 100644 --- a/src/view/action_page.rs +++ b/src/view/action_page.rs @@ -14,6 +14,7 @@ use crate::utils; use crate::view; const ACTION_CANCEL: &str = "action-page.cancel"; +const ACTION_VIEW_OUTPUT: &str = "action-page.view-output"; const ACTION_VIEW_ARTIFACT: &str = "action-page.view-artifact"; const ACTION_RETRY: &str = "action-page.retry"; @@ -32,6 +33,8 @@ mod imp { pub(super) status_page: TemplateChild, #[template_child] pub(super) view_artifact_button: TemplateChild, + #[template_child] + pub(super) output_box: TemplateChild, } #[glib::object_subclass] @@ -43,6 +46,9 @@ mod imp { fn class_init(klass: &mut Self::Class) { klass.bind_template(); klass.install_action(ACTION_CANCEL, None, |widget, _, _| widget.cancel()); + klass.install_action(ACTION_VIEW_OUTPUT, None, |widget, _, _| { + widget.view_output() + }); klass.install_action(ACTION_VIEW_ARTIFACT, None, |widget, _, _| { widget.view_artifact(); }); @@ -289,6 +295,14 @@ impl ActionPage { } } + fn view_output(&self) { + let imp = self.imp(); + imp.status_page.set_icon_name(None); + imp.status_page.set_description(None); + imp.output_box.set_visible(true); + self.action_set_enabled(ACTION_VIEW_OUTPUT, false); + } + fn view_artifact(&self) { match self.action().as_ref().and_then(model::Action::artifact) { Some(artifact) => { diff --git a/src/view/action_page.ui b/src/view/action_page.ui index c58cc6d1..919a5263 100644 --- a/src/view/action_page.ui +++ b/src/view/action_page.ui @@ -5,6 +5,7 @@ horizontal + @@ -40,10 +41,14 @@ 9 + vertical - + vertical + 220 + False + @@ -92,6 +97,21 @@ + + + + action-page.view-output + center + _View Output + True + + 200 + True + + +