[sysprof] Add Open button



commit 88df2711e3bbdefe95de37f13ffd4584d442f458
Author: p3732 <p3732 users noreply github com>
Date:   Thu Jul 2 00:37:44 2020 +0200

    Add Open button
    
    Add a button to open capture files in headerbar. This caters to the
    suggested usage of 'sysprof-cli' by exposing the funcitonality in a
    prominent place.

 src/sysprof/sysprof-window.c     |  2 ++
 src/sysprof/ui/sysprof-window.ui | 11 +++++++++++
 2 files changed, 13 insertions(+)
---
diff --git a/src/sysprof/sysprof-window.c b/src/sysprof/sysprof-window.c
index bbf90d5..7b59ff6 100644
--- a/src/sysprof/sysprof-window.c
+++ b/src/sysprof/sysprof-window.c
@@ -34,6 +34,7 @@ struct _SysprofWindow
   DzlBindingGroup      *bindings;
 
   SysprofNotebook      *notebook;
+  GtkButton            *open_button;
   GtkMenuButton        *menu_button;
 };
 
@@ -190,6 +191,7 @@ sysprof_window_class_init (SysprofWindowClass *klass)
 
   gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/ui/sysprof-window.ui");
   gtk_widget_class_bind_template_child (widget_class, SysprofWindow, menu_button);
+  gtk_widget_class_bind_template_child (widget_class, SysprofWindow, open_button);
   gtk_widget_class_bind_template_child (widget_class, SysprofWindow, notebook);
 
   g_type_ensure (SYSPROF_TYPE_NOTEBOOK);
diff --git a/src/sysprof/ui/sysprof-window.ui b/src/sysprof/ui/sysprof-window.ui
index f6d891c..87158fe 100644
--- a/src/sysprof/ui/sysprof-window.ui
+++ b/src/sysprof/ui/sysprof-window.ui
@@ -24,6 +24,17 @@
             <property name="pack-type">end</property>
           </packing>
         </child>
+        <child>
+          <object class="GtkButton" id="open_button">
+            <property name="label" translatable="yes">_Open</property>
+            <property name="action_name">app.open-capture</property>
+            <property name="use_underline">true</property>
+            <property name="visible">true</property>
+          </object>
+          <packing>
+            <property name="pack-type">start</property>
+          </packing>
+        </child>
         <child>
           <object class="GtkLabel" id="stat_label">
             <property name="margin-end">12</property>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]