From de921ff54b9fd6af7e1c80acfecaf9e9c5683f49 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Wed, 1 Jun 2016 11:59:22 -0300 Subject: [PATCH] source-dialog: open file when response is ok The source dialog currently skips the file selected by pressing the Open button. Fix that by also considering the response of the dialog. --- src/gcal-source-dialog.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gcal-source-dialog.c b/src/gcal-source-dialog.c index 91f08c6d..b05d2996 100644 --- a/src/gcal-source-dialog.c +++ b/src/gcal-source-dialog.c @@ -1105,6 +1105,7 @@ on_file_activated (GSimpleAction *action, { GtkWidget *dialog; GtkFileFilter *filter; + gint response; // Dialog dialog = gtk_file_chooser_dialog_new (_("Select a calendar file"), @@ -1123,7 +1124,10 @@ on_file_activated (GSimpleAction *action, gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); - gtk_dialog_run (GTK_DIALOG (dialog)); + response = gtk_dialog_run (GTK_DIALOG (dialog)); + + if (response == GTK_RESPONSE_OK) + calendar_file_selected (GTK_FILE_CHOOSER (dialog), user_data); gtk_widget_destroy (dialog); }