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.
This commit is contained in:
Georges Basile Stavracas Neto
2016-06-01 11:59:22 -03:00
parent 9b358eb0ba
commit de921ff54b
+5 -1
View File
@@ -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);
}