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.
This commit is contained in:
Thomas Goyne 2012-01-13 20:18:48 +00:00
parent 1bcbc728c8
commit e2984b93b0
3 changed files with 44 additions and 48 deletions

View File

@ -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);

View File

@ -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);
}
}

View File

@ -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" },