[gnome-calendar] source-dialog: revalidates on entry activation



commit 5d6fe1b7f4d3622543350f582a4ace9ba7cb57be
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Apr 20 17:39:01 2015 -0300

    source-dialog: revalidates on entry activation

 data/ui/source-dialog.ui |    1 +
 src/gcal-source-dialog.c |   10 ++++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/data/ui/source-dialog.ui b/data/ui/source-dialog.ui
index 8c88fee..0501aab 100644
--- a/data/ui/source-dialog.ui
+++ b/data/ui/source-dialog.ui
@@ -688,6 +688,7 @@
                         <property name="can_focus">True</property>
                         <property name="hexpand">True</property>
                         <signal name="notify::text" handler="url_entry_text_changed" 
object="GcalSourceDialog" swapped="no"/>
+                        <signal name="activate" handler="calendar_address_activated" 
object="GcalSourceDialog" swapped="no"/>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
diff --git a/src/gcal-source-dialog.c b/src/gcal-source-dialog.c
index 1ed8e4b..c31c921 100644
--- a/src/gcal-source-dialog.c
+++ b/src/gcal-source-dialog.c
@@ -1112,6 +1112,15 @@ on_web_activated (GSimpleAction *action,
   gcal_source_dialog_set_mode (GCAL_SOURCE_DIALOG (user_data), GCAL_SOURCE_DIALOG_MODE_CREATE_WEB);
 }
 
+static void
+calendar_address_activated (GtkEntry *entry,
+                            gpointer  user_data)
+{
+  g_assert (GCAL_IS_SOURCE_DIALOG (user_data));
+
+  validate_url_cb (GCAL_SOURCE_DIALOG (user_data));
+}
+
 /**
  * validate_url_cb:
  *
@@ -1811,6 +1820,7 @@ gcal_source_dialog_class_init (GcalSourceDialogClass *klass)
   gtk_widget_class_bind_template_callback (widget_class, add_button_clicked);
   gtk_widget_class_bind_template_callback (widget_class, action_widget_activated);
   gtk_widget_class_bind_template_callback (widget_class, back_button_clicked);
+  gtk_widget_class_bind_template_callback (widget_class, calendar_address_activated);
   gtk_widget_class_bind_template_callback (widget_class, calendar_file_selected);
   gtk_widget_class_bind_template_callback (widget_class, calendar_listbox_row_activated);
   gtk_widget_class_bind_template_callback (widget_class, calendar_visible_check_toggled);


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