add the ability to select part of a text mime-part to reply.
authorColin Leroy <colin@colino.net>
Mon, 15 Jul 2002 23:56:33 +0000 (23:56 +0000)
committerColin Leroy <colin@colino.net>
Mon, 15 Jul 2002 23:56:33 +0000 (23:56 +0000)
ChangeLog.claws
configure.in
src/mimeview.c
src/summaryview.c
src/textview.c
src/textview.h

index c5f3370e12bdbaf420d60e8efab2ea589861deb5..f4908100171a4bd26a7d69c2611eb2d957931e40 100644 (file)
@@ -1,3 +1,12 @@
+2002-07-16 [colin]     0.7.8claws72
+
+       * src/mimeview.c
+         src/summaryview.c
+         src/textview.c
+         src/textview.h
+               add the ability to select part of a text mime-part 
+               to reply.
+
 2002-07-15 [christoph] 0.7.8claws71
 
        * src/folder.c
index 5a93867fb129b23e627131b23c6d27ded418e3a8..3960da9f5f8f72aa43828563ca85c0e0bf16f4fc 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws71
+EXTRA_VERSION=claws72
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index d186a53965e5d61e8ff55aea128ba6a9da95bd3c..4111804d7bfbd59f99e3c8e8b777d664373d3f77 100644 (file)
@@ -541,7 +541,9 @@ static void mimeview_selected(GtkCTree *ctree, GtkCTreeNode *node, gint column,
                if (gdk_pointer_is_grabbed())
                        gdk_pointer_ungrab(GDK_CURRENT_TIME);
        }
-
+       
+       mimeview->textview->default_text = FALSE;
+       
        switch (partinfo->mime_type) {
        case MIME_TEXT:
        case MIME_TEXT_HTML:
@@ -549,9 +551,11 @@ static void mimeview_selected(GtkCTree *ctree, GtkCTreeNode *node, gint column,
        case MIME_MESSAGE_RFC822:
        case MIME_MULTIPART:
                mimeview_show_message_part(mimeview, partinfo);
+               
                break;
 #if (HAVE_GDK_PIXBUF || HAVE_GDK_IMLIB)
        case MIME_IMAGE:
+               mimeview->textview->default_text = TRUE;        
                if (prefs_common.display_img)
                        mimeview_show_image_part(mimeview, partinfo);
                else {
@@ -561,6 +565,7 @@ static void mimeview_selected(GtkCTree *ctree, GtkCTreeNode *node, gint column,
                break;
 #endif
        default:
+               mimeview->textview->default_text = TRUE;        
                mimeview_change_view_type(mimeview, MIMEVIEW_TEXT);
 #if USE_GPGME
                if (g_strcasecmp(partinfo->content_type,
index 5872d60e55fdb5aa8a9b9b7b0e20d2702161ce85..e87dec1102cb5fefe444896d552149394cd3cf98 100644 (file)
@@ -4034,7 +4034,36 @@ void summary_reply(SummaryView *summaryview, ComposeMode mode)
 
        text = gtkut_editable_get_selection
                (GTK_EDITABLE(summaryview->messageview->textview->text));
-
+       /*
+               summaryview->displayed = row;
+               if (!messageview_is_visible(msgview))
+                       main_window_toggle_message_view(summaryview->mainwin);
+               messageview_show(msgview, msginfo, all_headers);
+               if (msgview->type == MVIEW_TEXT ||
+                   (msgview->type == MVIEW_MIME &&*/
+       
+       if (!text) {
+               printf("summaryview->messageview->type(%d)==MVIEW_MIME:%d\n",
+                       summaryview->messageview->type,
+                       summaryview->messageview->type == MVIEW_MIME);
+               printf("summaryview->messageview->mimeview=%p\n",
+                       summaryview->messageview->mimeview);
+               printf("summaryview->messageview->mimeview->textview=%p\n",
+                       summaryview->messageview->mimeview->textview);
+               printf("summaryview->messageview->mimeview->textview->default_text=%d\n",
+                       summaryview->messageview->mimeview->textview->default_text);
+               printf("summaryview->messageview->mimeview->type(%d)==MIMEVIEW_TEXT\n",
+                       summaryview->messageview->mimeview->type,
+                       summaryview->messageview->mimeview->type==MIMEVIEW_TEXT);
+       }
+       if (!text && summaryview->messageview->type == MVIEW_MIME
+           && summaryview->messageview->mimeview->type==MIMEVIEW_TEXT
+           && summaryview->messageview->mimeview->textview
+           && !summaryview->messageview->mimeview->textview->default_text) {
+               text = gtkut_editable_get_selection (GTK_EDITABLE 
+                        (summaryview->messageview->mimeview->textview->text));   
+       }
+       
        switch (mode) {
        case COMPOSE_REPLY:
                compose_reply(msginfo, prefs_common.reply_with_quote,
index 3014b977a3de8fe6a2a9b53f8d30adaeada67df9..aba9fcbe556c10d555d8a41b50b5311c3f15b9c4 100644 (file)
@@ -360,7 +360,7 @@ void textview_show_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
        if (!boundary && (mimeinfo->mime_type == MIME_TEXT || 
                          mimeinfo->mime_type == MIME_TEXT_HTML || 
                          mimeinfo->mime_type == MIME_TEXT_ENRICHED)) {
-       
+               
                if (fseek(fp, mimeinfo->fpos, SEEK_SET) < 0)
                        perror("fseek");
                headers = textview_scan_header(textview, fp);
@@ -504,7 +504,7 @@ static void textview_add_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
                        charset = mimeinfo->charset;
                textview_write_body(textview, mimeinfo, fp, charset);
        }
-
+       
        gtk_stext_thaw(text);
 }
 
@@ -542,7 +542,7 @@ void textview_show_mime_part(TextView *textview, MimeInfo *partinfo)
        textview_set_font(textview, NULL);
        text = GTK_STEXT(textview->text);
        textview_clear(textview);
-
+       
        gtk_stext_freeze(text);
 
        TEXT_INSERT(_("To save this part, pop up the context menu with "));
@@ -583,7 +583,7 @@ void textview_show_signature_part(TextView *textview, MimeInfo *partinfo)
        } else {
                TEXT_INSERT(partinfo->sigstatus_full);
        }
-
+               
        gtk_stext_thaw(text);
 }
 #endif /* USE_GPGME */
@@ -649,6 +649,7 @@ static void textview_show_html(TextView *textview, FILE *fp,
                        textview_write_line(textview, str, NULL);
                }
        }
+       
        html_parser_destroy(parser);
 }
 
@@ -664,6 +665,7 @@ static void textview_show_ertf(TextView *textview, FILE *fp,
        while ((str = ertf_parse(parser)) != NULL) {
                textview_write_line(textview, str, NULL);
        }
+       
        ertf_parser_destroy(parser);
 }
 
index d8b819496ad77939a992e36f271969c293dbec79..d5d195a2d613172cfa86035980e1d7c26ebce319 100644 (file)
@@ -46,6 +46,7 @@ struct _TextView
        GtkItemFactory *popup_factory;
 
        gboolean text_is_mb;
+       gboolean default_text;
 
        GSList *uri_list;
        gint body_pos;