projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix incorrect restoration of pane positions on Apple.
[ardour.git]
/
gtk2_ardour
/
interthread_progress_window.cc
diff --git
a/gtk2_ardour/interthread_progress_window.cc
b/gtk2_ardour/interthread_progress_window.cc
index 8d446830f3d1a6b1409f89d895024444200a06fe..c74f12914f3d37a62720e16edee0f44d6af56d09 100644
(file)
--- a/
gtk2_ardour/interthread_progress_window.cc
+++ b/
gtk2_ardour/interthread_progress_window.cc
@@
-19,9
+19,10
@@
#include <glibmm/main.h>
#include <gtkmm/stock.h>
#include <glibmm/main.h>
#include <gtkmm/stock.h>
+#include "gtkmm2ext/utils.h"
#include "ardour/import_status.h"
#include "interthread_progress_window.h"
#include "ardour/import_status.h"
#include "interthread_progress_window.h"
-#include "i18n.h"
+#include "
pbd/
i18n.h"
using namespace std;
using namespace Gtk;
using namespace std;
using namespace Gtk;
@@
-49,11
+50,21
@@
InterthreadProgressWindow::InterthreadProgressWindow (ARDOUR::InterThreadInfo* i
set_default_size (200, 100);
show_all ();
set_default_size (200, 100);
show_all ();
- hide ();
+ hide ();
+ _interthread_info->cancel = false; // override on_hide
Glib::signal_timeout().connect (sigc::mem_fun (*this, &InterthreadProgressWindow::update), 100);
}
Glib::signal_timeout().connect (sigc::mem_fun (*this, &InterthreadProgressWindow::update), 100);
}
+void
+InterthreadProgressWindow::on_hide ()
+{
+ if (_interthread_info && !_interthread_info->done) {
+ //catch user pressing 'esc' or WM close
+ _interthread_info->cancel = true;
+ }
+}
+
void
InterthreadProgressWindow::cancel_clicked ()
{
void
InterthreadProgressWindow::cancel_clicked ()
{
@@
-87,7
+98,7
@@
bool
ImportProgressWindow::update ()
{
_cancel_button.set_sensitive (!_import_status->freeze);
ImportProgressWindow::update ()
{
_cancel_button.set_sensitive (!_import_status->freeze);
- _label.set_markup ("<i>" +
_import_status->doing_what
+ "</i>");
+ _label.set_markup ("<i>" +
Gtkmm2ext::markup_escape_text (_import_status->doing_what)
+ "</i>");
/* 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);
/* 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);
@@
-99,7
+110,7
@@
ImportProgressWindow::update ()
if (c > _import_status->total) {
c = _import_status->total;
}
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);
_bar.set_text (string_compose (_("Importing file: %1 of %2"), c, _import_status->total));
return !(_import_status->all_done || _import_status->cancel);