#include "html.h"
#include "enriched.h"
#include "compose.h"
-#include "addressbook.h"
+#ifndef USE_NEW_ADDRBOOK
+ #include "addressbook.h"
+ #include "addrindex.h"
+#else
+ #include "addressbook-dbus.h"
+ #include "addressadd.h"
+#endif
#include "displayheader.h"
#include "account.h"
#include "mimeview.h"
#include "inputdialog.h"
#include "timing.h"
#include "tags.h"
-#include "addrindex.h"
static GdkColor quote_colors[3] = {
{(gulong)0, (gushort)0, (gushort)0, (gushort)0},
textview->text = text;
textview->uri_list = NULL;
textview->body_pos = 0;
- textview->show_all_headers = FALSE;
textview->last_buttonpress = GDK_NOTHING;
textview->image = NULL;
return textview;
watch_cursor = gdk_cursor_new(GDK_WATCH);
textview_reflect_prefs(textview);
- textview_set_all_headers(textview, FALSE);
textview_set_font(textview, NULL);
textview_create_tags(GTK_TEXT_VIEW(textview->text), textview);
}
textview_show_icon(textview, GTK_STOCK_DIALOG_ERROR);
}
+void textview_show_info(TextView *textview, const gchar *info_str)
+{
+ GtkTextView *text;
+ GtkTextBuffer *buffer;
+ GtkTextIter iter;
+
+ textview_set_font(textview, NULL);
+ textview_clear(textview);
+
+ text = GTK_TEXT_VIEW(textview->text);
+ buffer = gtk_text_view_get_buffer(text);
+ gtk_text_buffer_get_start_iter(buffer, &iter);
+
+ TEXTVIEW_INSERT(info_str);
+ textview_show_icon(textview, GTK_STOCK_DIALOG_INFO);
+ textview_cursor_normal(textview);
+}
+
void textview_show_mime_part(TextView *textview, MimeInfo *partinfo)
{
GtkTextView *text;
g_free(textview);
}
-void textview_set_all_headers(TextView *textview, gboolean all_headers)
-{
- textview->show_all_headers = all_headers;
-}
-
#define CHANGE_TAG_FONT(tagname, font) { \
tag = gtk_text_tag_table_lookup(tags, tagname); \
if (tag) \
cm_return_val_if_fail(fp != NULL, NULL);
- if (textview->show_all_headers) {
+ if (prefs_common.show_all_headers) {
headers = procheader_get_header_array_asis(fp);
sorted_headers = g_ptr_array_new();
for (i = 0; i < headers->len; i++) {
#if HAVE_LIBCOMPFACE
static void textview_show_xface(TextView *textview)
{
+ GtkAllocation allocation;
MsgInfo *msginfo = textview->messageview->msginfo;
GtkTextView *text = GTK_TEXT_VIEW(textview->text);
int x = 0;
gtk_widget_show(textview->image);
- x = textview->text->allocation.width - WIDTH -5;
+ gtk_widget_get_allocation(textview->text, &allocation);
+ x = allocation.width - WIDTH -5;
gtk_text_view_add_child_in_window(text, textview->image,
GTK_TEXT_WINDOW_TEXT, x, 5);
static void textview_save_contact_pic(TextView *textview)
{
+#ifndef USE_NEW_ADDRBOOK
MsgInfo *msginfo = textview->messageview->msginfo;
gchar *filename = NULL;
GError *error = NULL;
}
}
g_free(filename);
+#else
+ /* new address book */
+#endif
}
static void textview_show_contact_pic(TextView *textview)
{
- GtkAllocation allocation;
+#ifndef USE_NEW_ADDRBOOK
MsgInfo *msginfo = textview->messageview->msginfo;
GtkTextView *text = GTK_TEXT_VIEW(textview->text);
int x = 0;
gtk_widget_show(textview->image);
- gtk_widget_get_allocation(textview->text, &allocation);
- x = allocation.width - WIDTH -5;
+ x = textview->text->allocation.width - WIDTH -5;
gtk_text_view_add_child_in_window(text, textview->image,
GTK_TEXT_WINDOW_TEXT, x, 5);
if (textview->image)
gtk_widget_destroy(textview->image);
textview->image = NULL;
-
+#else
+ /* new address book */
+#endif
}
static gint textview_tag_cmp_list(gconstpointer a, gconstpointer b)
return gtkutils_scroll_page(GTK_WIDGET(text), vadj, up);
}
+void textview_scroll_max(TextView *textview, gboolean up)
+{
+ GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview->text));
+ GtkTextIter iter;
+
+ if (up) {
+ gtk_text_buffer_get_start_iter(buffer, &iter);
+ gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(textview->text),
+ &iter, 0.0, TRUE, 0.0, 1.0);
+
+ } else {
+ gtk_text_buffer_get_end_iter(buffer, &iter);
+ gtk_text_view_scroll_to_iter(GTK_TEXT_VIEW(textview->text),
+ &iter, 0.0, TRUE, 0.0, 0.0);
+ }
+}
+
#define KEY_PRESS_EVENT_STOP() \
g_signal_stop_emission_by_name(G_OBJECT(widget), \
"key_press_event");
switch (event->keyval) {
case GDK_KEY_Tab:
- case GDK_KEY_Home:
case GDK_KEY_Left:
case GDK_KEY_Up:
case GDK_KEY_Right:
case GDK_KEY_Down:
case GDK_KEY_Page_Up:
case GDK_KEY_Page_Down:
- case GDK_KEY_End:
case GDK_KEY_Control_L:
case GDK_KEY_Control_R:
return FALSE;
+ case GDK_KEY_Home:
+ case GDK_KEY_End:
+ textview_scroll_max(textview,(event->keyval == GDK_KEY_Home));
+ return TRUE;
case GDK_KEY_space:
if (summaryview)
summary_pass_key_press_event(summaryview, event);
GtkWidget *image = NULL;
GdkPixbuf *picture = NULL;
gboolean use_picture = FALSE;
+
if (uri == NULL)
return;
if (image)
picture = gtk_image_get_pixbuf(GTK_IMAGE(image));
+#ifndef USE_NEW_ADDRBOOK
addressbook_add_contact( fromname, fromaddress, NULL, picture);
+#else
+ if (addressadd_selection(fromname, fromaddress, NULL, picture)) {
+ debug_print( "addressbook_add_contact - added\n" );
+ }
+#endif
g_free(fromaddress);
g_free(fromname);