sync with sylpheed 0.7.0cvs22
authorPaul Mangan <paul@claws-mail.org>
Tue, 29 Jan 2002 10:03:33 +0000 (10:03 +0000)
committerPaul Mangan <paul@claws-mail.org>
Tue, 29 Jan 2002 10:03:33 +0000 (10:03 +0000)
12 files changed:
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/imageview.c
src/imageview.h
src/messageview.c
src/mimeview.c
src/mimeview.h
src/prefs_common.c
src/prefs_filter.c
src/textview.c

index d191c60..3eedeb1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2002-01-29
+
+       * src/mimeview.c: fixed multiple dialog / moving by correcting
+         button / key event processing.
+       * src/mimeview.[ch]
+         src/textview.c: pass some key press events to MimeView in MIME
+         mode.
+       * src/prefs_filter.c: fixed a bug that didn't set the order of
+         rules correctly.
+
 2002-01-28
 
        * src/mainwindow.c
@@ -9,6 +19,13 @@
          and 'On exit'.
        * src/importldif.c: imp_ldif_delete_event(): fixed segfault when
          closing the dialog with window manager (in more appropriate way).
+       * src/imageview.[ch]
+         src/messageview.c
+         src/mimeview.c: fixed wrong scrolling position when switching
+         between text and image parts. Also free the unrequired image
+         (thanks to Sergey Vlasov).
+       * src/prefs_common.c: disabled 'Go to inbox after receiving new mail'
+         by default.
 
 2002-01-28
 
index 31ba988..6af1032 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-29 [paul]      0.7.0claws39
+
+       * sync with sylpheed 0.7.0cvs22
+               see ChangeLog entries 2002-01-28 and 2002-01-29
+
 2002-01-28 [melvin]    0.7.0claws38
 
        * src/compose.c
index b0030c4..696dc09 100644 (file)
@@ -1,3 +1,12 @@
+2002-01-29
+
+       * src/mimeview.c: ¥Ü¥¿¥ó / ¥­¡¼¥¤¥Ù¥ó¥È½èÍý¤ò½¤Àµ¤·¤Æ¿½Å¥À¥¤¥¢¥í¥°
+         / °ÜÆ°¤ò½¤Àµ¡£
+       * src/mimeview.[ch]
+         src/textview.c: MIME ¥â¡¼¥É¤Ç¤¤¤¯¤Ä¤«¤Î¥­¡¼¥×¥ì¥¹¥¤¥Ù¥ó¥È¤ò
+         MimeView ¤ËÅϤ¹¤è¤¦¤Ë¤·¤¿¡£
+       * src/prefs_filter.c: ¥ë¡¼¥ë¤Î½ç½ø¤òÀµ¤·¤¯¥»¥Ã¥È¤·¤Ê¤¤¥Ð¥°¤ò½¤Àµ¡£
+
 2002-01-28
 
        * src/mainwindow.c
@@ -8,6 +17,13 @@
          ¸ò´¹¡£
        * src/importldif.c: imp_ldif_delete_event(): ¥À¥¤¥¢¥í¥°¤ò¥¦¥£¥ó¥É¥¦
          ¥Þ¥Í¡¼¥¸¥ã¤ÇÊĤ¸¤¿¤È¤­¤Î segfault ¤ò½¤Àµ(¤è¤êÀµ¤·¤¤ÊýË¡¤Ç)¡£
+       * src/imageview.[ch]
+         src/messageview.c
+         src/mimeview.c: ¥Æ¥­¥¹¥È¤È²èÁü¥Ñ¡¼¥È¤òÀÚ¤êÂؤ¨¤¿¤È¤­¤Î¸í¤Ã¤¿
+         ¥¹¥¯¥í¡¼¥ë°ÌÃÖ¤ò½¤Àµ¡£¤Þ¤¿ÉÔÍפʲèÁü¤ò³«Êü¤¹¤ë¤è¤¦¤Ë¤·¤¿
+         (Sergey Vlasov ¤µ¤ó thanks)¡£
+       * src/prefs_common.c: ¡Ö¿·Ãå¥á¡¼¥ë¤ò¼õ¿®¤·¤¿¸å¼õ¿®È¢¤Ë°ÜÆ°¤¹¤ë¡×
+         ¤ò¥Ç¥Õ¥©¥ë¥È¤Ç̵¸ú¤Ë¤·¤¿¡£
 
 2002-01-28
 
index 713af0e..33b87d3 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws38
+EXTRA_VERSION=claws39
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index aeb4b95..be3e68a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2002 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -74,12 +74,12 @@ void imageview_show_image(ImageView *imageview, MimeInfo *mimeinfo,
        GdkPixmap *pixmap;
        GdkBitmap *mask;
 
+       imageview_clear(imageview);
+
        pixbuf = gdk_pixbuf_new_from_file(file);
 
        if (!pixbuf) {
                g_warning(_("Can't load the image."));  
-               if (imageview->image)
-                       gtk_widget_hide(imageview->image);
                return;
        }
 
@@ -111,12 +111,12 @@ void imageview_show_image(ImageView *imageview, MimeInfo *mimeinfo,
 {
        GdkImlibImage *im;
 
+       imageview_clear(imageview);
+
        im = gdk_imlib_load_image((gchar *)file);
 
        if (!im) {
                g_warning(_("Can't load the image."));  
-               if (imageview->image)
-                       gtk_widget_hide(imageview->image);
                return;
        }
 
index 175f625..1da0b8e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2002 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
index 8a3dfa3..f9f27b2 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2001 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2002 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
index 9b079a9..54218a0 100644 (file)
@@ -84,10 +84,10 @@ static void mimeview_start_drag     (GtkWidget      *widget,
                                         gint            button,
                                         GdkEvent       *event,
                                         MimeView       *mimeview);
-static void mimeview_button_pressed    (GtkWidget      *widget,
+static gint mimeview_button_pressed    (GtkWidget      *widget,
                                         GdkEventButton *event,
                                         MimeView       *mimeview);
-static void mimeview_key_pressed       (GtkWidget      *widget,
+static gint mimeview_key_pressed       (GtkWidget      *widget,
                                         GdkEventKey    *event,
                                         MimeView       *mimeview);
 
@@ -550,19 +550,19 @@ static void mimeview_start_drag (GtkWidget *widget, gint button,
        gtk_drag_set_icon_default(context);
 }
 
-static void mimeview_button_pressed(GtkWidget *widget, GdkEventButton *event,
+static gint mimeview_button_pressed(GtkWidget *widget, GdkEventButton *event,
                                    MimeView *mimeview)
 {
        GtkCList *clist = GTK_CLIST(widget);
        MimeInfo *partinfo;
        gint row, column;
 
-       if (!event) return;
+       if (!event) return FALSE;
 
        if (event->button == 2 || event->button == 3) {
                if (!gtk_clist_get_selection_info(clist, event->x, event->y,
                                                  &row, &column))
-                       return;
+                       return FALSE;
                gtk_clist_unselect_all(clist);
                gtk_clist_select_row(clist, row, column);
                gtkut_clist_set_focus_row(clist, row);
@@ -603,74 +603,94 @@ static void mimeview_button_pressed(GtkWidget *widget, GdkEventButton *event,
                               NULL, NULL, NULL, NULL,
                               event->button, event->time);
        }
+
+       return TRUE;
+}
+
+void mimeview_pass_key_press_event(MimeView *mimeview, GdkEventKey *event)
+{
+       mimeview_key_pressed(mimeview->ctree, event, mimeview);
 }
 
 #define BREAK_ON_MODIFIER_KEY() \
        if ((event->state & (GDK_MOD1_MASK|GDK_CONTROL_MASK)) != 0) break
 
-static void mimeview_key_pressed(GtkWidget *widget, GdkEventKey *event,
+#define KEY_PRESS_EVENT_STOP() \
+       if (gtk_signal_n_emissions_by_name \
+               (GTK_OBJECT(ctree), "key_press_event") > 0) { \
+               gtk_signal_emit_stop_by_name(GTK_OBJECT(ctree), \
+                                            "key_press_event"); \
+       }
+
+static gint mimeview_key_pressed(GtkWidget *widget, GdkEventKey *event,
                                 MimeView *mimeview)
 {
        SummaryView *summaryview;
-       GtkCTree *ctree = GTK_CTREE(mimeview->ctree);
+       GtkCTree *ctree = GTK_CTREE(widget);
        GtkCTreeNode *node;
 
-       if (!event) return;
-       if (!mimeview->opened) return;
+       if (!event) return FALSE;
+       if (!mimeview->opened) return FALSE;
 
        switch (event->keyval) {
        case GDK_space:
-               if (textview_scroll_page(mimeview->textview, FALSE)) return;
+               if (textview_scroll_page(mimeview->textview, FALSE))
+                       return TRUE;
 
                node = GTK_CTREE_NODE_NEXT(mimeview->opened);
                if (node) {
                        gtk_sctree_unselect_all(GTK_SCTREE(ctree));
                        gtk_sctree_select(GTK_SCTREE(ctree), node);
-                       return;
+                       return TRUE;
                }
                break;
        case GDK_BackSpace:
                textview_scroll_page(mimeview->textview, TRUE);
-               return;
+               return TRUE;
        case GDK_Return:
                textview_scroll_one_line(mimeview->textview,
                                         (event->state & GDK_MOD1_MASK) != 0);
-               return;
+               return TRUE;
        case GDK_n:
        case GDK_N:
                BREAK_ON_MODIFIER_KEY();
                if (!GTK_CTREE_NODE_NEXT(mimeview->opened)) break;
+               KEY_PRESS_EVENT_STOP();
 
                gtk_signal_emit_by_name(GTK_OBJECT(ctree), "scroll_vertical",
                                        GTK_SCROLL_STEP_FORWARD, 0.0);
-               return;
+               return TRUE;
        case GDK_p:
        case GDK_P:
                BREAK_ON_MODIFIER_KEY();
                if (!GTK_CTREE_NODE_PREV(mimeview->opened)) break;
+               KEY_PRESS_EVENT_STOP();
 
                gtk_signal_emit_by_name(GTK_OBJECT(ctree), "scroll_vertical",
                                        GTK_SCROLL_STEP_BACKWARD, 0.0);
-               return;
+               return TRUE;
        case GDK_y:
                BREAK_ON_MODIFIER_KEY();
+               KEY_PRESS_EVENT_STOP();
                mimeview_save_as(mimeview);
-               return;
+               return TRUE;
        case GDK_t:
                BREAK_ON_MODIFIER_KEY();
+               KEY_PRESS_EVENT_STOP();
                mimeview_display_as_text(mimeview);
-               return;
+               return TRUE;
        case GDK_l:
                BREAK_ON_MODIFIER_KEY();
+               KEY_PRESS_EVENT_STOP();
                mimeview_launch(mimeview);
-               return;
+               return TRUE;
        default:
-               break;
        }
 
-       if (!mimeview->messageview->mainwin) return;
+       if (!mimeview->messageview->mainwin) return FALSE;
        summaryview = mimeview->messageview->mainwin->summaryview;
        summary_pass_key_press_event(summaryview, event);
+       return TRUE;
 }
 
 static void mimeview_drag_data_get(GtkWidget       *widget,
index 4205139..197ef23 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2002 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -21,6 +21,7 @@
 #define __MIMEVIEW_H__
 
 #include <glib.h>
+#include <gdk/gdk.h>
 #include <gtk/gtkwidget.h>
 #include <gtk/gtkctree.h>
 
@@ -69,4 +70,7 @@ void mimeview_show_message    (MimeView       *mimeview,
                                 const gchar    *file);
 void mimeview_destroy          (MimeView       *mimeview);
 
+void mimeview_pass_key_press_event     (MimeView       *mimeview,
+                                        GdkEventKey    *event);
+
 #endif /* __MIMEVIEW_H__ */
index 598c787..d6281f3 100644 (file)
@@ -661,7 +661,7 @@ static PrefParam param[] = {
        {"open_unread_on_enter", "FALSE", &prefs_common.open_unread_on_enter,
         P_BOOL, &interface.checkbtn_openunread,
         prefs_set_data_from_toggle, prefs_set_toggle},
-       {"open_inbox_on_inc", "TRUE", &prefs_common.open_inbox_on_inc,
+       {"open_inbox_on_inc", "FALSE", &prefs_common.open_inbox_on_inc,
         P_BOOL, &interface.checkbtn_openinbox,
         prefs_set_data_from_toggle, prefs_set_toggle},
        {"immediate_execution", "TRUE", &prefs_common.immediate_exec, P_BOOL,
index 5ebb210..17f7c9e 100644 (file)
@@ -442,8 +442,9 @@ static void prefs_filter_create(void)
                                GTK_CAN_FOCUS);
        gtk_signal_connect (GTK_OBJECT (cond_clist), "select_row",
                            GTK_SIGNAL_FUNC (prefs_filter_select), NULL);
-       gtk_signal_connect (GTK_OBJECT (cond_clist), "row_move",
-                           GTK_SIGNAL_FUNC (prefs_filter_row_move), NULL);
+       gtk_signal_connect_after (GTK_OBJECT (cond_clist), "row_move",
+                                 GTK_SIGNAL_FUNC (prefs_filter_row_move),
+                                 NULL);
 
        btn_vbox = gtk_vbox_new (FALSE, 8);
        gtk_widget_show (btn_vbox);
index 8f38d2a..8ef9005 100644 (file)
@@ -119,7 +119,7 @@ static GPtrArray *textview_scan_header      (TextView       *textview,
 static void textview_show_header       (TextView       *textview,
                                         GPtrArray      *headers);
 
-static void textview_key_pressed       (GtkWidget      *widget,
+static gint textview_key_pressed       (GtkWidget      *widget,
                                         GdkEventKey    *event,
                                         TextView       *textview);
 static gint textview_button_pressed    (GtkWidget      *widget,
@@ -1423,14 +1423,22 @@ static gboolean textview_smooth_scroll_page(TextView *textview, gboolean up)
        return TRUE;
 }
 
-static void textview_key_pressed(GtkWidget *widget, GdkEventKey *event,
+#define KEY_PRESS_EVENT_STOP() \
+       if (gtk_signal_n_emissions_by_name \
+               (GTK_OBJECT(widget), "key_press_event") > 0) { \
+               gtk_signal_emit_stop_by_name(GTK_OBJECT(widget), \
+                                            "key_press_event"); \
+       }
+
+static gint textview_key_pressed(GtkWidget *widget, GdkEventKey *event,
                                 TextView *textview)
 {
        SummaryView *summaryview = NULL;
+       MessageView *messageview = textview->messageview;
 
-       if (!event) return;
-       if (textview->messageview->mainwin)
-               summaryview = textview->messageview->mainwin->summaryview;
+       if (!event) return FALSE;
+       if (messageview->mainwin)
+               summaryview = messageview->mainwin->summaryview;
 
        switch (event->keyval) {
        case GDK_Tab:
@@ -1458,11 +1466,27 @@ static void textview_key_pressed(GtkWidget *widget, GdkEventKey *event,
                textview_scroll_one_line(textview,
                                         (event->state & GDK_MOD1_MASK) != 0);
                break;
+       case GDK_n:
+       case GDK_N:
+       case GDK_p:
+       case GDK_P:
+       case GDK_y:
+       case GDK_t:
+       case GDK_l:
+               if (messageview->type == MVIEW_MIME) {
+                       KEY_PRESS_EVENT_STOP();
+                       mimeview_pass_key_press_event(messageview->mimeview,
+                                                     event);
+                       break;
+               }
+               /* fall through */
        default:
                if (summaryview)
                        summary_pass_key_press_event(summaryview, event);
                break;
        }
+
+       return TRUE;
 }
 
 static gint textview_button_pressed(GtkWidget *widget, GdkEventButton *event,