* src/compose.c
authorChristoph Hohmann <reboot@gmx.ch>
Tue, 10 Sep 2002 15:33:55 +0000 (15:33 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Tue, 10 Sep 2002 15:33:55 +0000 (15:33 +0000)
        compose_redirect should not use compose_generic_new
        because that does more stuff than expected including
        opening the external editor
        (closes bug "[ 526608 ] bounced messages appear blank
         in editor")

ChangeLog.claws
configure.in
src/compose.c

index b74ffcf..28894c8 100644 (file)
@@ -1,3 +1,12 @@
+2002-09-10 [christoph] 0.8.2claws36
+
+       * src/compose.c
+               compose_redirect should not use compose_generic_new
+               because that does more stuff than expected including
+               opening the external editor
+               (closes bug "[ 526608 ] bounced messages appear blank
+                in editor")
+
 2002-09-10 [christoph] 0.8.2claws35
 
        * src/folder.c
 2002-09-10 [christoph] 0.8.2claws35
 
        * src/folder.c
index 6e059ca..b85702c 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=8
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws35
+EXTRA_VERSION=claws36
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 5dbdd90..98adacb 100644 (file)
@@ -676,58 +676,6 @@ static GtkTargetEntry compose_mime_types[] =
        {"text/uri-list", 0, 0}
 };
 
        {"text/uri-list", 0, 0}
 };
 
-Compose *compose_redirect(PrefsAccount *account, MsgInfo *msginfo)
-{
-       Compose *c;
-       gchar *filename;
-       GtkItemFactory *ifactory;
-       
-       c = compose_generic_new(account, NULL, NULL, NULL);
-
-       filename = procmsg_get_message_file(msginfo);
-       if (filename == NULL)
-               return NULL;
-
-       c->redirect_filename = filename;
-
-       if (msginfo->subject)
-               gtk_entry_set_text(GTK_ENTRY(c->subject_entry),
-                                  msginfo->subject);
-       gtk_editable_set_editable(GTK_EDITABLE(c->subject_entry), FALSE);
-
-       compose_quote_fmt(c, msginfo, "%M", NULL, NULL);
-       gtk_editable_set_editable(GTK_EDITABLE(c->text), FALSE);
-
-       ifactory = gtk_item_factory_from_widget(c->popupmenu);
-       menu_set_sensitive(ifactory, "/Add...", FALSE);
-       menu_set_sensitive(ifactory, "/Remove", FALSE);
-       menu_set_sensitive(ifactory, "/Property...", FALSE);
-
-       ifactory = gtk_item_factory_from_widget(c->menubar);
-       menu_set_sensitive(ifactory, "/File/Insert file", FALSE);
-       menu_set_sensitive(ifactory, "/File/Attach file", FALSE);
-       menu_set_sensitive(ifactory, "/File/Insert signature", FALSE);
-       menu_set_sensitive(ifactory, "/Edit/Paste", FALSE);
-       menu_set_sensitive(ifactory, "/Edit/Wrap current paragraph", FALSE);
-       menu_set_sensitive(ifactory, "/Edit/Wrap all long lines", FALSE);
-       menu_set_sensitive(ifactory, "/Edit/Edit with external editor", FALSE);
-       menu_set_sensitive(ifactory, "/Message/Attach", FALSE);
-#if USE_GPGME
-       menu_set_sensitive(ifactory, "/Message/Sign", FALSE);
-       menu_set_sensitive(ifactory, "/Message/Encrypt", FALSE);
-#endif
-       menu_set_sensitive(ifactory, "/Message/Request Return Receipt", FALSE);
-       menu_set_sensitive(ifactory, "/Tools/Template", FALSE);
-       
-       gtk_widget_set_sensitive(c->insert_btn, FALSE);
-       gtk_widget_set_sensitive(c->attach_btn, FALSE);
-       gtk_widget_set_sensitive(c->sig_btn, FALSE);
-       gtk_widget_set_sensitive(c->exteditor_btn, FALSE);
-       gtk_widget_set_sensitive(c->linewrap_btn, FALSE);
-
-       return c;
-}
-
 Compose *compose_new(PrefsAccount *account, const gchar *mailto,
                     GPtrArray *attach_files)
 {
 Compose *compose_new(PrefsAccount *account, const gchar *mailto,
                     GPtrArray *attach_files)
 {
@@ -1262,6 +1210,73 @@ void compose_reedit(MsgInfo *msginfo)
                compose_exec_ext_editor(compose);
 }
 
                compose_exec_ext_editor(compose);
 }
 
+Compose *compose_redirect(PrefsAccount *account, MsgInfo *msginfo)
+{
+       Compose *compose;
+       gchar *filename;
+       GtkItemFactory *ifactory;
+
+       g_return_val_if_fail(msginfo != NULL, NULL);
+
+       if(!account)
+               account = cur_account;
+       g_return_val_if_fail(account != NULL, NULL);
+
+       compose = compose_create(account, COMPOSE_REDIRECT);
+       ifactory = gtk_item_factory_from_widget(compose->menubar);
+
+       compose->replyinfo = NULL;
+
+       compose_show_first_last_header(compose, TRUE);
+
+       gtk_widget_grab_focus(compose->header_last->entry);
+
+       filename = procmsg_get_message_file(msginfo);
+       if (filename == NULL)
+               return NULL;
+
+       compose->redirect_filename = filename;
+
+       if (msginfo->subject)
+               gtk_entry_set_text(GTK_ENTRY(compose->subject_entry),
+                                  msginfo->subject);
+       gtk_editable_set_editable(GTK_EDITABLE(compose->subject_entry), FALSE);
+
+       gtk_stext_freeze(GTK_STEXT(compose->text));
+       compose_quote_fmt(compose, msginfo, "%M", NULL, NULL);
+       gtk_editable_set_editable(GTK_EDITABLE(compose->text), FALSE);
+       gtk_stext_thaw(GTK_STEXT(compose->text));
+
+       ifactory = gtk_item_factory_from_widget(compose->popupmenu);
+       menu_set_sensitive(ifactory, "/Add...", FALSE);
+       menu_set_sensitive(ifactory, "/Remove", FALSE);
+       menu_set_sensitive(ifactory, "/Property...", FALSE);
+
+       ifactory = gtk_item_factory_from_widget(compose->menubar);
+       menu_set_sensitive(ifactory, "/File/Insert file", FALSE);
+       menu_set_sensitive(ifactory, "/File/Attach file", FALSE);
+       menu_set_sensitive(ifactory, "/File/Insert signature", FALSE);
+       menu_set_sensitive(ifactory, "/Edit/Paste", FALSE);
+       menu_set_sensitive(ifactory, "/Edit/Wrap current paragraph", FALSE);
+       menu_set_sensitive(ifactory, "/Edit/Wrap all long lines", FALSE);
+       menu_set_sensitive(ifactory, "/Edit/Edit with external editor", FALSE);
+       menu_set_sensitive(ifactory, "/Message/Attach", FALSE);
+#if USE_GPGME
+       menu_set_sensitive(ifactory, "/Message/Sign", FALSE);
+       menu_set_sensitive(ifactory, "/Message/Encrypt", FALSE);
+#endif
+       menu_set_sensitive(ifactory, "/Message/Request Return Receipt", FALSE);
+       menu_set_sensitive(ifactory, "/Tools/Template", FALSE);
+       
+       gtk_widget_set_sensitive(compose->insert_btn, FALSE);
+       gtk_widget_set_sensitive(compose->attach_btn, FALSE);
+       gtk_widget_set_sensitive(compose->sig_btn, FALSE);
+       gtk_widget_set_sensitive(compose->exteditor_btn, FALSE);
+       gtk_widget_set_sensitive(compose->linewrap_btn, FALSE);
+
+        return compose;
+}
+
 GList *compose_get_compose_list(void)
 {
        return compose_list;
 GList *compose_get_compose_list(void)
 {
        return compose_list;