Implemented the call button in the messages view (untested)

This commit is contained in:
Pierre Pronchery 2010-05-16 23:34:28 +00:00
parent d82723a1e7
commit d43ed8f0dd
3 changed files with 32 additions and 2 deletions

View File

@ -255,7 +255,7 @@ void on_phone_messages_call(gpointer data)
{
Phone * phone = data;
/* FIXME implement */
phone_messages_call_selected(phone);
}
@ -264,7 +264,7 @@ void on_phone_messages_delete(gpointer data)
{
Phone * phone = data;
/* FIXME implement */
phone_messages_delete_selected(phone);
}

View File

@ -731,6 +731,34 @@ void phone_messages_set(Phone * phone, unsigned int index, char const * number,
}
/* phone_messages_call_selected */
void phone_messages_call_selected(Phone * phone)
{
GtkTreeSelection * treesel;
GtkTreeIter iter;
gchar * number = NULL;
if((treesel = gtk_tree_view_get_selection(GTK_TREE_VIEW(
phone->me_view))) == NULL)
return;
if(gtk_tree_selection_get_selected(treesel, NULL, &iter) != TRUE)
return;
gtk_tree_model_get(GTK_TREE_MODEL(phone->co_store), &iter,
PHONE_MESSAGE_COLUMN_NUMBER, &number, -1);
if(number == NULL)
return;
gsm_call(phone->gsm, GSM_CALL_TYPE_VOICE, number);
g_free(number);
}
/* phone_messages_delete_selected */
void phone_messages_delete_selected(Phone * phone)
{
/* FIXME implement */
}
/* phone_messages_read_selected */
void phone_messages_read_selected(Phone * phone)
{

View File

@ -66,6 +66,8 @@ void phone_dialer_call(Phone * phone, char const * number);
void phone_dialer_hangup(Phone * phone);
/* messages */
void phone_messages_call_selected(Phone * phone);
void phone_messages_delete_selected(Phone * phone);
void phone_messages_read_selected(Phone * phone);
void phone_messages_set(Phone * phone, unsigned int index, char const * number,
time_t date, char const * content);