mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-10 07:00:53 +00:00
memprofpage: use Adwaita and cleanup usage
This commit is contained in:
@ -67,6 +67,10 @@ typedef struct
|
|||||||
GtkLabel *leaked_allocs;
|
GtkLabel *leaked_allocs;
|
||||||
GtkLabel *peak_allocs;
|
GtkLabel *peak_allocs;
|
||||||
GtkListBox *by_size;
|
GtkListBox *by_size;
|
||||||
|
GtkWidget *callgraph;
|
||||||
|
GtkWidget *summary_page;
|
||||||
|
GtkWidget *loading_state;
|
||||||
|
GtkWidget *empty_state;
|
||||||
|
|
||||||
GCancellable *cancellable;
|
GCancellable *cancellable;
|
||||||
|
|
||||||
@ -307,7 +311,7 @@ sysprof_memprof_page_load (SysprofMemprofPage *self,
|
|||||||
|
|
||||||
if (sysprof_memprof_profile_is_empty (profile))
|
if (sysprof_memprof_profile_is_empty (profile))
|
||||||
{
|
{
|
||||||
gtk_stack_set_visible_child_name (priv->stack, "summary");
|
gtk_stack_set_visible_child (priv->stack, priv->summary_page);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,7 +346,7 @@ sysprof_memprof_page_load (SysprofMemprofPage *self,
|
|||||||
gtk_tree_selection_select_iter (selection, &iter);
|
gtk_tree_selection_select_iter (selection, &iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_stack_set_visible_child_name (priv->stack, "callgraph");
|
gtk_stack_set_visible_child (priv->stack, priv->callgraph);
|
||||||
|
|
||||||
g_clear_object (&functions);
|
g_clear_object (&functions);
|
||||||
}
|
}
|
||||||
@ -354,7 +358,7 @@ _sysprof_memprof_page_set_failed (SysprofMemprofPage *self)
|
|||||||
|
|
||||||
g_return_if_fail (SYSPROF_IS_MEMPROF_PAGE (self));
|
g_return_if_fail (SYSPROF_IS_MEMPROF_PAGE (self));
|
||||||
|
|
||||||
gtk_stack_set_visible_child_name (priv->stack, "empty-state");
|
gtk_stack_set_visible_child (priv->stack, priv->empty_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -373,7 +377,7 @@ sysprof_memprof_page_unload (SysprofMemprofPage *self)
|
|||||||
gtk_tree_view_set_model (priv->functions_view, NULL);
|
gtk_tree_view_set_model (priv->functions_view, NULL);
|
||||||
gtk_tree_view_set_model (priv->descendants_view, NULL);
|
gtk_tree_view_set_model (priv->descendants_view, NULL);
|
||||||
|
|
||||||
gtk_stack_set_visible_child_name (priv->stack, "empty-state");
|
gtk_stack_set_visible_child (priv->stack, priv->empty_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -971,7 +975,7 @@ sysprof_memprof_page_load_async (SysprofPage *page,
|
|||||||
else
|
else
|
||||||
g_set_object (&priv->cancellable, cancellable);
|
g_set_object (&priv->cancellable, cancellable);
|
||||||
|
|
||||||
gtk_stack_set_visible_child_name (priv->stack, "loading");
|
gtk_stack_set_visible_child (priv->stack, priv->loading_state);
|
||||||
|
|
||||||
task = g_task_new (self, cancellable, callback, user_data);
|
task = g_task_new (self, cancellable, callback, user_data);
|
||||||
g_task_set_source_tag (task, sysprof_memprof_page_load_async);
|
g_task_set_source_tag (task, sysprof_memprof_page_load_async);
|
||||||
@ -1149,6 +1153,10 @@ sysprof_memprof_page_class_init (SysprofMemprofPageClass *klass)
|
|||||||
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, leaked_allocs);
|
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, leaked_allocs);
|
||||||
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, leaked_allocs_button);
|
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, leaked_allocs_button);
|
||||||
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, peak_allocs);
|
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, peak_allocs);
|
||||||
|
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, loading_state);
|
||||||
|
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, empty_state);
|
||||||
|
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, summary_page);
|
||||||
|
gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, callgraph);
|
||||||
|
|
||||||
gtk_widget_class_install_action (widget_class, "page.copy", NULL, sysprof_memprof_page_copy_cb);
|
gtk_widget_class_install_action (widget_class, "page.copy", NULL, sysprof_memprof_page_copy_cb);
|
||||||
|
|
||||||
@ -1170,7 +1178,7 @@ sysprof_memprof_page_init (SysprofMemprofPage *self)
|
|||||||
|
|
||||||
gtk_widget_init_template (GTK_WIDGET (self));
|
gtk_widget_init_template (GTK_WIDGET (self));
|
||||||
|
|
||||||
gtk_stack_set_visible_child_name (priv->stack, "empty-state");
|
gtk_stack_set_visible_child (priv->stack, priv->empty_state);
|
||||||
|
|
||||||
gtk_list_box_set_header_func (priv->by_size, sep_header_func, NULL, NULL);
|
gtk_list_box_set_header_func (priv->by_size, sep_header_func, NULL, NULL);
|
||||||
|
|
||||||
@ -1530,7 +1538,7 @@ _sysprof_memprof_page_set_loading (SysprofMemprofPage *self,
|
|||||||
priv->loading--;
|
priv->loading--;
|
||||||
|
|
||||||
if (priv->loading)
|
if (priv->loading)
|
||||||
gtk_stack_set_visible_child_name (priv->stack, "loading");
|
gtk_stack_set_visible_child (priv->stack, priv->loading_state);
|
||||||
else
|
else
|
||||||
gtk_stack_set_visible_child_name (priv->stack, "callgraph");
|
gtk_stack_set_visible_child (priv->stack, priv->callgraph);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<interface>
|
<interface>
|
||||||
<template class="SysprofMemprofPage" parent="SysprofPage">
|
<template class="SysprofMemprofPage" parent="SysprofPage">
|
||||||
<child>
|
<child>
|
||||||
@ -67,7 +68,7 @@
|
|||||||
<object class="GtkStack" id="stack">
|
<object class="GtkStack" id="stack">
|
||||||
<property name="visible">true</property>
|
<property name="visible">true</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkScrolledWindow">
|
<object class="GtkScrolledWindow" id="summary_page">
|
||||||
<property name="hscrollbar-policy">never</property>
|
<property name="hscrollbar-policy">never</property>
|
||||||
<property name="visible">true</property>
|
<property name="visible">true</property>
|
||||||
<child>
|
<child>
|
||||||
@ -79,7 +80,7 @@
|
|||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<property name="visible">true</property>
|
<property name="visible">true</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="DzlThreeGrid">
|
<object class="EggThreeGrid">
|
||||||
<property name="expand">true</property>
|
<property name="expand">true</property>
|
||||||
<property name="row-spacing">6</property>
|
<property name="row-spacing">6</property>
|
||||||
<property name="column-spacing">18</property>
|
<property name="column-spacing">18</property>
|
||||||
@ -92,22 +93,22 @@
|
|||||||
<style>
|
<style>
|
||||||
<class name="dim-label"/>
|
<class name="dim-label"/>
|
||||||
</style>
|
</style>
|
||||||
|
<layout>
|
||||||
|
<property name="column">left</property>
|
||||||
|
<property name="row">0</property>
|
||||||
|
</layout>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="column">left</property>
|
|
||||||
<property name="row">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="peak_allocs">
|
<object class="GtkLabel" id="peak_allocs">
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
<property name="selectable">true</property>
|
<property name="selectable">true</property>
|
||||||
<property name="visible">false</property>
|
<property name="visible">false</property>
|
||||||
|
<layout>
|
||||||
|
<property name="column">center</property>
|
||||||
|
<property name="row">0</property>
|
||||||
|
</layout>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="column">center</property>
|
|
||||||
<property name="row">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel">
|
<object class="GtkLabel">
|
||||||
@ -117,22 +118,22 @@
|
|||||||
<style>
|
<style>
|
||||||
<class name="dim-label"/>
|
<class name="dim-label"/>
|
||||||
</style>
|
</style>
|
||||||
|
<layout>
|
||||||
|
<property name="column">left</property>
|
||||||
|
<property name="row">1</property>
|
||||||
|
</layout>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="column">left</property>
|
|
||||||
<property name="row">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="num_allocs">
|
<object class="GtkLabel" id="num_allocs">
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
<property name="selectable">true</property>
|
<property name="selectable">true</property>
|
||||||
<property name="visible">true</property>
|
<property name="visible">true</property>
|
||||||
|
<layout>
|
||||||
|
<property name="column">center</property>
|
||||||
|
<property name="row">1</property>
|
||||||
|
</layout>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="column">center</property>
|
|
||||||
<property name="row">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel">
|
<object class="GtkLabel">
|
||||||
@ -142,22 +143,22 @@
|
|||||||
<style>
|
<style>
|
||||||
<class name="dim-label"/>
|
<class name="dim-label"/>
|
||||||
</style>
|
</style>
|
||||||
|
<layout>
|
||||||
|
<property name="column">left</property>
|
||||||
|
<property name="row">2</property>
|
||||||
|
</layout>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="column">left</property>
|
|
||||||
<property name="row">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="leaked_allocs">
|
<object class="GtkLabel" id="leaked_allocs">
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
<property name="selectable">true</property>
|
<property name="selectable">true</property>
|
||||||
<property name="visible">false</property>
|
<property name="visible">false</property>
|
||||||
|
<layout>
|
||||||
|
<property name="column">center</property>
|
||||||
|
<property name="row">2</property>
|
||||||
|
</layout>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="column">center</property>
|
|
||||||
<property name="row">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel">
|
<object class="GtkLabel">
|
||||||
@ -167,11 +168,11 @@
|
|||||||
<style>
|
<style>
|
||||||
<class name="dim-label"/>
|
<class name="dim-label"/>
|
||||||
</style>
|
</style>
|
||||||
|
<layout>
|
||||||
|
<property name="column">left</property>
|
||||||
|
<property name="row">3</property>
|
||||||
|
</layout>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="column">left</property>
|
|
||||||
<property name="row">3</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="temp_allocs_count">
|
<object class="GtkLabel" id="temp_allocs_count">
|
||||||
@ -179,11 +180,11 @@
|
|||||||
<property name="selectable">true</property>
|
<property name="selectable">true</property>
|
||||||
<property name="width-chars">50</property>
|
<property name="width-chars">50</property>
|
||||||
<property name="visible">true</property>
|
<property name="visible">true</property>
|
||||||
|
<layout>
|
||||||
|
<property name="column">center</property>
|
||||||
|
<property name="row">3</property>
|
||||||
|
</layout>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="column">center</property>
|
|
||||||
<property name="row">3</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel">
|
<object class="GtkLabel">
|
||||||
@ -194,11 +195,11 @@
|
|||||||
<style>
|
<style>
|
||||||
<class name="dim-label"/>
|
<class name="dim-label"/>
|
||||||
</style>
|
</style>
|
||||||
|
<layout>
|
||||||
|
<property name="column">left</property>
|
||||||
|
<property name="row">4</property>
|
||||||
|
</layout>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="column">left</property>
|
|
||||||
<property name="row">4</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkFrame">
|
<object class="GtkFrame">
|
||||||
@ -208,23 +209,20 @@
|
|||||||
<property name="visible">true</property>
|
<property name="visible">true</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
<layout>
|
||||||
|
<property name="column">center</property>
|
||||||
|
<property name="row">4</property>
|
||||||
|
</layout>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="column">center</property>
|
|
||||||
<property name="row">4</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="name">summary</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkPaned">
|
<object class="GtkPaned" id="callgraph">
|
||||||
<property name="orientation">horizontal</property>
|
<property name="orientation">horizontal</property>
|
||||||
<property name="position">450</property>
|
<property name="position">450</property>
|
||||||
<property name="expand">true</property>
|
<property name="expand">true</property>
|
||||||
@ -424,31 +422,20 @@
|
|||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="name">callgraph</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="DzlEmptyState">
|
<object class="AdwStatusPage" id="loading_state">
|
||||||
<property name="icon-name">content-loading-symbolic</property>
|
<property name="icon-name">content-loading-symbolic</property>
|
||||||
<property name="title" translatable="yes">Analyzing Memory Allocations</property>
|
<property name="title" translatable="yes">Analyzing Memory Allocations</property>
|
||||||
<property name="subtitle" translatable="yes">Sysprof is busy analyzing memory allocations.</property>
|
<property name="description" translatable="yes">Sysprof is busy analyzing memory allocations.</property>
|
||||||
<property name="visible">true</property>
|
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="name">loading</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="DzlEmptyState">
|
<object class="AdwStatusPage" id="empty_state">
|
||||||
<property name="icon-name">computer-fail-symbolic</property>
|
<property name="icon-name">computer-fail-symbolic</property>
|
||||||
<property name="title" translatable="yes">Not Enough Samples</property>
|
<property name="title" translatable="yes">Not Enough Samples</property>
|
||||||
<property name="subtitle" translatable="yes">More samples are necessary to display a callgraph.</property>
|
<property name="description" translatable="yes">More samples are necessary to display a callgraph.</property>
|
||||||
<property name="visible">false</property>
|
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="name">empty-state</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|||||||
Reference in New Issue
Block a user