summaryrefslogtreecommitdiff
path: root/gtk2_ardour/interthread_progress_window.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-05-23 01:08:41 +0000
committerCarl Hetherington <carl@carlh.net>2010-05-23 01:08:41 +0000
commit3b594f8046f947613ea94612d1a00b664d41a6f7 (patch)
tree74dda1489ca689fe088dd729ab94dfd14a73c400 /gtk2_ardour/interthread_progress_window.cc
parentdef7f68f26fab55df8ac76050e554c8caf2efa75 (diff)
Prevent brief, spurious `importing 2 of 1' type messages.
git-svn-id: svn://localhost/ardour2/branches/3.0@7141 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/interthread_progress_window.cc')
-rw-r--r--gtk2_ardour/interthread_progress_window.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/gtk2_ardour/interthread_progress_window.cc b/gtk2_ardour/interthread_progress_window.cc
index 5067b769c5..7de3fd2b4d 100644
--- a/gtk2_ardour/interthread_progress_window.cc
+++ b/gtk2_ardour/interthread_progress_window.cc
@@ -91,7 +91,15 @@ ImportProgressWindow::update ()
/* use overall progress for the bar, rather than that for individual files */
_bar.set_fraction ((_import_status->current - 1 + _import_status->progress) / _import_status->total);
- _bar.set_text (string_compose (_("Importing file: %1 of %2"), _import_status->current, _import_status->total));
+ /* some of the code which sets up _import_status->current may briefly increment it too far
+ at the end of an import, so check for that to avoid a visual glitch
+ */
+ uint32_t c = _import_status->current;
+ if (c > _import_status->total) {
+ c = _import_status->total;
+ }
+
+ _bar.set_text (string_compose (_("Importing file: %1 of %2"), c, _import_status->total));
return !(_import_status->done || _import_status->cancel);
}