[Commits] messageview.c 1.94.2.221 1.94.2.222 mimeview.c 1.83.2.176 1.83.2.177 mimeview.h 1.20.2.33 1.20.2.34 summaryview.c 1.395.2.435 1.395.2.436

pawel at claws-mail.org pawel at claws-mail.org
Mon Oct 31 22:46:22 CET 2011


Update of /home/claws-mail/claws/src
In directory claws-mail:/tmp/cvs-serv2297/src

Modified Files:
      Tag: gtk2
	messageview.c mimeview.c mimeview.h summaryview.c 
Log Message:
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

Index: messageview.c
===================================================================
RCS file: /home/claws-mail/claws/src/messageview.c,v
retrieving revision 1.94.2.221
retrieving revision 1.94.2.222
diff -u -d -r1.94.2.221 -r1.94.2.222
--- messageview.c	25 Oct 2011 07:22:55 -0000	1.94.2.221
+++ messageview.c	31 Oct 2011 21:46:20 -0000	1.94.2.222
@@ -1727,10 +1727,7 @@
 	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: summaryview.c
===================================================================
RCS file: /home/claws-mail/claws/src/summaryview.c,v
retrieving revision 1.395.2.435
retrieving revision 1.395.2.436
diff -u -d -r1.395.2.435 -r1.395.2.436
--- summaryview.c	31 Oct 2011 18:57:50 -0000	1.395.2.435
+++ summaryview.c	31 Oct 2011 21:46:20 -0000	1.395.2.436
@@ -6670,6 +6670,7 @@
 	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");

Index: mimeview.c
===================================================================
RCS file: /home/claws-mail/claws/src/mimeview.c,v
retrieving revision 1.83.2.176
retrieving revision 1.83.2.177
diff -u -d -r1.83.2.176 -r1.83.2.177
--- mimeview.c	30 Oct 2011 16:59:12 -0000	1.83.2.176
+++ mimeview.c	31 Oct 2011 21:46:20 -0000	1.83.2.177
@@ -194,6 +194,11 @@
 	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 @@
 	{ "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 @@
 	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 @@
 }
 
 
-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 @@
 	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 @@
 		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 @@
 		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: mimeview.h
===================================================================
RCS file: /home/claws-mail/claws/src/mimeview.h,v
retrieving revision 1.20.2.33
retrieving revision 1.20.2.34
diff -u -d -r1.20.2.33 -r1.20.2.34
--- mimeview.h	7 Oct 2011 09:40:15 -0000	1.20.2.33
+++ mimeview.h	31 Oct 2011 21:46:20 -0000	1.20.2.34
@@ -161,7 +161,7 @@
 
 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);



More information about the Commits mailing list