Add Layer to the things lines can be sorted by

Originally committed to SVN as r6939.
This commit is contained in:
Thomas Goyne 2012-07-23 00:44:44 +00:00
parent f3a935c985
commit 11a4ede9a0
6 changed files with 88 additions and 37 deletions

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Aegisub 3.0.0\n" "Project-Id-Version: Aegisub 3.0.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-07-14 09:42-0700\n" "POT-Creation-Date: 2012-07-22 17:02-0700\n"
"PO-Revision-Date: 2005-2012-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: 2005-2012-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -75,7 +75,8 @@ msgstr ""
msgid "Line Number" msgid "Line Number"
msgstr "" msgstr ""
#: ../src/base_grid.cpp:784 ../src/dialog_paste_over.cpp:62 #: ../src/base_grid.cpp:784 ../src/command/grid.cpp:194
#: ../src/command/grid.cpp:207 ../src/dialog_paste_over.cpp:62
msgid "Layer" msgid "Layer"
msgstr "" msgstr ""
@ -2063,6 +2064,7 @@ msgstr ""
#: ../src/command/grid.cpp:173 ../src/command/grid.cpp:186 #: ../src/command/grid.cpp:173 ../src/command/grid.cpp:186
#: ../src/command/grid.cpp:199 ../src/command/grid.cpp:212 #: ../src/command/grid.cpp:199 ../src/command/grid.cpp:212
#: ../src/command/grid.cpp:225 ../src/command/grid.cpp:238 #: ../src/command/grid.cpp:225 ../src/command/grid.cpp:238
#: ../src/command/grid.cpp:251 ../src/command/grid.cpp:264
msgid "sort" msgid "sort"
msgstr "" msgstr ""
@ -2100,125 +2102,137 @@ msgid "Sort selected subtitles by their end times"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:193 ../src/command/grid.cpp:206 #: ../src/command/grid.cpp:193 ../src/command/grid.cpp:206
msgid "&Layer"
msgstr ""
#: ../src/command/grid.cpp:195
msgid "Sort all subtitles by their layer number"
msgstr ""
#: ../src/command/grid.cpp:208
msgid "Sort selected subtitles by their layer number"
msgstr ""
#: ../src/command/grid.cpp:219 ../src/command/grid.cpp:232
msgid "&Start Time" msgid "&Start Time"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:194 ../src/command/grid.cpp:207 #: ../src/command/grid.cpp:220 ../src/command/grid.cpp:233
#: ../src/dialog_paste_over.cpp:63 #: ../src/dialog_paste_over.cpp:63
msgid "Start Time" msgid "Start Time"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:195 #: ../src/command/grid.cpp:221
msgid "Sort all subtitles by their start times" msgid "Sort all subtitles by their start times"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:208 #: ../src/command/grid.cpp:234
msgid "Sort selected subtitles by their start times" msgid "Sort selected subtitles by their start times"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:219 ../src/command/grid.cpp:232 #: ../src/command/grid.cpp:245 ../src/command/grid.cpp:258
msgid "St&yle Name" msgid "St&yle Name"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:220 ../src/command/grid.cpp:233 #: ../src/command/grid.cpp:246 ../src/command/grid.cpp:259
#: ../src/dialog_style_editor.cpp:180 #: ../src/dialog_style_editor.cpp:180
msgid "Style Name" msgid "Style Name"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:221 #: ../src/command/grid.cpp:247
msgid "Sort all subtitles by their style names" msgid "Sort all subtitles by their style names"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:234 #: ../src/command/grid.cpp:260
msgid "Sort selected subtitles by their style names" msgid "Sort selected subtitles by their style names"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:245 ../src/command/grid.cpp:246 #: ../src/command/grid.cpp:271 ../src/command/grid.cpp:272
msgid "Cycle Tag Hiding Mode" msgid "Cycle Tag Hiding Mode"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:247 #: ../src/command/grid.cpp:273
msgid "Cycle through tag hiding modes" msgid "Cycle through tag hiding modes"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:257 #: ../src/command/grid.cpp:283
msgid "ASS Override Tag mode set to show full tags." msgid "ASS Override Tag mode set to show full tags."
msgstr "" msgstr ""
#: ../src/command/grid.cpp:258 #: ../src/command/grid.cpp:284
msgid "ASS Override Tag mode set to simplify tags." msgid "ASS Override Tag mode set to simplify tags."
msgstr "" msgstr ""
#: ../src/command/grid.cpp:259 #: ../src/command/grid.cpp:285
msgid "ASS Override Tag mode set to hide tags." msgid "ASS Override Tag mode set to hide tags."
msgstr "" msgstr ""
#: ../src/command/grid.cpp:271 #: ../src/command/grid.cpp:297
msgid "&Hide Tags" msgid "&Hide Tags"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:272 #: ../src/command/grid.cpp:298
msgid "Hide Tags" msgid "Hide Tags"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:273 #: ../src/command/grid.cpp:299
msgid "Hide override tags in the subtitle grid" msgid "Hide override tags in the subtitle grid"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:289 #: ../src/command/grid.cpp:315
msgid "Sh&ow Tags" msgid "Sh&ow Tags"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:290 #: ../src/command/grid.cpp:316
msgid "Show Tags" msgid "Show Tags"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:291 #: ../src/command/grid.cpp:317
msgid "Show full override tags in the subtitle grid" msgid "Show full override tags in the subtitle grid"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:307 #: ../src/command/grid.cpp:333
msgid "S&implify Tags" msgid "S&implify Tags"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:308 #: ../src/command/grid.cpp:334
msgid "Simplify Tags" msgid "Simplify Tags"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:309 #: ../src/command/grid.cpp:335
msgid "" msgid ""
"Replace override tags in the subtitle grid with a simplified placeholder" "Replace override tags in the subtitle grid with a simplified placeholder"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:345 ../src/command/grid.cpp:346 #: ../src/command/grid.cpp:371 ../src/command/grid.cpp:372
msgid "Move line up" msgid "Move line up"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:347 #: ../src/command/grid.cpp:373
msgid "Move the selected lines up one row" msgid "Move the selected lines up one row"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:356 ../src/command/grid.cpp:374 #: ../src/command/grid.cpp:382 ../src/command/grid.cpp:400
msgid "move lines" msgid "move lines"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:363 ../src/command/grid.cpp:364 #: ../src/command/grid.cpp:389 ../src/command/grid.cpp:390
msgid "Move line down" msgid "Move line down"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:365 #: ../src/command/grid.cpp:391
msgid "Move the selected lines down one row" msgid "Move the selected lines down one row"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:381 ../src/command/grid.cpp:382 #: ../src/command/grid.cpp:407 ../src/command/grid.cpp:408
msgid "Swap Lines" msgid "Swap Lines"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:383 #: ../src/command/grid.cpp:409
msgid "Swaps the two selected lines" msgid "Swaps the two selected lines"
msgstr "" msgstr ""
#: ../src/command/grid.cpp:398 #: ../src/command/grid.cpp:424
msgid "swap lines" msgid "swap lines"
msgstr "" msgstr ""
@ -4058,7 +4072,7 @@ msgstr ""
msgid "T&ext" msgid "T&ext"
msgstr "" msgstr ""
#: ../src/main.cpp:323 #: ../src/main.cpp:325
#, c-format #, c-format
msgid "" msgid ""
"Oops, Aegisub has crashed!\n" "Oops, Aegisub has crashed!\n"
@ -4070,7 +4084,7 @@ msgid ""
"Aegisub will now close." "Aegisub will now close."
msgstr "" msgstr ""
#: ../src/main.cpp:348 ../src/main.cpp:357 #: ../src/main.cpp:350 ../src/main.cpp:359
msgid "Program error" msgid "Program error"
msgstr "" msgstr ""

View file

@ -692,6 +692,9 @@ bool AssFile::CompActor(const AssDialogue* lft, const AssDialogue* rgt) {
bool AssFile::CompEffect(const AssDialogue* lft, const AssDialogue* rgt) { bool AssFile::CompEffect(const AssDialogue* lft, const AssDialogue* rgt) {
return lft->Effect < rgt->Effect; return lft->Effect < rgt->Effect;
} }
bool AssFile::CompLayer(const AssDialogue* lft, const AssDialogue* rgt) {
return lft->Layer < rgt->Layer;
}
void AssFile::Sort(CompFunc comp, std::set<AssDialogue*> const& limit) { void AssFile::Sort(CompFunc comp, std::set<AssDialogue*> const& limit) {
Sort(Line, comp, limit); Sort(Line, comp, limit);

View file

@ -239,6 +239,8 @@ public:
static bool CompActor(const AssDialogue* lft, const AssDialogue* rgt); static bool CompActor(const AssDialogue* lft, const AssDialogue* rgt);
/// Compare based on effect /// Compare based on effect
static bool CompEffect(const AssDialogue* lft, const AssDialogue* rgt); static bool CompEffect(const AssDialogue* lft, const AssDialogue* rgt);
/// Compare based on layer
static bool CompLayer(const AssDialogue* lft, const AssDialogue* rgt);
/// @brief Sort the dialogue lines in this file /// @brief Sort the dialogue lines in this file
/// @param comp Comparison function to use. Defaults to sorting by start time. /// @param comp Comparison function to use. Defaults to sorting by start time.

View file

@ -187,6 +187,32 @@ struct grid_sort_end_selected : public validate_sel_multiple {
} }
}; };
/// Sort all subtitles by their layer number.
struct grid_sort_layer : public Command {
CMD_NAME("grid/sort/layer")
STR_MENU("&Layer")
STR_DISP("Layer")
STR_HELP("Sort all subtitles by their layer number")
void operator()(agi::Context *c) {
c->ass->Sort(AssFile::CompLayer);
c->ass->Commit(_("sort"), AssFile::COMMIT_ORDER);
}
};
/// Sort all selected subtitles by their layer number.
struct grid_sort_layer_selected : public validate_sel_multiple {
CMD_NAME("grid/sort/layer/selected")
STR_MENU("&Layer")
STR_DISP("Layer")
STR_HELP("Sort selected subtitles by their layer number")
void operator()(agi::Context *c) {
c->ass->Sort(AssFile::CompLayer, c->selectionController->GetSelectedSet());
c->ass->Commit(_("sort"), AssFile::COMMIT_ORDER);
}
};
/// Sort all subtitles by their start times. /// Sort all subtitles by their start times.
struct grid_sort_start : public Command { struct grid_sort_start : public Command {
CMD_NAME("grid/sort/start") CMD_NAME("grid/sort/start")
@ -411,11 +437,13 @@ namespace cmd {
reg(new grid_sort_actor); reg(new grid_sort_actor);
reg(new grid_sort_effect); reg(new grid_sort_effect);
reg(new grid_sort_end); reg(new grid_sort_end);
reg(new grid_sort_layer);
reg(new grid_sort_start); reg(new grid_sort_start);
reg(new grid_sort_style); reg(new grid_sort_style);
reg(new grid_sort_actor_selected); reg(new grid_sort_actor_selected);
reg(new grid_sort_effect_selected); reg(new grid_sort_effect_selected);
reg(new grid_sort_end_selected); reg(new grid_sort_end_selected);
reg(new grid_sort_layer_selected);
reg(new grid_sort_start_selected); reg(new grid_sort_start_selected);
reg(new grid_sort_style_selected); reg(new grid_sort_style_selected);
reg(new grid_move_down); reg(new grid_move_down);

View file

@ -106,14 +106,16 @@
{ "command" : "grid/sort/end" }, { "command" : "grid/sort/end" },
{ "command" : "grid/sort/style" }, { "command" : "grid/sort/style" },
{ "command" : "grid/sort/actor" }, { "command" : "grid/sort/actor" },
{ "command" : "grid/sort/effect" } { "command" : "grid/sort/effect" },
{ "command" : "grid/sort/layer" }
], ],
"main/subtitle/sort selected lines" : [ "main/subtitle/sort selected lines" : [
{ "command" : "grid/sort/start/selected" }, { "command" : "grid/sort/start/selected" },
{ "command" : "grid/sort/end/selected" }, { "command" : "grid/sort/end/selected" },
{ "command" : "grid/sort/style/selected" }, { "command" : "grid/sort/style/selected" },
{ "command" : "grid/sort/actor/selected" }, { "command" : "grid/sort/actor/selected" },
{ "command" : "grid/sort/effect/selected" } { "command" : "grid/sort/effect/selected" },
{ "command" : "grid/sort/layer/selected" }
], ],
"main/timing" : [ "main/timing" : [
{ "command" : "time/shift" }, { "command" : "time/shift" },

View file

@ -105,14 +105,16 @@
{ "command" : "grid/sort/end" }, { "command" : "grid/sort/end" },
{ "command" : "grid/sort/style" }, { "command" : "grid/sort/style" },
{ "command" : "grid/sort/actor" }, { "command" : "grid/sort/actor" },
{ "command" : "grid/sort/effect" } { "command" : "grid/sort/effect" },
{ "command" : "grid/sort/layer" }
], ],
"main/subtitle/sort selected lines" : [ "main/subtitle/sort selected lines" : [
{ "command" : "grid/sort/start/selected" }, { "command" : "grid/sort/start/selected" },
{ "command" : "grid/sort/end/selected" }, { "command" : "grid/sort/end/selected" },
{ "command" : "grid/sort/style/selected" }, { "command" : "grid/sort/style/selected" },
{ "command" : "grid/sort/actor/selected" }, { "command" : "grid/sort/actor/selected" },
{ "command" : "grid/sort/effect/selected" } { "command" : "grid/sort/effect/selected" },
{ "command" : "grid/sort/layer/selected" }
], ],
"main/timing" : [ "main/timing" : [
{ "command" : "time/shift" }, { "command" : "time/shift" },