[gnome-builder] greeter: default to projects directory when opening



commit a641b33b204da8c9ce8ee9f41c27737547939962
Author: Christian Hergert <chergert redhat com>
Date:   Fri Mar 17 14:50:31 2017 -0700

    greeter: default to projects directory when opening
    
    If we are opening a project, we should place the user in the projects
    directory, which is the most likely place for their project to exist.

 libide/greeter/ide-greeter-perspective.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/libide/greeter/ide-greeter-perspective.c b/libide/greeter/ide-greeter-perspective.c
index 0d7c527..c868bdd 100644
--- a/libide/greeter/ide-greeter-perspective.c
+++ b/libide/greeter/ide-greeter-perspective.c
@@ -655,6 +655,8 @@ static void
 ide_greeter_perspective_open_clicked (IdeGreeterPerspective *self,
                                       GtkButton             *open_button)
 {
+  g_autoptr(GSettings) settings = NULL;
+  g_autofree gchar *projects_dir = NULL;
   GtkFileChooserDialog *dialog;
   GtkWidget *toplevel;
   PeasEngine *engine;
@@ -764,6 +766,10 @@ ide_greeter_perspective_open_clicked (IdeGreeterPerspective *self,
 
   gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), all_filter);
 
+  settings = g_settings_new ("org.gnome.builder");
+  projects_dir = g_settings_get_string (settings, "projects-directory");
+  gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), projects_dir);
+
   gtk_window_present (GTK_WINDOW (dialog));
 }
 


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