From e7dd66a601ecd3f1cb93aeff6a9eb4bd855d1914 Mon Sep 17 00:00:00 2001 From: Paul Mangan Date: Tue, 5 Jul 2011 08:57:34 +0000 Subject: [PATCH 1/1] 2011-07-05 [paul] 3.7.9cvs31 * src/compose.c when using a Compose template, only place the cursor in the body when the cursor symbol, %cursor (%X), is used --- ChangeLog | 6 ++++++ PATCHSETS | 1 + configure.ac | 2 +- src/compose.c | 9 +++++++-- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a4fb11525..191b7f6d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-07-05 [paul] 3.7.9cvs31 + + * src/compose.c + when using a Compose template, only place the cursor + in the body when the cursor symbol, %cursor (%X), is used + 2011-07-03 [paul] 3.7.9cvs30 * src/main.c diff --git a/PATCHSETS b/PATCHSETS index 0d9ff63d1..85f73024b 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -4182,3 +4182,4 @@ ( cvs diff -u -r 1.274.2.325 -r 1.274.2.326 src/mainwindow.c; cvs diff -u -r 1.39.2.60 -r 1.39.2.61 src/mainwindow.h; cvs diff -u -r 1.395.2.428 -r 1.395.2.429 src/summaryview.c; ) > 3.7.9cvs28.patchset ( cvs diff -u -r 1.1.2.83 -r 1.1.2.84 src/wizard.c; ) > 3.7.9cvs29.patchset ( cvs diff -u -r 1.115.2.238 -r 1.115.2.239 src/main.c; ) > 3.7.9cvs30.patchset +( cvs diff -u -r 1.382.2.576 -r 1.382.2.577 src/compose.c; ) > 3.7.9cvs31.patchset diff --git a/configure.ac b/configure.ac index 37c4f6a22..f081ba222 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,7 @@ MINOR_VERSION=7 MICRO_VERSION=9 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=30 +EXTRA_VERSION=31 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/compose.c b/src/compose.c index 7ae586d40..8f27aa95d 100644 --- a/src/compose.c +++ b/src/compose.c @@ -947,6 +947,7 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI gchar *mailto_from = NULL; PrefsAccount *mailto_account = NULL; MsgInfo* dummyinfo = NULL; + gint cursor_pos = -1; MailField mfield = NO_FIELD_PRESENT; gchar* buf; GtkTextMark *mark; @@ -1197,7 +1198,11 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI * is therefore created before placing the cursor */ case BODY_FIELD_PRESENT: - gtk_widget_grab_focus(compose->text); + cursor_pos = quote_fmt_get_cursor_pos(); + if (cursor_pos == -1) + gtk_widget_grab_focus(compose->header_last->entry); + else + gtk_widget_grab_focus(compose->text); break; } @@ -1212,7 +1217,7 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI compose->modified = FALSE; compose_set_title(compose); - hooks_invoke(COMPOSE_CREATED_HOOKLIST, compose); + hooks_invoke(COMPOSE_CREATED_HOOKLIST, compose); return compose; } -- 2.25.1