From a0be0475c564c90edb5b637e47071dfaaebc5987 Mon Sep 17 00:00:00 2001 From: Brandon Lewis Date: Thu, 22 Jul 2010 17:58:00 +0200 Subject: [PATCH] use file-chooser dialog when adding files --- tests/examples/ges-ui.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/examples/ges-ui.c b/tests/examples/ges-ui.c index a3637badd7..bd1f10c123 100644 --- a/tests/examples/ges-ui.c +++ b/tests/examples/ges-ui.c @@ -127,10 +127,23 @@ delete_activate_cb (GtkAction * item, App * app) void add_file_activate_cb (GtkAction * item, App * app) { + GtkFileChooserDialog *dlg; + GST_DEBUG ("add file signal handler"); - /* TODO: solicit this information from the user */ - app_add_file (app, (gchar *) "/home/brandon/media/small-mvi_0008.avi"); + dlg = (GtkFileChooserDialog *) gtk_file_chooser_dialog_new ("Add File...", + GTK_WINDOW (app->main_window), + GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, + GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); + + if (gtk_dialog_run ((GtkDialog *) dlg) == GTK_RESPONSE_OK) { + gchar *filename; + filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dlg)); + app_add_file (app, filename); + g_free (filename); + } + gtk_widget_destroy ((GtkWidget *) dlg); } void