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 <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
15807434a4
commit
21718c4179
|
@ -1,4 +1,5 @@
|
||||||
6.4.19:
|
6.4.19:
|
||||||
|
- File chooser selects user's music directory
|
||||||
- Remove deleted tracks from artist playlists
|
- Remove deleted tracks from artist playlists
|
||||||
|
|
||||||
6.4.19-rc:
|
6.4.19-rc:
|
||||||
|
|
|
@ -23,6 +23,7 @@ void __collection_choose(GtkButton *button, gpointer data)
|
||||||
{
|
{
|
||||||
GtkFileFilter *filter;
|
GtkFileFilter *filter;
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
|
const gchar *path;
|
||||||
gint res;
|
gint res;
|
||||||
|
|
||||||
filter = gtk_file_filter_new();
|
filter = gtk_file_filter_new();
|
||||||
|
@ -36,6 +37,11 @@ void __collection_choose(GtkButton *button, gpointer data)
|
||||||
NULL);
|
NULL);
|
||||||
gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(dialog), filter);
|
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));
|
res = gtk_dialog_run(GTK_DIALOG(dialog));
|
||||||
if (res == GTK_RESPONSE_ACCEPT)
|
if (res == GTK_RESPONSE_ACCEPT)
|
||||||
__collection_add(GTK_FILE_CHOOSER(dialog));
|
__collection_add(GTK_FILE_CHOOSER(dialog));
|
||||||
|
|
Loading…
Reference in New Issue