diff --git a/gui/collection.c b/gui/collection.c index 942485a9..d6f5dda4 100644 --- a/gui/collection.c +++ b/gui/collection.c @@ -10,6 +10,7 @@ #include #include #include +#include enum collection_sidebar_columns { C_SB_IMAGE, @@ -155,6 +156,31 @@ void __collection_add(GtkButton *button, GtkFileChooser *chooser) g_free(filename); } +void __collection_choose(GtkButton *button, gpointer data) +{ + GtkFileFilter *filter; + GtkWidget *dialog; + gint res; + + filter = gtk_file_filter_new(); + gtk_file_filter_add_mime_type(filter, "inode/directory"); + + dialog = gtk_file_chooser_dialog_new("Chooser a Path", + GTK_WINDOW(gui_builder_widget("o_window")), + GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, + _("_Cancel"), GTK_RESPONSE_CANCEL, + _("_Open"), GTK_RESPONSE_ACCEPT, + NULL); + gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(dialog), filter); + + res = gtk_dialog_run(GTK_DIALOG(dialog)); + if (res == GTK_RESPONSE_ACCEPT) + __collection_add(button, GTK_FILE_CHOOSER(dialog)); + + gtk_widget_destroy(dialog); + g_object_unref(filter); +} + void __collection_selection_changed(GtkTreeSelection *selection, GtkFileChooser *chooser) { diff --git a/share/ocarina/ocarina6.glade b/share/ocarina/ocarina6.glade index a8ba14b3..8d196964 100644 --- a/share/ocarina/ocarina6.glade +++ b/share/ocarina/ocarina6.glade @@ -215,6 +215,11 @@ + + True + False + folder-new + True False @@ -322,8 +327,8 @@ media-skip-backward - + False @@ -357,8 +362,8 @@ 5 - + False @@ -391,8 +396,8 @@ 5 - + False @@ -425,8 +430,8 @@ media-skip-forward - + False @@ -825,6 +830,7 @@ 2 3 vertical + 5 True @@ -842,7 +848,7 @@ True - + True False emblem-favorite @@ -864,7 +870,7 @@ Hide this track from the Collection - + True False window-close @@ -890,6 +896,7 @@ True 5 5 + 1 in @@ -1048,6 +1055,22 @@ 1 + + + Add Library Path + True + True + True + image3 + True + + + + False + True + 2 + + False