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:
Christian Hergert
2020-02-18 19:17:38 -08:00
parent 059508d582
commit d525f065f4
4 changed files with 37 additions and 0 deletions

View File

@ -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);
}