2011-07-05 [paul] 3.7.9cvs31
authorPaul Mangan <paul@claws-mail.org>
Tue, 5 Jul 2011 08:57:34 +0000 (08:57 +0000)
committerPaul Mangan <paul@claws-mail.org>
Tue, 5 Jul 2011 08:57:34 +0000 (08:57 +0000)
* src/compose.c
when using a Compose template, only place the cursor
in the body when the cursor symbol, %cursor (%X), is used

ChangeLog
PATCHSETS
configure.ac
src/compose.c

index a4fb115..191b7f6 100644 (file)
--- 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
index 0d9ff63..85f7302 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( 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
index 37c4f6a..f081ba2 100644 (file)
@@ -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=
 
index 7ae586d..8f27aa9 100644 (file)
@@ -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;
 }