From 21718c41799cfc582acabdc7a0e0c83861079659 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Tue, 30 Aug 2016 07:47:07 -0400 Subject: [PATCH] gui/collection: Select user's music directory when creating file chooser Most users will have their music in their ~/Music directory, so it makes sense to select this path by default. Signed-off-by: Anna Schumaker --- CHANGELOG | 1 + gui/collection.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 8995f7ac..cf833e8f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,5 @@ 6.4.19: +- File chooser selects user's music directory - Remove deleted tracks from artist playlists 6.4.19-rc: diff --git a/gui/collection.c b/gui/collection.c index 79451961..dfecbed4 100644 --- a/gui/collection.c +++ b/gui/collection.c @@ -23,6 +23,7 @@ void __collection_choose(GtkButton *button, gpointer data) { GtkFileFilter *filter; GtkWidget *dialog; + const gchar *path; gint res; filter = gtk_file_filter_new(); @@ -36,6 +37,11 @@ void __collection_choose(GtkButton *button, gpointer data) NULL); gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(dialog), filter); + path = g_get_user_special_dir(G_USER_DIRECTORY_MUSIC); + if (path) + gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), + path); + res = gtk_dialog_run(GTK_DIALOG(dialog)); if (res == GTK_RESPONSE_ACCEPT) __collection_add(GTK_FILE_CHOOSER(dialog));