Make translation assistant skipping whitespace an explicit setting

This commit is contained in:
Ryan Lucia 2018-03-27 15:07:37 -04:00
parent 3bcc7269be
commit 95d96f938b
4 changed files with 10 additions and 3 deletions

View File

@ -31,6 +31,7 @@
#include "format.h" #include "format.h"
#include "help_button.h" #include "help_button.h"
#include "libresrc/libresrc.h" #include "libresrc/libresrc.h"
#include "options.h"
#include "persist_location.h" #include "persist_location.h"
#include "project.h" #include "project.h"
#include "subs_edit_ctrl.h" #include "subs_edit_ctrl.h"
@ -57,7 +58,8 @@ static void add_hotkey(wxSizer *sizer, wxWindow *parent, const char *command, wx
// Skip over override blocks, comments, and whitespace between blocks // Skip over override blocks, comments, and whitespace between blocks
static bool bad_block(std::unique_ptr<AssDialogueBlock> &block) { static bool bad_block(std::unique_ptr<AssDialogueBlock> &block) {
return block->GetType() != AssBlockType::PLAIN || boost::all(block->GetText(), boost::is_space()); bool is_whitespace = boost::all(block->GetText(), boost::is_space());
return block->GetType() != AssBlockType::PLAIN || (is_whitespace && OPT_GET("Tool/Translation Assistant/Skip Whitespace")->GetBool());
} }
DialogTranslation::DialogTranslation(agi::Context *c) DialogTranslation::DialogTranslation(agi::Context *c)

View File

@ -559,7 +559,8 @@
"X" : -1, "X" : -1,
"Y" : -1 "Y" : -1
}, },
"Maximized" : false "Maximized" : false,
"Skip Whitespace" : true
}, },
"Visual" : { "Visual" : {
"Autohide": false "Autohide": false

View File

@ -559,7 +559,8 @@
"X" : -1, "X" : -1,
"Y" : -1 "Y" : -1
}, },
"Maximized" : false "Maximized" : false,
"Skip Whitespace" : true
}, },
"Visual" : { "Visual" : {
"Autohide": false "Autohide": false

View File

@ -225,6 +225,9 @@ void Interface(wxTreebook *book, Preferences *parent) {
p->OptionAdd(grid, _("Hide overrides symbol"), "Subtitle/Grid/Hide Overrides Char"); p->OptionAdd(grid, _("Hide overrides symbol"), "Subtitle/Grid/Hide Overrides Char");
p->OptionFont(grid, "Subtitle/Grid/"); p->OptionFont(grid, "Subtitle/Grid/");
auto tl_assistant = p->PageSizer(_("Translation Assistant"));
p->OptionAdd(tl_assistant, _("Skip over whitespace"), "Tool/Translation Assistant/Skip Whitespace");
p->SetSizerAndFit(p->sizer); p->SetSizerAndFit(p->sizer);
} }