X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Finterthread_progress_window.cc;h=e81ea26872d223971ad4d257d7e53af5f7710d20;hb=f80859f3bdcb5c3b982379481ae3999446f35e81;hp=28308ee74fcdfcb0ddf1bb5c254e25b38af2b9b4;hpb=3d3e889dd61d8e513f78257ac770eabc8afe050c;p=ardour.git diff --git a/gtk2_ardour/interthread_progress_window.cc b/gtk2_ardour/interthread_progress_window.cc index 28308ee74f..e81ea26872 100644 --- a/gtk2_ardour/interthread_progress_window.cc +++ b/gtk2_ardour/interthread_progress_window.cc @@ -21,6 +21,7 @@ #include #include "ardour/import_status.h" #include "interthread_progress_window.h" +#include "i18n.h" using namespace std; using namespace Gtk; @@ -48,6 +49,7 @@ InterthreadProgressWindow::InterthreadProgressWindow (ARDOUR::InterThreadInfo* i set_default_size (200, 100); show_all (); + hide (); Glib::signal_timeout().connect (sigc::mem_fun (*this, &InterthreadProgressWindow::update), 100); } @@ -89,6 +91,16 @@ 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); - - return !(_import_status->done || _import_status->cancel); + + /* 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->all_done || _import_status->cancel); }