Hook up Recent Calls list to database

Closes use-cases#113
Closes use-cases#115
This commit is contained in:
Bob Ham
2019-08-01 14:25:53 +01:00
parent 8862b03a13
commit 3c22bc9154
22 changed files with 1312 additions and 82 deletions

View File

@@ -79,30 +79,11 @@ dial_pad_deleted_cb (CallsNewCallBox *self,
static void
dial_clicked_cb (CallsNewCallBox *self,
const gchar *unused,
GtkButton *button)
dial_clicked_cb (CallsNewCallBox *self)
{
GtkTreeIter iter;
gboolean ok;
CallsOrigin *origin;
const gchar *number;
ok = gtk_combo_box_get_active_iter (self->origin_box, &iter);
if (!ok)
{
g_debug ("Can't submit call with no origin");
return;
}
gtk_tree_model_get (GTK_TREE_MODEL (self->origin_store), &iter,
ORIGIN_STORE_COLUMN_ORIGIN, &origin,
-1);
g_assert (CALLS_IS_ORIGIN (origin));
number = gtk_entry_get_text (GTK_ENTRY (self->number_entry));
calls_origin_dial (origin, number);
calls_new_call_box_dial
(self,
gtk_entry_get_text (GTK_ENTRY (self->number_entry)));
}
@@ -311,3 +292,29 @@ calls_new_call_box_new (CallsProvider *provider)
"provider", provider,
NULL);
}
void
calls_new_call_box_dial (CallsNewCallBox *self,
const gchar *target)
{
GtkTreeIter iter;
gboolean ok;
CallsOrigin *origin;
g_return_if_fail (CALLS_IS_NEW_CALL_BOX (self));
g_return_if_fail (target != NULL);
ok = gtk_combo_box_get_active_iter (self->origin_box, &iter);
if (!ok)
{
g_debug ("Can't submit call with no origin");
return;
}
gtk_tree_model_get (GTK_TREE_MODEL (self->origin_store), &iter,
ORIGIN_STORE_COLUMN_ORIGIN, &origin,
-1);
g_assert (CALLS_IS_ORIGIN (origin));
calls_origin_dial (origin, target);
}