Project

General

Profile

Feature #301 » sylpheed_vi_keybind.patch

Yoshinari Takaoka, 05/04/2018 08:16 PM

View differences:

src/mainwindow.c (working copy)
481 481
static void next_labeled_cb	 (MainWindow	*mainwin,
482 482
				  guint		 action,
483 483
				  GtkWidget	*widget);
484

  
484
static void latest_cb		 (MainWindow	*mainwin,
485
				  guint		 action,
486
				  GtkWidget	*widget);
485 487
static void goto_folder_cb	 (MainWindow	*mainwin,
486 488
				  guint		 action,
487 489
				  GtkWidget	*widget);
......
680 682
	{N_("/_View/_Go to/Next la_beled message"),
681 683
						NULL, next_labeled_cb, 0, NULL},
682 684
	{N_("/_View/_Go to/---"),		NULL, NULL, 0, "<Separator>"},
685
	{N_("/_View/_Go to/La_test message"),
686
						NULL, latest_cb, 0, NULL},
687
	{N_("/_View/_Go to/---"),		NULL, NULL, 0, "<Separator>"},
683 688
	{N_("/_View/_Go to/Other _folder..."),	"G", goto_folder_cb, 0, NULL},
684 689
	{N_("/_View/---"),			NULL, NULL, 0, "<Separator>"},
685 690

  
......
2176 2181
		{"/View/Go to/Next marked message" , M_MSG_EXIST},
2177 2182
		{"/View/Go to/Prev labeled message", M_MSG_EXIST},
2178 2183
		{"/View/Go to/Next labeled message", M_MSG_EXIST},
2184
		{"/View/Go to/Latest message"      , M_MSG_EXIST},
2179 2185
		{"/View/Open in new window"        , M_SINGLE_TARGET_EXIST},
2180 2186
		{"/View/All headers"          , M_SINGLE_TARGET_EXIST},
2181 2187
		{"/View/Message source"            , M_SINGLE_TARGET_EXIST},
......
3962 3968
	summary_select_next_labeled(mainwin->summaryview);
3963 3969
}
3964 3970

  
3971
static void latest_cb(MainWindow *mainwin, guint action,
3972
			    GtkWidget *widget)
3973
{
3974
	summary_select_latest(mainwin->summaryview);
3975
}
3976

  
3965 3977
static void goto_folder_cb(MainWindow *mainwin, guint action,
3966 3978
			   GtkWidget *widget)
3967 3979
{
src/prefs_common_dialog.c (working copy)
4090 4090
			       _("Default"),
4091 4091
			       "Mew / Wanderlust",
4092 4092
			       "Mutt",
4093
			       _("vi flavored"),
4093 4094
			       _("Old Sylpheed"),
4094 4095
			       NULL);
4095 4096
	gtk_editable_set_editable
......
4186 4187
		{"<Main>/View/Go to/Next message",		"N"},
4187 4188
		{"<Main>/View/Go to/Prev unread message",	"<shift>P"},
4188 4189
		{"<Main>/View/Go to/Next unread message",	"<shift>N"},
4190
		{"<Main>/View/Go to/Latest message",	"<shift>G"},
4189 4191
		{"<Main>/View/Go to/Other folder...",		"G"},
4190 4192
		{"<Main>/View/Open in new window",		"<control><alt>N"},
4191 4193
		{"<Main>/View/View source",			"<control>U"},
......
4234 4236
		{"<Main>/View/Go to/Next message",		"N"},
4235 4237
		{"<Main>/View/Go to/Prev unread message",	"<shift>P"},
4236 4238
		{"<Main>/View/Go to/Next unread message",	"<shift>N"},
4239
		{"<Main>/View/Go to/Latest message",	"<shift>G"},
4237 4240
		{"<Main>/View/Go to/Other folder...",		"G"},
4238 4241
		{"<Main>/View/Open in new window",		"<control><alt>N"},
4239 4242
		{"<Main>/View/View source",			"<control>U"},
......
4282 4285
		{"<Main>/View/Go to/Next message",		""},
4283 4286
		{"<Main>/View/Go to/Prev unread message",	""},
4284 4287
		{"<Main>/View/Go to/Next unread message",	""},
4288
		{"<Main>/View/Go to/Latest message",	""},
4285 4289
		{"<Main>/View/Go to/Other folder...",		"C"},
4286 4290
		{"<Main>/View/Open in new window",		"<control><alt>N"},
4287 4291
		{"<Main>/View/View source",			"<control>U"},
......
4313 4317
		{"<Compose>/Edit/Select all",			""},
4314 4318
	};
4315 4319

  
4320
	static struct KeyBind vim_flavored_menurc[] = {
4321
		{"<Main>/File/Empty all trash",			""},
4322
		{"<Main>/File/Save as...",			"<control>S"},
4323
		{"<Main>/File/Print...",			""},
4324
		{"<Main>/File/Exit",				"<control>Q"},
4325

  
4326
		{"<Main>/Edit/Copy",				"<control>C"},
4327
		{"<Main>/Edit/Select all",			"<control>A"},
4328
		{"<Main>/Edit/Find in current message...",	"<control>F"},
4329
		{"<Main>/Edit/Search messages...",		"<shift><control>F"},
4330

  
4331
		{"<Main>/View/Show or hide/Message view",	"V"},
4332
		{"<Main>/View/Thread view",			"<control>T"},
4333
		{"<Main>/View/Go to/Prev message",		"k"},
4334
		{"<Main>/View/Go to/Next message",		"j"},
4335
		{"<Main>/View/Go to/Prev unread message",	"<shift>K"},
4336
		{"<Main>/View/Go to/Next unread message",	"<shift>J"},
4337
		{"<Main>/View/Go to/Latest message",	"<shift>G"},
4338
		{"<Main>/View/Go to/Other folder...",		"g"},
4339
		{"<Main>/View/Open in new window",		"<control><alt>N"},
4340
		{"<Main>/View/View source",			"<control>U"},
4341
		{"<Main>/View/Show all headers",		"<control>H"},
4342
		{"<Main>/View/Update",				"<control><alt>U"},
4343

  
4344
		{"<Main>/Message/Receive/Get new mail",			"<control>I"},
4345
		{"<Main>/Message/Receive/Get from all accounts",	"<shift><control>I"},
4346
		{"<Main>/Message/Compose new message",		"<control>M"},
4347
		{"<Main>/Message/Reply",			"<control>R"},
4348
		{"<Main>/Message/Reply to/all",			"<shift><control>R"},
4349
		{"<Main>/Message/Reply to/sender",		""},
4350
		{"<Main>/Message/Reply to/mailing list",	"<control>L"},
4351
		{"<Main>/Message/Forward",			"<control><alt>F"},
4352
		{"<Main>/Message/Forward as attachment",	""},
4353
		{"<Main>/Message/Move...",			"<control>O"},
4354
		{"<Main>/Message/Copy...",			"<shift><control>O"},
4355
		{"<Main>/Message/Delete",			"<control>D"},
4356
		{"<Main>/Message/Mark/Set flag",		"<shift>asterisk"},
4357
		{"<Main>/Message/Mark/Unset flag",		"U"},
4358
		{"<Main>/Message/Mark/Mark as unread",		"<shift>exclam"},
4359
		{"<Main>/Message/Mark/Mark as read",		""},
4360

  
4361
		{"<Main>/Tools/Address book",			"<shift><control>A"},
4362
		{"<Main>/Tools/Execute",			"X"},
4363
		{"<Main>/Tools/Log window",			"<shift><control>L"},
4364

  
4365
		{"<Compose>/File/Close",			"<control>W"},
4366
		{"<Compose>/Edit/Select all",			"<control>A"},
4367
	};
4368

  
4316 4369
	static struct KeyBind old_sylpheed_menurc[] = {
4317 4370
		{"<Main>/File/Empty all trash",			""},
4318 4371
		{"<Main>/File/Save as...",			""},
......
4330 4383
		{"<Main>/View/Go to/Next message",		"N"},
4331 4384
		{"<Main>/View/Go to/Prev unread message",	"<shift>P"},
4332 4385
		{"<Main>/View/Go to/Next unread message",	"<shift>N"},
4386
		{"<Main>/View/Go to/Latest message",	"<shift>G"},
4333 4387
		{"<Main>/View/Go to/Other folder...",		"<alt>G"},
4334 4388
		{"<Main>/View/Open in new window",		"<shift><control>N"},
4335 4389
		{"<Main>/View/View source",			"<control>U"},
......
4378 4432
		{"<Main>/View/Go to/Next message",		""},
4379 4433
		{"<Main>/View/Go to/Prev unread message",	""},
4380 4434
		{"<Main>/View/Go to/Next unread message",	""},
4435
		{"<Main>/View/Go to/Latest message",	""},
4381 4436
		{"<Main>/View/Go to/Other folder...",		""},
4382 4437
		{"<Main>/View/Open in new window",		""},
4383 4438
		{"<Main>/View/View source",			""},
......
4420 4475
	} else if (!strcmp(text, "Mutt")) {
4421 4476
		menurc = mutt_menurc;
4422 4477
		n_menurc = G_N_ELEMENTS(mutt_menurc);
4478
	} else if (!strcmp(text, _("vi flavored"))) {
4479
		menurc = vim_flavored_menurc;
4480
		n_menurc = G_N_ELEMENTS(vim_flavored_menurc);
4423 4481
	} else if (!strcmp(text, _("Old Sylpheed"))) {
4424 4482
		menurc = old_sylpheed_menurc;
4425 4483
		n_menurc = G_N_ELEMENTS(old_sylpheed_menurc);
src/summaryview.c (working copy)
1714 1714
				    _("No labeled messages."));
1715 1715
}
1716 1716

  
1717
void summary_select_latest(SummaryView *summaryview)
1718
{
1719
	GtkTreeModel *model = GTK_TREE_MODEL(summaryview->store);
1720
	GtkTreeIter iter;
1721
	gboolean valid = TRUE;
1722

  
1723
	valid = gtkut_tree_model_get_iter_last(model, &iter);
1724
	if (valid) {
1725
		summary_select_row(summaryview, &iter, FALSE, TRUE);
1726
	}
1727
}
1728

  
1717 1729
void summary_select_by_msgnum(SummaryView *summaryview, guint msgnum)
1718 1730
{
1719 1731
	GtkTreeIter iter;
src/summaryview.h (working copy)
209 209
void summary_select_next_marked	  (SummaryView		*summaryview);
210 210
void summary_select_prev_labeled  (SummaryView		*summaryview);
211 211
void summary_select_next_labeled  (SummaryView		*summaryview);
212
void summary_select_latest		  (SummaryView		*summaryview);
212 213
void summary_select_by_msgnum	  (SummaryView		*summaryview,
213 214
				   guint		 msgnum);
214 215
gboolean summary_select_by_msginfo(SummaryView		*summaryview,
(1-1/2)