From e2984b93b010e39b833f9fbb09c1c76d869befe9 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Fri, 13 Jan 2012 20:18:48 +0000 Subject: [PATCH] Rename time/sort/* to grid/sort/* Sorting lines doesn't effect the timing of them, and sorting by style doesn't even involve time in any way. Moving lines up and down is already in the grid category, so it seems logical to put sorting there as well. Originally committed to SVN as r6286. --- aegisub/src/command/grid.cpp | 41 +++++++++++++++++++++++ aegisub/src/command/time.cpp | 45 -------------------------- aegisub/src/libresrc/default_menu.json | 6 ++-- 3 files changed, 44 insertions(+), 48 deletions(-) diff --git a/aegisub/src/command/grid.cpp b/aegisub/src/command/grid.cpp index 7b2bdd969..7dbdd6ce8 100644 --- a/aegisub/src/command/grid.cpp +++ b/aegisub/src/command/grid.cpp @@ -76,8 +76,46 @@ struct grid_line_prev : public Command { void operator()(agi::Context *c) { c->subsGrid->PrevLine(); } +} +; +/// Sort all subtitles by their end times. +struct grid_sort_end : public Command { + CMD_NAME("grid/sort/end") + STR_MENU("&End Time") + STR_DISP("End Time") + STR_HELP("Sort all subtitles by their end times.") + + void operator()(agi::Context *c) { + c->ass->Sort(AssFile::CompEnd); + c->ass->Commit(_("sort"), AssFile::COMMIT_ORDER); + } }; +/// Sort all subtitles by their start times. +struct grid_sort_start : public Command { + CMD_NAME("grid/sort/start") + STR_MENU("&Start Time") + STR_DISP("Start Time") + STR_HELP("Sort all subtitles by their start times.") + + void operator()(agi::Context *c) { + c->ass->Sort(); + c->ass->Commit(_("sort"), AssFile::COMMIT_ORDER); + } +}; + +/// Sort all subtitles by their style names. +struct grid_sort_style : public Command { + CMD_NAME("grid/sort/style") + STR_MENU("St&yle Name") + STR_DISP("Style Name") + STR_HELP("Sort all subtitles by their style names.") + + void operator()(agi::Context *c) { + c->ass->Sort(AssFile::CompStyle); + c->ass->Commit(_("sort"), AssFile::COMMIT_ORDER); + } +}; /// Cycle through tag hiding modes. struct grid_tag_cycle_hiding : public Command { @@ -221,6 +259,9 @@ namespace cmd { void init_grid() { reg(new grid_line_next); reg(new grid_line_prev); + reg(new grid_sort_end); + reg(new grid_sort_start); + reg(new grid_sort_style); reg(new grid_swap_down); reg(new grid_swap_up); reg(new grid_tag_cycle_hiding); diff --git a/aegisub/src/command/time.cpp b/aegisub/src/command/time.cpp index 22b997c32..212d0261b 100644 --- a/aegisub/src/command/time.cpp +++ b/aegisub/src/command/time.cpp @@ -283,48 +283,6 @@ struct time_snap_start_video : public validate_video_loaded { } }; - -/// Sort all subtitles by their end times. -struct time_sort_end : public Command { - CMD_NAME("time/sort/end") - STR_MENU("&End Time") - STR_DISP("End Time") - STR_HELP("Sort all subtitles by their end times.") - - void operator()(agi::Context *c) { - c->ass->Sort(AssFile::CompEnd); - c->ass->Commit(_("sort"), AssFile::COMMIT_ORDER); - } -}; - - -/// Sort all subtitles by their start times. -struct time_sort_start : public Command { - CMD_NAME("time/sort/start") - STR_MENU("&Start Time") - STR_DISP("Start Time") - STR_HELP("Sort all subtitles by their start times.") - - void operator()(agi::Context *c) { - c->ass->Sort(); - c->ass->Commit(_("sort"), AssFile::COMMIT_ORDER); - } -}; - - -/// Sort all subtitles by their style names. -struct time_sort_style : public Command { - CMD_NAME("time/sort/style") - STR_MENU("St&yle Name") - STR_DISP("Style Name") - STR_HELP("Sort all subtitles by their style names.") - - void operator()(agi::Context *c) { - c->ass->Sort(AssFile::CompStyle); - c->ass->Commit(_("sort"), AssFile::COMMIT_ORDER); - } -}; - /// Switch to the next timeable thing (line or syllable) struct time_next : public Command { CMD_NAME("time/next") @@ -369,8 +327,5 @@ namespace cmd { reg(new time_snap_end_video); reg(new time_snap_scene); reg(new time_snap_start_video); - reg(new time_sort_end); - reg(new time_sort_start); - reg(new time_sort_style); } } diff --git a/aegisub/src/libresrc/default_menu.json b/aegisub/src/libresrc/default_menu.json index 24677fb68..569fb0b30 100644 --- a/aegisub/src/libresrc/default_menu.json +++ b/aegisub/src/libresrc/default_menu.json @@ -100,9 +100,9 @@ { "command" : "edit/line/join/as_karaoke" } ], "main/subtitle/sort lines" : [ - { "command" : "time/sort/start" }, - { "command" : "time/sort/end" }, - { "command" : "time/sort/style" } + { "command" : "grid/sort/start" }, + { "command" : "grid/sort/end" }, + { "command" : "grid/sort/style" } ], "main/timing" : [ { "command" : "time/shift" },