Commit 20a26408 authored by Christian Hergert's avatar Christian Hergert

buildlog: add clear and stop buttons for build log

This allows you to either stop the build (duplicate of the top bar) or
clear the build log from the build log panel. We might also consider adding
a save action here.

https://bugzilla.gnome.org/show_bug.cgi?id=779425
parent e0e7b37d
......@@ -704,9 +704,27 @@ ide_build_log_panel_class_init (IdeBuildLogPanelClass *klass)
g_object_class_install_properties (object_class, LAST_PROP, properties);
}
static void
ide_build_log_panel_clear_activate (GSimpleAction *action,
GVariant *param,
gpointer user_data)
{
IdeBuildLogPanel *self = user_data;
g_assert (G_IS_SIMPLE_ACTION (action));
g_assert (IDE_IS_BUILD_LOG_PANEL (self));
gtk_text_buffer_set_text (self->buffer, "", 0);
}
static void
ide_build_log_panel_init (IdeBuildLogPanel *self)
{
static GActionEntry entries[] = {
{ "clear", ide_build_log_panel_clear_activate },
};
g_autoptr(GSimpleActionGroup) actions = NULL;
self->css = gtk_css_provider_new ();
gtk_widget_init_template (GTK_WIDGET (self));
......@@ -722,4 +740,8 @@ ide_build_log_panel_init (IdeBuildLogPanel *self)
self,
G_CONNECT_SWAPPED);
ide_build_log_panel_changed_font_name (self, "font-name", self->settings);
actions = g_simple_action_group_new ();
g_action_map_add_action_entries (G_ACTION_MAP (actions), entries, G_N_ELEMENTS (entries), self);
gtk_widget_insert_action_group (GTK_WIDGET (self), "build-log", G_ACTION_GROUP (actions));
}
<interface>
<template class="IdeBuildLogPanel" parent="PnlDockWidget">
<child>
<object class="GtkScrolledWindow" id="scroller">
<property name="expand">true</property>
<object class="GtkBox">
<property name="orientation">horizontal</property>
<property name="visible">true</property>
<child>
<object class="GtkScrolledWindow" id="scroller">
<property name="expand">true</property>
<property name="visible">true</property>
</object>
</child>
<child>
<object class="GtkBox">
<property name="border-width">2</property>
<property name="hexpand">false</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<property name="vexpand">true</property>
<property name="visible">true</property>
<child>
<object class="GtkButton" id="clear_button">
<property name="action-name">build-log.clear</property>
<property name="expand">false</property>
<property name="tooltip-text" translatable="yes">Clear build log</property>
<property name="visible">true</property>
<style>
<class name="flat"/>
</style>
<child>
<object class="GtkImage">
<property name="icon-name">edit-clear-all-symbolic</property>
<property name="visible">true</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkButton" id="stop_button">
<property name="action-name">build-manager.cancel</property>
<property name="expand">false</property>
<property name="tooltip-text" translatable="yes">Cancel build</property>
<property name="visible">true</property>
<style>
<class name="flat"/>
</style>
<child>
<object class="GtkImage">
<property name="icon-name">process-stop-symbolic</property>
<property name="visible">true</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
......
......@@ -48,6 +48,7 @@ libide/buildsystem/ide-configuration-manager.c
libide/buildui/ide-build-configuration-row.ui
libide/buildui/ide-build-configuration-view.ui
libide/buildui/ide-build-log-panel.c
libide/buildui/ide-build-log-panel.ui
libide/buildui/ide-build-panel.c
libide/buildui/ide-build-panel.ui
libide/buildui/ide-build-perspective.c
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment