diff --git a/src/calls-new-call-box.c b/src/calls-new-call-box.c
index f7fda83..78228c4 100644
--- a/src/calls-new-call-box.c
+++ b/src/calls-new-call-box.c
@@ -103,6 +103,16 @@ get_origin (CallsNewCallBox *self,
}
+static void
+address_activate_cb (CallsNewCallBox *self)
+{
+ CallsOrigin *origin = get_selected_origin (self);
+ const char *address = gtk_entry_get_text (self->address_entry);
+
+ if (origin && address && *address != '\0')
+ calls_origin_dial (origin, address);
+}
+
static void
set_numeric (CallsNewCallBox *self,
gboolean enable)
@@ -130,6 +140,7 @@ notify_selected_index_cb (CallsNewCallBox *self)
}
+
static void
long_press_back_cb (CallsNewCallBox *self)
{
@@ -192,7 +203,7 @@ dial_result_clicked_cb (CallsNewCallBox *self)
CallsOrigin *origin = get_selected_origin (self);
const char *address = gtk_entry_get_text (self->address_entry);
- if (origin)
+ if (origin && address && *address != '\0')
calls_origin_dial (origin, address);
else
g_warning ("No suitable origin found. How was this even clicked?");
@@ -335,6 +346,7 @@ calls_new_call_box_class_init (CallsNewCallBoxClass *klass)
gtk_widget_class_bind_template_child (widget_class, CallsNewCallBox, keypad);
gtk_widget_class_bind_template_child (widget_class, CallsNewCallBox, dial);
gtk_widget_class_bind_template_child (widget_class, CallsNewCallBox, address_entry);
+ gtk_widget_class_bind_template_callback (widget_class, address_activate_cb);
gtk_widget_class_bind_template_callback (widget_class, dial_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, dial_result_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, backspace_clicked_cb);
diff --git a/src/ui/new-call-box.ui b/src/ui/new-call-box.ui
index 984e082..4eeae97 100644
--- a/src/ui/new-call-box.ui
+++ b/src/ui/new-call-box.ui
@@ -31,6 +31,7 @@
0.5
Enter a VoIP address
+
@@ -42,6 +43,7 @@
True
0.5
Enter a number
+