[gnome-builder/wip/chergert/glade3: 2/4] create-project: update path when changing destination directory



commit 220b0b56107c8e197c83ce55a008ee3144dcf0a2
Author: Christian Hergert <chergert redhat com>
Date:   Fri Oct 19 11:58:42 2018 -0700

    create-project: update path when changing destination directory
    
    This is essentially the same bug as #667.
    
    Fixes #675

 src/plugins/create-project/gbp-create-project-widget.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
---
diff --git a/src/plugins/create-project/gbp-create-project-widget.c 
b/src/plugins/create-project/gbp-create-project-widget.c
index 2ae617991..3687cf09a 100644
--- a/src/plugins/create-project/gbp-create-project-widget.c
+++ b/src/plugins/create-project/gbp-create-project-widget.c
@@ -203,6 +203,18 @@ gbp_create_project_widget_name_changed (GbpCreateProjectWidget *self,
   g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_IS_READY]);
 }
 
+static void
+gbp_create_project_widget_location_changed (GbpCreateProjectWidget *self,
+                                            GParamSpec             *pspec,
+                                            DzlFileChooserEntry    *chooser)
+{
+  g_assert (GBP_IS_CREATE_PROJECT_WIDGET (self));
+  g_assert (DZL_IS_FILE_CHOOSER_ENTRY (chooser));
+
+  /* Piggyback on the name changed signal to update things */
+  gbp_create_project_widget_name_changed (self, self->project_name_entry);
+}
+
 static void
 update_language_sensitivity (GtkWidget *widget,
                              gpointer   data)
@@ -489,6 +501,12 @@ gbp_create_project_widget_init (GbpCreateProjectWidget *self)
                            self,
                            G_CONNECT_SWAPPED);
 
+  g_signal_connect_object (self->project_location_entry,
+                           "notify::file",
+                           G_CALLBACK (gbp_create_project_widget_location_changed),
+                           self,
+                           G_CONNECT_SWAPPED);
+
   g_signal_connect_object (self->project_language_chooser,
                            "changed",
                            G_CALLBACK (gbp_create_project_widget_language_changed),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]