diff --git a/src/sysprof/sysprof-window.c b/src/sysprof/sysprof-window.c index b4c7a276..9440fde4 100644 --- a/src/sysprof/sysprof-window.c +++ b/src/sysprof/sysprof-window.c @@ -23,6 +23,7 @@ #include "config.h" #include +#include #include #include "sysprof-window.h" @@ -31,6 +32,8 @@ struct _SysprofWindow { GtkApplicationWindow parent_instance; + DzlBindingGroup *bindings; + SysprofNotebook *notebook; GtkMenuButton *menu_button; }; @@ -134,6 +137,11 @@ save_capture_cb (GSimpleAction *action, static void sysprof_window_finalize (GObject *object) { + SysprofWindow *self = (SysprofWindow *)object; + + dzl_binding_group_set_source (self->bindings, NULL); + g_clear_object (&self->bindings); + G_OBJECT_CLASS (sysprof_window_parent_class)->finalize (object); } @@ -177,6 +185,11 @@ sysprof_window_init (SysprofWindow *self) self, G_CONNECT_SWAPPED); + self->bindings = dzl_binding_group_new (); + dzl_binding_group_bind (self->bindings, "title", self, "title", G_BINDING_SYNC_CREATE); + g_object_bind_property (self->notebook, "current", self->bindings, "source", + G_BINDING_SYNC_CREATE); + dzl_gtk_widget_action_set (GTK_WIDGET (self), "win", "save-capture", "enabled", FALSE, NULL); diff --git a/src/sysprof/ui/sysprof-window.ui b/src/sysprof/ui/sysprof-window.ui index 63110d2a..a1c8b7b8 100644 --- a/src/sysprof/ui/sysprof-window.ui +++ b/src/sysprof/ui/sysprof-window.ui @@ -24,35 +24,6 @@ end - - - vertical - true - - - true - Sysprof - - - - - - - - - true - Not running - start - - - - - - - - 12