From f855eaea5867bc3bab86b4799be58245a14b3bf4 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Tue, 16 Aug 2016 13:38:58 -0400 Subject: [PATCH] gui/collection: Run FileChooserDialog on startup But only if the library database is empty. This patch also changes the prompt of the dialog to "Add Music" so users know what is going on. Fixes #80: Pop up FileChooserDialog the first time Ocarina is run Signed-off-by: Anna Schumaker --- gui/collection.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gui/collection.c b/gui/collection.c index ce16a4a0..79451961 100644 --- a/gui/collection.c +++ b/gui/collection.c @@ -28,7 +28,7 @@ void __collection_choose(GtkButton *button, gpointer data) filter = gtk_file_filter_new(); gtk_file_filter_add_mime_type(filter, "inode/directory"); - dialog = gtk_file_chooser_dialog_new("Chooser a Path", + dialog = gtk_file_chooser_dialog_new("Add Music", GTK_WINDOW(gui_builder_widget("o_window")), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, _("_Cancel"), GTK_RESPONSE_CANCEL, @@ -41,7 +41,6 @@ void __collection_choose(GtkButton *button, gpointer data) __collection_add(GTK_FILE_CHOOSER(dialog)); gtk_widget_destroy(dialog); - g_object_unref(filter); } bool __gui_collection_init_idle() @@ -51,6 +50,9 @@ bool __gui_collection_init_idle() db_for_each(library, next, library_db_get()) gui_playlist_add_library(LIBRARY(library)); + if (library_db_get()->db_size == 0) + __collection_choose(NULL, NULL); + return true; }