diff --git a/src/callbacks.c b/src/callbacks.c index a94fbba..994a484 100644 --- a/src/callbacks.c +++ b/src/callbacks.c @@ -390,6 +390,15 @@ void on_phone_read_delete(gpointer data) } +/* on_phone_read_forward */ +void on_phone_read_forward(gpointer data) +{ + Phone * phone = data; + + phone_read_forward(phone); +} + + /* on_phone_read_reply */ void on_phone_read_reply(gpointer data) { diff --git a/src/phone.c b/src/phone.c index a43f854..c86e2dd 100644 --- a/src/phone.c +++ b/src/phone.c @@ -1120,6 +1120,26 @@ void phone_read_delete(Phone * phone) } +/* phone_read_forward */ +void phone_read_forward(Phone * phone) +{ + GtkTextBuffer * tbuf; + GtkTextIter start; + GtkTextIter end; + gchar * text; + + if(phone->re_window == NULL) + return; + tbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(phone->re_view)); + gtk_text_buffer_get_start_iter(tbuf, &start); + gtk_text_buffer_get_end_iter(tbuf, &end); + if((text = gtk_text_buffer_get_text(tbuf, &start, &end, FALSE)) == NULL) + return; + phone_show_write(phone, TRUE, "", text); + g_free(text); +} + + /* phone_read_reply */ void phone_read_reply(Phone * phone) { @@ -1993,6 +2013,12 @@ void phone_show_read(Phone * phone, gboolean show, ...) g_signal_connect_swapped(G_OBJECT(toolitem), "clicked", G_CALLBACK(on_phone_read_reply), phone); gtk_toolbar_insert(GTK_TOOLBAR(widget), toolitem, -1); + toolitem = gtk_tool_button_new(NULL, _("Forward")); + gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(toolitem), + "mail-forward"); + g_signal_connect_swapped(G_OBJECT(toolitem), "clicked", + G_CALLBACK(on_phone_read_forward), phone); + gtk_toolbar_insert(GTK_TOOLBAR(widget), toolitem, -1); toolitem = gtk_tool_button_new_from_stock(GTK_STOCK_DELETE); g_signal_connect_swapped(G_OBJECT(toolitem), "clicked", G_CALLBACK(on_phone_read_delete), phone); diff --git a/src/phone.h b/src/phone.h index 60364a8..f18eaaa 100644 --- a/src/phone.h +++ b/src/phone.h @@ -116,6 +116,7 @@ void phone_unload_all(Phone * phone); /* read */ void phone_read_call(Phone * phone); void phone_read_delete(Phone * phone); +void phone_read_forward(Phone * phone); void phone_read_reply(Phone * phone); /* settings */