sync with 0.7.8cvs5
authorPaul Mangan <paul@claws-mail.org>
Sat, 22 Jun 2002 17:49:39 +0000 (17:49 +0000)
committerPaul Mangan <paul@claws-mail.org>
Sat, 22 Jun 2002 17:49:39 +0000 (17:49 +0000)
12 files changed:
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/compose.c
src/compose.h
src/folderview.c
src/messageview.c
src/messageview.h
src/prefs_common.c
src/prefs_common.h
src/quote_fmt_parse.y

index 0272367..51d3d70 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2002-06-20
+
+       * src/folderview.c
+         src/prefs_common.[ch]: added the hidden option to specify the
+         policy of the vertical scrollbar on folder view.
+
+2002-06-19
+
+       * src/messageview.[ch]:
+         messageview_copy_clipboard(): fixed a bug that couldn't copy text
+         on MIME mode.
+         messageview_get_current_textview(): new.
+         messageview_get_text_widget(): removed.
+       * src/quote_fmt_parse.y: quote message even if msginfo is empty.
+       * src/compose.[ch]: implemented the "Paste as quotation" feature.
+         text_inserted(): new callback for "insert_text" signal.
+         Add quote mark to the pasted text if Compose::paste_as_quotation
+         is TRUE.
+
 2002-06-19
 
        * src/compose.c: if the Content-Type of a file is text/*, check
index 7eeb7ec..473ccc0 100644 (file)
@@ -1,3 +1,8 @@
+2002-06-22 [paul]      0.7.8claws14
+
+       * sync with 0.7.8cvs5
+               see ChangeLog 2002-06-19 and 2002-06-20
+
 2002-06-22 [alfons]    0.7.8claws13
 
        * src/selective_download.c
index 2202667..48ad89f 100644 (file)
@@ -1,3 +1,23 @@
+2002-06-20
+
+       * src/folderview.c
+         src/prefs_common.[ch]: ¥Õ¥©¥ë¥À¥Ó¥å¡¼¤Ç¿âľ¥¹¥¯¥í¡¼¥ë¥Ð¡¼¤Î
+         ¥Ý¥ê¥·¡¼¤ò»ØÄꤹ¤ë±£¤·¥ª¥×¥·¥ç¥ó¤òÄɲá£
+
+2002-06-19
+
+       * src/messageview.[ch]:
+         messageview_copy_clipboard(): MIME ¥â¡¼¥É¤Ç¥Æ¥­¥¹¥È¤ò¥³¥Ô¡¼¤Ç¤­
+         ¤Ê¤¤¥Ð¥°¤ò½¤Àµ¡£
+         messageview_get_current_textview(): ¿·µ¬¡£
+         messageview_get_text_widget(): ºï½ü¡£
+       * src/quote_fmt_parse.y: msginfo ¤¬¶õ¤Ç¤â¥á¥Ã¥»¡¼¥¸¤ò°úÍѤ¹¤ë¤è¤¦¤Ë
+         ¤·¤¿¡£
+       * src/compose.[ch]: ¡Ö°úÍѤȤ·¤Æ¥Ú¡¼¥¹¥È¡×¤ò¼ÂÁõ¡£
+         text_inserted(): ¿·¤·¤¤ "insert_text" ¥·¥°¥Ê¥ë¤Î¥³¡¼¥ë¥Ð¥Ã¥¯¡£
+         Compose::paste_as_quotation ¤¬ TRUE ¤Ê¤é¥Ú¡¼¥¹¥È¤¹¤ë¥Æ¥­¥¹¥È¤Ë
+         °úÍÑÉä¤òÉÕ¤±¤ë¡£
+
 2002-06-19
 
        * src/compose.c: ¥Õ¥¡¥¤¥ë¤Î Content-Type ¤¬ text/* ¤Î¾ì¹ç¤Ï¡¢¤½¤Î
index 33adb0c..303d50e 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws13
+EXTRA_VERSION=claws14
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 4c82888..0d99380 100644 (file)
@@ -365,6 +365,7 @@ static void compose_redo_cb         (Compose        *compose);
 static void compose_cut_cb             (Compose        *compose);
 static void compose_copy_cb            (Compose        *compose);
 static void compose_paste_cb           (Compose        *compose);
+static void compose_paste_as_quote_cb  (Compose        *compose);
 static void compose_allsel_cb          (Compose        *compose);
 
 static void compose_gtk_stext_action_cb        (Compose                   *compose,
@@ -443,8 +444,6 @@ static void to_activated            (GtkWidget      *widget,
                                         Compose        *compose);
 static void newsgroups_activated       (GtkWidget      *widget,
                                         Compose        *compose);
-static void subject_activated          (GtkWidget      *widget,
-                                        Compose        *compose);
 static void cc_activated               (GtkWidget      *widget,
                                         Compose        *compose);
 static void bcc_activated              (GtkWidget      *widget,
@@ -453,8 +452,17 @@ static void replyto_activated              (GtkWidget      *widget,
                                         Compose        *compose);
 static void followupto_activated       (GtkWidget      *widget,
                                         Compose        *compose);
+static void subject_activated          (GtkWidget      *widget,
+                                        Compose        *compose);
 #endif
 
+static void text_activated             (GtkWidget      *widget,
+                                        Compose        *compose);
+static void text_inserted              (GtkWidget      *widget,
+                                        const gchar    *text,
+                                        gint            length,
+                                        gint           *position,
+                                        Compose        *compose);
 static void compose_generic_reply(MsgInfo *msginfo, gboolean quote,
                                  gboolean to_all,
                                  gboolean ignore_replyto,
@@ -476,9 +484,7 @@ static void compose_check_backwards    (Compose *compose);
 static void compose_check_forwards_go     (Compose *compose);
 #endif
 
-static gboolean compose_send_control_enter (Compose *compose);
-static void text_activated                (GtkWidget   *widget,
-                                           Compose     *compose);
+static gboolean compose_send_control_enter     (Compose        *compose);
 
 static GtkItemFactoryEntry compose_popup_entries[] =
 {
@@ -504,6 +510,8 @@ static GtkItemFactoryEntry compose_entries[] =
        {N_("/_Edit/Cu_t"),             "<control>X", compose_cut_cb,    0, NULL},
        {N_("/_Edit/_Copy"),            "<control>C", compose_copy_cb,   0, NULL},
        {N_("/_Edit/_Paste"),           "<control>V", compose_paste_cb,  0, NULL},
+       {N_("/_Edit/Paste as _quotation"),
+                                       NULL, compose_paste_as_quote_cb, 0, NULL},
        {N_("/_Edit/Select _all"),      "<control>A", compose_allsel_cb, 0, NULL},
        {N_("/_Edit/A_dvanced"),        NULL, NULL, 0, "<Branch>"},
        {N_("/_Edit/A_dvanced/Move a character backward"),
@@ -1605,11 +1613,15 @@ static gchar *compose_quote_fmt(Compose *compose, MsgInfo *msginfo,
                                const gchar *body)
 {
        GtkSText *text = GTK_STEXT(compose->text);
+       static MsgInfo dummyinfo;
        gchar *quote_str = NULL;
        gchar *buf;
        gchar *p, *lastp;
        gint len;
 
+       if (!msginfo)
+               msginfo = &dummyinfo;
+
        if (qmark != NULL) {
                quote_fmt_init(msginfo, NULL, NULL);
                quote_fmt_scan_string(qmark);
@@ -4522,6 +4534,8 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
                           GTK_SIGNAL_FUNC(compose_grab_focus_cb), compose);
        gtk_signal_connect(GTK_OBJECT(text), "activate",
                           GTK_SIGNAL_FUNC(text_activated), compose);
+       gtk_signal_connect(GTK_OBJECT(text), "insert_text",
+                          GTK_SIGNAL_FUNC(text_inserted), compose);
        gtk_signal_connect_after(GTK_OBJECT(text), "button_press_event",
                                 GTK_SIGNAL_FUNC(compose_button_press_cb),
                                 edit_vbox);
@@ -4685,6 +4699,7 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
        compose->modified = FALSE;
 
        compose->return_receipt = FALSE;
+       compose->paste_as_quotation = FALSE;
 
        compose->to_list        = NULL;
        compose->newsgroup_list = NULL;
@@ -5116,11 +5131,8 @@ static void compose_template_apply(Compose *compose, Template *tmpl,
                gtk_stext_clear(GTK_STEXT(compose->text));
 
        if (compose->replyinfo == NULL) {
-               MsgInfo dummyinfo;
-
-               memset(&dummyinfo, 0, sizeof(MsgInfo));
-               parsed_str = compose_quote_fmt(compose, &dummyinfo,
-                                              tmpl->value, NULL, NULL);
+               parsed_str = compose_quote_fmt(compose, NULL, tmpl->value,
+                                              NULL, NULL);
        } else {
                if (prefs_common.quotemark && *prefs_common.quotemark)
                        qmark = prefs_common.quotemark;
@@ -6331,6 +6343,17 @@ static void compose_paste_cb(Compose *compose)
                        (GTK_EDITABLE(compose->focused_editable));
 }
 
+static void compose_paste_as_quote_cb(Compose *compose)
+{
+       if (compose->focused_editable &&
+           GTK_WIDGET_HAS_FOCUS(compose->focused_editable)) {
+               compose->paste_as_quotation = TRUE;
+               gtk_editable_paste_clipboard
+                       (GTK_EDITABLE(compose->focused_editable));
+               compose->paste_as_quotation = FALSE;
+       }
+}
+
 static void compose_allsel_cb(Compose *compose)
 {
        if (compose->focused_editable &&
@@ -6795,6 +6818,38 @@ static void text_activated(GtkWidget *widget, Compose *compose)
        compose_send_control_enter(compose);
 }
 
+static void text_inserted(GtkWidget *widget, const gchar *text,
+                         gint length, gint *position, Compose *compose)
+{
+       GtkEditable *editable = GTK_EDITABLE(widget);
+
+       gtk_signal_handler_block_by_func(GTK_OBJECT(widget),
+                                        GTK_SIGNAL_FUNC(text_inserted),
+                                        compose);
+       if (compose->paste_as_quotation) {
+               gchar *new_text;
+               gchar *qmark;
+               gint pos;
+
+               new_text = g_strndup(text, length);
+               if (prefs_common.quotemark && *prefs_common.quotemark)
+                       qmark = prefs_common.quotemark;
+               else
+                       qmark = "> ";
+               gtk_stext_set_point(GTK_STEXT(widget), *position);
+               compose_quote_fmt(compose, NULL, "%Q", qmark, new_text);
+               pos = gtk_stext_get_point(GTK_STEXT(widget));
+               gtk_editable_set_position(editable, pos);
+               *position = pos;
+               g_free(new_text);
+       } else
+               gtk_editable_insert_text(editable, text, length, position);
+       gtk_signal_handler_unblock_by_func(GTK_OBJECT(widget),
+                                          GTK_SIGNAL_FUNC(text_inserted),
+                                          compose);
+       gtk_signal_emit_stop_by_name(GTK_OBJECT(editable), "insert_text");
+}
+
 static gboolean compose_send_control_enter(Compose *compose)
 {
        GdkEvent *ev;
index 7e98805..3d531f8 100644 (file)
@@ -62,8 +62,8 @@ typedef enum
        COMPOSE_FORWARD,
        COMPOSE_FORWARD_AS_ATTACH,
        COMPOSE_FORWARD_INLINE,
-       COMPOSE_REDIRECT,
        COMPOSE_NEW,
+       COMPOSE_REDIRECT,
        COMPOSE_REEDIT
 } ComposeMode;
 
@@ -176,6 +176,7 @@ struct _Compose
        gboolean modified;
 
        gboolean return_receipt;
+       gboolean paste_as_quotation;
 
        GSList *to_list;
        GSList *newsgroup_list;
index 5a7e5d1..4382b8e 100644 (file)
@@ -361,9 +361,10 @@ FolderView *folderview_create(void)
        titles[COL_TOTAL]  = _("#");
 
        scrolledwin = gtk_scrolled_window_new(NULL, NULL);
-       gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin),
-                                      GTK_POLICY_AUTOMATIC,
-                                      GTK_POLICY_ALWAYS);
+       gtk_scrolled_window_set_policy
+               (GTK_SCROLLED_WINDOW(scrolledwin),
+                GTK_POLICY_AUTOMATIC,
+                prefs_common.folderview_vscrollbar_policy);
        gtk_widget_set_usize(scrolledwin,
                             prefs_common.folderview_width,
                             prefs_common.folderview_height);
index eef7487..7248fff 100644 (file)
@@ -106,6 +106,7 @@ MessageView *messageview_create(void)
        messageview->textview   = textview;
        messageview->imageview  = imageview;
        messageview->mimeview   = mimeview;
+       messageview->plugview   = gtk_socket_new();
 
        return messageview;
 }
@@ -423,8 +424,8 @@ void messageview_show(MessageView *messageview, MsgInfo *msginfo,
        textview_set_all_headers(messageview->textview, all_headers);
        textview_set_all_headers(messageview->mimeview->textview, all_headers);
 
-       if (mimeinfo->mime_type != MIME_TEXT &&
-           mimeinfo->mime_type != MIME_TEXT_HTML) {
+       if (mimeinfo->mime_type != MIME_TEXT /*&&
+           mimeinfo->mime_type != MIME_TEXT_HTML*/) {
                messageview_change_view_type(messageview, MVIEW_MIME);
                mimeview_show_message(messageview->mimeview, mimeinfo, file);
        } else {
@@ -441,28 +442,49 @@ static void messageview_change_view_type(MessageView *messageview,
 {
        TextView *textview = messageview->textview;
        MimeView *mimeview = messageview->mimeview;
+       GtkWidget *plugview = messageview->plugview;
 
        if (messageview->type == type) return;
 
        if (type == MVIEW_MIME) {
-               gtkut_container_remove
-                       (GTK_CONTAINER(GTK_WIDGET_PTR(messageview)),
-                        GTK_WIDGET_PTR(textview));
+               if (messageview->type == MVIEW_TEXT)
+                       gtkut_container_remove
+                               (GTK_CONTAINER(GTK_WIDGET_PTR(messageview)),
+                                GTK_WIDGET_PTR(textview));
+               else if (messageview->type == MVIEW_PLUG)
+                       gtkut_container_remove
+                               (GTK_CONTAINER(GTK_WIDGET_PTR(messageview)),
+                                GTK_WIDGET_PTR(plugview));
                gtk_box_pack_start(GTK_BOX(messageview->vbox),
                                   GTK_WIDGET_PTR(mimeview), TRUE, TRUE, 0);
                gtk_container_add(GTK_CONTAINER(mimeview->vbox),
                                  GTK_WIDGET_PTR(textview));
        } else if (type == MVIEW_TEXT) {
-               gtkut_container_remove
-                       (GTK_CONTAINER(GTK_WIDGET_PTR(messageview)),
-                        GTK_WIDGET_PTR(mimeview));
-
+               if (messageview->type == MVIEW_MIME)
+                       gtkut_container_remove
+                               (GTK_CONTAINER(GTK_WIDGET_PTR(messageview)),
+                                GTK_WIDGET_PTR(mimeview));
+               else if (messageview->type == MVIEW_PLUG)
+                       gtkut_container_remove
+                               (GTK_CONTAINER(GTK_WIDGET_PTR(messageview)),
+                                GTK_WIDGET_PTR(plugview));
                if (mimeview->vbox == GTK_WIDGET_PTR(textview)->parent)
                        gtkut_container_remove(GTK_CONTAINER(mimeview->vbox),
                                               GTK_WIDGET_PTR(textview));
 
                gtk_box_pack_start(GTK_BOX(messageview->vbox),
                                   GTK_WIDGET_PTR(textview), TRUE, TRUE, 0);
+       } else if (type == MVIEW_PLUG) {
+               if (messageview->type == MVIEW_MIME)
+                       gtkut_container_remove
+                               (GTK_CONTAINER(GTK_WIDGET_PTR(messageview)),
+                                GTK_WIDGET_PTR(mimeview));
+               else if (messageview->type == MVIEW_TEXT)
+                       gtkut_container_remove
+                               (GTK_CONTAINER(GTK_WIDGET_PTR(messageview)),
+                                GTK_WIDGET_PTR(textview));
+               gtk_box_pack_start(GTK_BOX(messageview->vbox),
+                                  GTK_WIDGET_PTR(plugview), TRUE, TRUE, 0);
        } else
                return;
 
@@ -487,6 +509,7 @@ void messageview_destroy(MessageView *messageview)
        textview_destroy(messageview->textview);
        imageview_destroy(messageview->imageview);
        mimeview_destroy(messageview->mimeview);
+       gtk_widget_destroy(messageview->plugview);
 
        g_free(messageview);
 
@@ -504,43 +527,39 @@ void messageview_set_font(MessageView *messageview)
        textview_set_font(messageview->textview, NULL);
 }
 
-void messageview_copy_clipboard(MessageView *messageview)
-{
-       gint displaytype = /* force MVIEV_TEXT on first page */
-               ((messageview->type == MVIEW_MIME)
-               && (gtk_notebook_get_current_page(GTK_NOTEBOOK(
-                               messageview->mimeview->notebook)) > 0))
-               ? MVIEW_MIME
-               : MVIEW_TEXT;
-
-       switch (displaytype) {
-       case MVIEW_TEXT:
-               gtk_editable_copy_clipboard(GTK_EDITABLE(messageview->textview->text));
-               break;
-       case MVIEW_MIME:
-               if (messageview->mimeview->type == MIMEVIEW_TEXT)
-                       gtk_editable_copy_clipboard(GTK_EDITABLE(messageview->mimeview->textview->text));
-       default:
-               break;
-       }
-}
-
-void messageview_select_all(MessageView *messageview)
+TextView *messageview_get_current_textview(MessageView *messageview)
 {
-       GtkWidget *text = NULL;
+       TextView *text = NULL;
 
        if (messageview->type == MVIEW_TEXT)
-               text = messageview->textview->text;
+               text = messageview->textview;
        else if (messageview->type == MVIEW_MIME) {
                if (gtk_notebook_get_current_page
                        (GTK_NOTEBOOK(messageview->mimeview->notebook)) == 0)
-                       text = messageview->textview->text;
+                       text = messageview->textview;
                else if (messageview->mimeview->type == MIMEVIEW_TEXT)
-                       text = messageview->mimeview->textview->text;
+                       text = messageview->mimeview->textview;
        }
 
+       return text;
+}
+
+void messageview_copy_clipboard(MessageView *messageview)
+{
+       TextView *text;
+
+       text = messageview_get_current_textview(messageview);
+       if (text)
+               gtk_editable_copy_clipboard(GTK_EDITABLE(text->text));
+}
+
+void messageview_select_all(MessageView *messageview)
+{
+       TextView *text;
+
+       text = messageview_get_current_textview(messageview);
        if (text)
-               gtk_editable_select_region(GTK_EDITABLE(text), 0, -1);
+               gtk_editable_select_region(GTK_EDITABLE(text->text), 0, -1);
 }
 
 void messageview_set_position(MessageView *messageview, gint pos)
@@ -564,11 +583,6 @@ gboolean messageview_search_string_backward(MessageView *messageview,
        return FALSE;
 }
 
-GtkWidget *messageview_get_text_widget(MessageView *messageview)
-{
-       return messageview->textview->text;
-}
-
 gboolean messageview_is_visible(MessageView *messageview)
 {
        return messageview->visible;
index 0be16f5..609cdb6 100644 (file)
@@ -35,7 +35,8 @@ typedef struct _MessageView   MessageView;
 typedef enum
 {
        MVIEW_TEXT,
-       MVIEW_MIME
+       MVIEW_MIME,
+       MVIEW_PLUG
 } MessageType;
 
 struct _MessageView
@@ -50,6 +51,7 @@ struct _MessageView
        TextView *textview;
        ImageView *imageview;
        MimeView *mimeview;
+       GtkWidget *plugview;
 
        MainWindow *mainwin;
 
@@ -66,6 +68,9 @@ void messageview_clear                                (MessageView    *messageview);
 void messageview_destroy                       (MessageView    *messageview);
 void messageview_quote_color_set               (void);
 void messageview_set_font                      (MessageView    *messageview);
+
+TextView *messageview_get_current_textview     (MessageView    *messageview);
+
 void messageview_copy_clipboard                        (MessageView    *messageview);
 void messageview_select_all                    (MessageView    *messageview);
 void messageview_set_position                  (MessageView    *messageview,
@@ -79,8 +84,6 @@ gboolean messageview_search_string_backward   (MessageView    *messageview,
                                                 const gchar    *str,
                                                 gboolean        case_sens);
 
-GtkWidget *messageview_get_text_widget         (MessageView    *messageview);
-
 gboolean messageview_is_visible                        (MessageView    *messageview);
 
 #endif /* __MESSAGEVIEW_H__ */
index 957bbc3..b05500c 100644 (file)
@@ -508,12 +508,15 @@ static PrefParam param[] = {
 
        {"enable_thread", "TRUE", &prefs_common.enable_thread, P_BOOL,
         NULL, NULL, NULL},
-       
        {"toolbar_style", "3", &prefs_common.toolbar_style, P_ENUM,
         NULL, NULL, NULL},
        {"show_statusbar", "TRUE", &prefs_common.show_statusbar, P_BOOL,
         NULL, NULL, NULL},
 
+       {"folderview_vscrollbar_policy", "0",
+        &prefs_common.folderview_vscrollbar_policy, P_ENUM,
+        NULL, NULL, NULL},
+
        {"summary_col_show_mark", "TRUE",
         &prefs_common.summary_col_visible[S_COL_MARK], P_BOOL, NULL, NULL, NULL},
        {"summary_col_show_unread", "TRUE",
index 7e96b7d..8576090 100644 (file)
@@ -126,6 +126,8 @@ struct _PrefsCommon
        gboolean use_addr_book;
        gchar *date_format;
 
+       gint folderview_vscrollbar_policy;
+
        /* Filtering */
        GSList *fltlist;
 
index 9f5e6f6..1249528 100644 (file)
@@ -375,7 +375,7 @@ special:
        }
        | SHOW_MESSAGE
        {
-               if (msginfo->folder) {
+               if (msginfo->folder || body) {
                        gchar buf[BUFFSIZE];
                        FILE *fp;
 
@@ -397,7 +397,7 @@ special:
        }
        | SHOW_QUOTED_MESSAGE
        {
-               if (msginfo->folder) {
+               if (msginfo->folder || body) {
                        gchar buf[BUFFSIZE];
                        FILE *fp;
 
@@ -421,7 +421,7 @@ special:
        }
        | SHOW_MESSAGE_NO_SIGNATURE
        {
-               if (msginfo->folder) {
+               if (msginfo->folder || body) {
                        gchar buf[BUFFSIZE];
                        FILE *fp;
 
@@ -445,7 +445,7 @@ special:
        }
        | SHOW_QUOTED_MESSAGE_NO_SIGNATURE
        {
-               if (msginfo->folder) {
+               if (msginfo->folder || body) {
                        gchar buf[BUFFSIZE];
                        FILE *fp;