2011-10-31 [pawel] 3.7.10cvs66
authorPaweł Pękala <c0rn@gazeta.pl>
Mon, 31 Oct 2011 21:46:22 +0000 (21:46 +0000)
committerPaweł Pękala <c0rn@gazeta.pl>
Mon, 31 Oct 2011 21:46:22 +0000 (21:46 +0000)
* src/messageview.c
* src/mimeview.c
* src/mimeview.h
* src/summaryview.c
Fix bug #2526 'When reading message in separate window,
n and p keys do not work'
- fix key event handling in messageview
- remove bindings for 'n' and 'p' keys in mimeview (next-part
  and prev-part actions)
- instead add 'z' key for prev-part, we have 'a' key
  for next-part already

ChangeLog
PATCHSETS
configure.ac
src/messageview.c
src/mimeview.c
src/mimeview.h
src/summaryview.c

index dab38cd..628a9f4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2011-10-31 [pawel]     3.7.10cvs66
+
+       * src/messageview.c
+       * src/mimeview.c
+       * src/mimeview.h
+       * src/summaryview.c
+               Fix bug #2526 'When reading message in separate window,
+               n and p keys do not work'
+               - fix key event handling in messageview
+               - remove bindings for 'n' and 'p' keys in mimeview (next-part
+                 and prev-part actions)
+               - instead add 'z' key for prev-part, we have 'a' key 
+                 for next-part already
+
 2011-10-31 [colin]     3.7.10cvs65
 
        * src/common/defs.h
index 28a9dd8..d8e4a82 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.12.2.78 -r 1.12.2.79 src/prefs_template.c;  ) > 3.7.10cvs63.patchset
 ( cvs diff -u -r 1.395.2.434 -r 1.395.2.435 src/summaryview.c;  cvs diff -u -r 1.5.2.100 -r 1.5.2.101 src/gtk/gtkutils.c;  ) > 3.7.10cvs64.patchset
 ( cvs diff -u -r 1.9.2.52 -r 1.9.2.53 src/common/defs.h;  ) > 3.7.10cvs65.patchset
+( cvs diff -u -r 1.94.2.221 -r 1.94.2.222 src/messageview.c;  cvs diff -u -r 1.83.2.176 -r 1.83.2.177 src/mimeview.c;  cvs diff -u -r 1.20.2.33 -r 1.20.2.34 src/mimeview.h;  cvs diff -u -r 1.395.2.435 -r 1.395.2.436 src/summaryview.c;  ) > 3.7.10cvs66.patchset
index 3f47e12..a15dccd 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=10
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=65
+EXTRA_VERSION=66
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 5524362..6e94f5e 100644 (file)
@@ -1727,10 +1727,7 @@ static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event,
        if (event && (event->state & GDK_SHIFT_MASK) && event->keyval != GDK_KEY_space) 
                return FALSE;
 
-       g_signal_stop_emission_by_name(G_OBJECT(widget),
-                                       "key_press_event");
-       mimeview_pass_key_press_event(messageview->mimeview, event);
-       return FALSE;
+       return mimeview_pass_key_press_event(messageview->mimeview, event);
 }
 #endif
 
index 7bf8510..57688f5 100644 (file)
@@ -194,6 +194,11 @@ static void mimeview_select_next_part_cb(GtkAction *action, gpointer data)
        mimeview_select_next_part((MimeView *)data);
 }
 
+static void mimeview_select_prev_part_cb(GtkAction *action, gpointer data)
+{
+       mimeview_select_prev_part((MimeView *)data);
+}
+
 static GtkActionEntry mimeview_menu_actions[] = {
        { "MimeView", NULL, "MimeView" },
        { "MimeView/Open", NULL, N_("_Open (l)"), NULL, "Open MIME part", G_CALLBACK(mimeview_launch_cb) },
@@ -203,7 +208,8 @@ static GtkActionEntry mimeview_menu_actions[] = {
        { "MimeView/DisplayAsText", NULL, N_("_Display as text (t)"), NULL, "Display as text", G_CALLBACK(mimeview_display_as_text_cb) },
        { "MimeView/SaveAs", NULL, N_("_Save as (y)..."), NULL, "Save as", G_CALLBACK(mimeview_save_as_cb) },
        { "MimeView/SaveAll", NULL, N_("Save _all..."), NULL, "Save all parts", G_CALLBACK(mimeview_save_all_cb) },
-       { "MimeView/NextPart", NULL, N_("Next part (a)"), NULL, "Next part", G_CALLBACK(mimeview_select_next_part_cb) }
+       { "MimeView/NextPart", NULL, N_("Next part (a)"), NULL, "Next part", G_CALLBACK(mimeview_select_next_part_cb) },
+       { "MimeView/PrevPart", NULL, N_("Previous part (z)"), NULL, "Previous part", G_CALLBACK(mimeview_select_prev_part_cb) }
 };
 
 static GtkTargetEntry mimeview_mime_types[] =
@@ -387,6 +393,9 @@ MimeView *mimeview_create(MainWindow *mainwin)
        MENUITEM_ADDUI_MANAGER(mimeview->ui_manager, 
                        "/Menus/MimeView/", "NextPart", "MimeView/NextPart",
                        GTK_UI_MANAGER_MENUITEM);
+       MENUITEM_ADDUI_MANAGER(mimeview->ui_manager, 
+                       "/Menus/MimeView/", "PrevPart", "MimeView/PrevPart",
+                       GTK_UI_MANAGER_MENUITEM);
 
        popupmenu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(
                                gtk_ui_manager_get_widget(mimeview->ui_manager, "/Menus/MimeView")) );
@@ -1378,9 +1387,9 @@ static gboolean part_button_pressed(MimeView *mimeview, GdkEventButton *event,
 }
 
 
-void mimeview_pass_key_press_event(MimeView *mimeview, GdkEventKey *event)
+gboolean mimeview_pass_key_press_event(MimeView *mimeview, GdkEventKey *event)
 {
-       mimeview_key_pressed(mimeview->ctree, event, mimeview);
+       return mimeview_key_pressed(mimeview->ctree, event, mimeview);
 }
 
 static void mimeview_select_next_part(MimeView *mimeview)
@@ -1465,18 +1474,6 @@ static gint mimeview_key_pressed(GtkWidget *widget, GdkEventKey *event,
        case GDK_KEY_Down:
                mimeview_scroll_one_line(mimeview, (event->keyval == GDK_KEY_Up));
                return TRUE;
-       case GDK_KEY_n:
-       case GDK_KEY_N:
-               BREAK_ON_MODIFIER_KEY();
-               mimeview_select_next_part(mimeview);
-               return TRUE;
-
-       case GDK_KEY_p:
-       case GDK_KEY_P:
-               BREAK_ON_MODIFIER_KEY();
-               mimeview_select_prev_part(mimeview);
-               return TRUE;
-
        case GDK_KEY_y:
                BREAK_ON_MODIFIER_KEY();
                mimeview_save_as(mimeview);
@@ -1503,11 +1500,15 @@ static gint mimeview_key_pressed(GtkWidget *widget, GdkEventKey *event,
                BREAK_ON_MODIFIER_KEY();
                mimeview_select_next_part(mimeview);
                return TRUE;
+       case GDK_KEY_z:
+               BREAK_ON_MODIFIER_KEY();
+               mimeview_select_prev_part(mimeview);
+               return TRUE;
        default:
                break;
        }
 
-       if (!mimeview->messageview->mainwin) return FALSE;
+       if (mimeview->messageview->new_window) return FALSE;
 
        return summary_pass_key_press_event(summaryview, event);
 }
@@ -2168,19 +2169,6 @@ static gint icon_key_pressed(GtkWidget *button, GdkEventKey *event,
                mimeview_scroll_one_line(mimeview,
                                         (event->state & GDK_MOD1_MASK) != 0);
                return TRUE;
-
-       case GDK_KEY_n:
-       case GDK_KEY_N:
-               BREAK_ON_MODIFIER_KEY();
-               mimeview_select_next_part(mimeview);
-               return TRUE;
-               
-       case GDK_KEY_p:
-       case GDK_KEY_P:
-               BREAK_ON_MODIFIER_KEY();
-               mimeview_select_prev_part(mimeview);
-               break;
-
        case GDK_KEY_y:
                BREAK_ON_MODIFIER_KEY();
                mimeview_save_as(mimeview);
index 0432559..7a97414 100644 (file)
@@ -161,7 +161,7 @@ void mimeview_clear         (MimeView       *mimeview);
 
 MimeInfo *mimeview_get_selected_part   (MimeView       *mimeview);
 
-void mimeview_pass_key_press_event     (MimeView       *mimeview,
+gboolean mimeview_pass_key_press_event (MimeView       *mimeview,
                                         GdkEventKey    *event);
 
 void mimeview_register_viewer_factory  (MimeViewerFactory *factory);
index aa5b39a..b468f41 100644 (file)
@@ -6670,6 +6670,7 @@ static gboolean summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
        case GDK_KEY_o:
        case GDK_KEY_c:
        case GDK_KEY_a:
+       case GDK_KEY_z:
                if ((event->state & (GDK_MOD1_MASK|GDK_CONTROL_MASK)) == 0) {
                        g_signal_stop_emission_by_name(G_OBJECT(widget), 
                                        "key_press_event");