Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/view/action_page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -32,6 +33,8 @@ mod imp {
pub(super) status_page: TemplateChild<adw::StatusPage>,
#[template_child]
pub(super) view_artifact_button: TemplateChild<gtk::Button>,
#[template_child]
pub(super) output_box: TemplateChild<adw::Clamp>,
}

#[glib::object_subclass]
Expand All @@ -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();
});
Expand Down Expand Up @@ -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) => {
Expand Down
22 changes: 21 additions & 1 deletion src/view/action_page.ui
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<property name="mode">horizontal</property>
<widgets>
<widget name="abort_button"/>
<widget name="view_output_button"/>
<widget name="view_artifact_button"/>
</widgets>
</object>
Expand Down Expand Up @@ -40,10 +41,14 @@
<child>
<object class="AdwClamp">
<property name="margin-bottom">9</property>
<property name="orientation">vertical</property>

<child>
<object class="AdwClamp">
<object class="AdwClamp" id="output_box">
<property name="orientation">vertical</property>
<property name="height-request">220</property>
<property name="visible">False</property>


<property name="child">
<object class="AdwBin">
Expand Down Expand Up @@ -92,6 +97,21 @@
</object>
</child>

<child>
<object class="GtkButton" id="view_output_button">
<style>
<class name="pill"/>
</style>
<property name="action-name">action-page.view-output</property>
<property name="halign">center</property>
<property name="label" translatable="yes">_View Output</property>
<property name="use-underline">True</property>
<property name="visible" bind-source="view_output_button" bind-property="sensitive" bind-flags="sync-create"/>
<property name="width-request">200</property>
<property name="visible">True</property>
</object>
</child>

<child>
<object class="GtkButton" id="abort_button">
<style>
Expand Down
Loading