forked from mia/Aegisub
Don't display an error message if user cancels the charset selection dialog
This commit is contained in:
parent
3d48f18542
commit
8118d790a4
1 changed files with 7 additions and 2 deletions
|
@ -86,8 +86,13 @@ void SubsController::Load(agi::fs::path const& filename, std::string charset) {
|
||||||
// TextFileReader does this automatically, but relying on that results in
|
// TextFileReader does this automatically, but relying on that results in
|
||||||
// the user being prompted twice if it can't be auto-detected, since we
|
// the user being prompted twice if it can't be auto-detected, since we
|
||||||
// open the file twice below.
|
// open the file twice below.
|
||||||
if (charset.empty())
|
try {
|
||||||
charset = CharSetDetect::GetEncoding(filename);
|
if (charset.empty())
|
||||||
|
charset = CharSetDetect::GetEncoding(filename);
|
||||||
|
}
|
||||||
|
catch (agi::UserCancelException const&) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Make sure that file isn't actually a timecode file
|
// Make sure that file isn't actually a timecode file
|
||||||
if (charset != "binary") {
|
if (charset != "binary") {
|
||||||
|
|
Loading…
Reference in a new issue