[gnome-calendar] source-dialog: open file when response is ok



commit de921ff54b9fd6af7e1c80acfecaf9e9c5683f49
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Jun 1 11:59:22 2016 -0300

    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 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/gcal-source-dialog.c b/src/gcal-source-dialog.c
index 91f08c6..b05d299 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);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]