mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-ui: add API to reload pages
This can be useful when the page is interactive and needs to reload.
This commit is contained in:
@ -1225,3 +1225,23 @@ sysprof_display_save (SysprofDisplay *self)
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_TITLE]);
|
||||
gtk_native_dialog_destroy (GTK_NATIVE_DIALOG (native));
|
||||
}
|
||||
|
||||
void
|
||||
_sysprof_display_reload_page (SysprofDisplay *self,
|
||||
SysprofPage *page)
|
||||
{
|
||||
SysprofDisplayPrivate *priv = sysprof_display_get_instance_private (self);
|
||||
SysprofSelection *selection;
|
||||
|
||||
g_return_if_fail (SYSPROF_IS_DISPLAY (self));
|
||||
g_return_if_fail (SYSPROF_IS_PAGE (page));
|
||||
g_return_if_fail (priv->reader != NULL);
|
||||
|
||||
selection = sysprof_visualizers_frame_get_selection (priv->visualizers);
|
||||
|
||||
sysprof_page_load_async (page,
|
||||
priv->reader,
|
||||
selection,
|
||||
priv->filter,
|
||||
NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
@ -22,7 +22,9 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "sysprof-display.h"
|
||||
#include "sysprof-page.h"
|
||||
#include "sysprof-ui-private.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@ -233,3 +235,14 @@ sysprof_page_set_hadjustment (SysprofPage *self,
|
||||
if (SYSPROF_PAGE_GET_CLASS (self)->set_hadjustment)
|
||||
SYSPROF_PAGE_GET_CLASS (self)->set_hadjustment (self, hadjustment);
|
||||
}
|
||||
|
||||
void
|
||||
sysprof_page_reload (SysprofPage *self)
|
||||
{
|
||||
GtkWidget *display;
|
||||
|
||||
g_return_if_fail (SYSPROF_IS_PAGE (self));
|
||||
|
||||
if ((display = gtk_widget_get_ancestor (GTK_WIDGET (self), SYSPROF_TYPE_DISPLAY)))
|
||||
_sysprof_display_reload_page (SYSPROF_DISPLAY (display), self);
|
||||
}
|
||||
|
||||
@ -71,6 +71,8 @@ SYSPROF_AVAILABLE_IN_ALL
|
||||
gboolean sysprof_page_load_finish (SysprofPage *self,
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
SYSPROF_AVAILABLE_IN_3_36
|
||||
void sysprof_page_reload (SysprofPage *self);
|
||||
SYSPROF_AVAILABLE_IN_ALL
|
||||
const gchar *sysprof_page_get_title (SysprofPage *self);
|
||||
SYSPROF_AVAILABLE_IN_ALL
|
||||
|
||||
@ -33,6 +33,8 @@ void _sysprof_memory_page_set_failed (SysprofCallgraphPage *self)
|
||||
void _sysprof_memory_page_set_loading (SysprofCallgraphPage *self,
|
||||
gboolean loading);
|
||||
void _sysprof_display_focus_record (SysprofDisplay *self);
|
||||
void _sysprof_display_reload_page (SysprofDisplay *self,
|
||||
SysprofPage *page);
|
||||
void _sysprof_profiler_assistant_focus_record (SysprofProfilerAssistant *self);
|
||||
gchar *_sysprof_format_duration (gint64 duration);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user