[gnome-builder] greeter: use context handler to setup state
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] greeter: use context handler to setup state
- Date: Wed, 10 Apr 2019 07:36:41 +0000 (UTC)
commit 03257a8a489fd979cdb6d8bd97f6f9fc4d02c75e
Author: Christian Hergert <chergert redhat com>
Date: Wed Apr 10 00:22:36 2019 -0700
greeter: use context handler to setup state
We need access to the context for cloners, so ensure we use the
handler to create cloners.
src/libide/greeter/ide-clone-surface.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/libide/greeter/ide-clone-surface.c b/src/libide/greeter/ide-clone-surface.c
index 6e378bc99..23a61a5b9 100644
--- a/src/libide/greeter/ide-clone-surface.c
+++ b/src/libide/greeter/ide-clone-surface.c
@@ -307,20 +307,26 @@ ide_clone_surface_destroy (GtkWidget *widget)
}
static void
-ide_clone_surface_constructed (GObject *object)
+ide_clone_surface_context_set (GtkWidget *widget,
+ IdeContext *context)
{
- IdeCloneSurface *self = (IdeCloneSurface *)object;
+ IdeCloneSurface *self = (IdeCloneSurface *)widget;
g_autoptr(GFile) file = NULL;
- G_OBJECT_CLASS (ide_clone_surface_parent_class)->constructed (object);
+ g_assert (IDE_IS_CLONE_SURFACE (self));
+ g_assert (!context || IDE_IS_CONTEXT (context));
gtk_entry_set_text (self->author_entry, g_get_real_name ());
file = g_file_new_for_path (ide_get_projects_dir ());
dzl_file_chooser_entry_set_file (self->destination_chooser, file);
+ if (context == NULL)
+ return;
+
self->addins = peas_extension_set_new (peas_engine_get_default (),
IDE_TYPE_VCS_CLONER,
+ "parent", context,
NULL);
g_signal_connect (self->addins,
@@ -384,7 +390,6 @@ ide_clone_surface_class_init (IdeCloneSurfaceClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- object_class->constructed = ide_clone_surface_constructed;
object_class->get_property = ide_clone_surface_get_property;
object_class->set_property = ide_clone_surface_set_property;
@@ -432,6 +437,8 @@ static void
ide_clone_surface_init (IdeCloneSurface *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
+
+ ide_widget_set_context_handler (self, ide_clone_surface_context_set);
}
const gchar *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]