2019-01-06 Carl Hetherington <cth@carlh.net>
+ * Improve behaviour of hints dialog with long projects (#1439).
+
* Fix incorrect video waveform display (#1425).
2019-01-05 Carl Hetherington <cth@carlh.net>
, _long_ccap (false)
, _overlap_ccap (false)
, _too_many_ccap_lines (false)
+ , _stop (false)
{
}
{
if (_thread) {
try {
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _stop = true;
+ }
_thread->interrupt ();
_thread->join ();
} catch (...) {
_long_ccap = false;
_overlap_ccap = false;
_too_many_ccap_lines = false;
+ _stop = false;
_thread = new boost::thread (bind(&Hints::thread, this));
}
player->set_ignore_video ();
player->set_ignore_audio ();
player->Text.connect (bind(&Hints::text, this, _1, _2, _4));
- while (!player->pass ()) {
- bind (boost::ref(Pulse));
+
+ struct timeval last_pulse;
+ gettimeofday (&last_pulse, 0);
+
+ while (!player->pass()) {
+
+ struct timeval now;
+ gettimeofday (&now, 0);
+ if ((seconds(now) - seconds(last_pulse)) > 1) {
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ if (_stop) {
+ break;
+ }
+ }
+ emit (bind (boost::ref(Pulse)));
+ last_pulse = now;
+ }
}
emit (bind(boost::ref(Finished)));
: wxDialog (parent, wxID_ANY, _("Hints"))
, _film (film)
, _hints (new Hints (film))
+ , _finished (false)
{
wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
Layout ();
_gauge->SetValue (0);
update ();
+ _finished = false;
_hints->start ();
}
{
_text->Clear ();
if (_current.empty ()) {
- _text->WriteText (_("There are no hints: everything looks good!"));
+ if (_finished) {
+ _text->WriteText (_("There are no hints: everything looks good!"));
+ } else {
+ _text->WriteText (_("There are no hints yet: project check in progress."));
+ }
} else {
_text->BeginStandardBullet (N_("standard/circle"), 1, 50);
BOOST_FOREACH (string i, _current) {
void
HintsDialog::finished ()
{
+ _finished = true;
+ update ();
_gauge->Hide ();
_gauge_message->Hide ();
Layout ();
wxRichTextCtrl* _text;
boost::shared_ptr<Hints> _hints;
std::list<std::string> _current;
+ bool _finished;
boost::signals2::scoped_connection _film_change_connection;
boost::signals2::scoped_connection _film_content_change_connection;