projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't show an error when cancelling subtitle analysis.
[dcpomatic.git]
/
src
/
wx
/
text_panel.cc
diff --git
a/src/wx/text_panel.cc
b/src/wx/text_panel.cc
index 95c422fd0c8dbf96f7db502616f2d4bff3dfe827..76dd21489f831b54c1a56a51a58f0d42eeb38ea4 100644
(file)
--- a/
src/wx/text_panel.cc
+++ b/
src/wx/text_panel.cc
@@
-61,6
+61,9
@@
using std::string;
using std::vector;
using boost::bind;
using boost::optional;
using std::vector;
using boost::bind;
using boost::optional;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
/** @param t Original text type of the content, if known */
/** @param t Original text type of the content, if known */
@@
-826,13
+829,13
@@
TextPanel::try_to_load_analysis ()
if (!boost::filesystem::exists(path)) {
for (auto i: JobManager::instance()->get()) {
if (!boost::filesystem::exists(path)) {
for (auto i: JobManager::instance()->get()) {
- if (dynamic_pointer_cast<AnalyseSubtitlesJob>(i)) {
+ if (dynamic_pointer_cast<AnalyseSubtitlesJob>(i)
&& !i->finished()
) {
i->cancel ();
}
}
JobManager::instance()->analyse_subtitles (
i->cancel ();
}
}
JobManager::instance()->analyse_subtitles (
- _parent->film(), content, _analysis_finished_connection, bind(&TextPanel::analysis_finished, this)
+ _parent->film(), content, _analysis_finished_connection, bind(&TextPanel::analysis_finished, this
, _1
)
);
return;
}
);
return;
}
@@
-842,7
+845,7
@@
TextPanel::try_to_load_analysis ()
} catch (OldFormatError& e) {
/* An old analysis file: recreate it */
JobManager::instance()->analyse_subtitles (
} catch (OldFormatError& e) {
/* An old analysis file: recreate it */
JobManager::instance()->analyse_subtitles (
- _parent->film(), content, _analysis_finished_connection, bind(&TextPanel::analysis_finished, this)
+ _parent->film(), content, _analysis_finished_connection, bind(&TextPanel::analysis_finished, this
, _1
)
);
return;
}
);
return;
}
@@
-884,27
+887,25
@@
TextPanel::clear_outline_subtitles ()
void
void
-TextPanel::analysis_finished
(
)
+TextPanel::analysis_finished
(Job::Result result
)
{
{
+ _loading_analysis = false;
+
auto content = _analysis_content.lock ();
auto content = _analysis_content.lock ();
- if (!content) {
-
_loading_analysis = false
;
- setup_sensitivity
();
+ if (!content
|| result == Job::Result::RESULT_CANCELLED
) {
+
clear_outline_subtitles()
;
+ setup_sensitivity();
return;
}
if (!boost::filesystem::exists(_parent->film()->subtitle_analysis_path(content))) {
return;
}
if (!boost::filesystem::exists(_parent->film()->subtitle_analysis_path(content))) {
- /* We analysed and still nothing showed up, so maybe it was cancelled or it failed.
- Give up.
- */
+ /* We analysed and still nothing showed up, so maybe it failed. Give up. */
error_dialog (_parent->window(), _("Could not analyse subtitles."));
clear_outline_subtitles ();
error_dialog (_parent->window(), _("Could not analyse subtitles."));
clear_outline_subtitles ();
- _loading_analysis = false;
setup_sensitivity ();
return;
}
setup_sensitivity ();
return;
}
- _loading_analysis = false;
try_to_load_analysis ();
}
try_to_load_analysis ();
}