Mercurial > hg > svgui
changeset 1483:3943d0720167 by-id
Emit a signal when a cancel is pressed
author | Chris Cannam |
---|---|
date | Mon, 15 Jul 2019 13:49:57 +0100 |
parents | c1cae369979d |
children | b43ff1abdc02 |
files | view/View.cpp view/View.h |
diffstat | 2 files changed, 10 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/view/View.cpp Fri Jul 12 16:29:59 2019 +0100 +++ b/view/View.cpp Mon Jul 15 13:49:57 2019 +0100 @@ -1719,20 +1719,19 @@ QPushButton *cancel = qobject_cast<QPushButton *>(sender()); if (!cancel) return; + Layer *layer = nullptr; + for (ProgressMap::iterator i = m_progressBars.begin(); i != m_progressBars.end(); ++i) { - if (i->second.cancel == cancel) { - -/*!!! - Layer *layer = i->first; - Model *model = layer->getModel(); - - //!!! todo: restore this behaviour - if (model) model->abandon(); -*/ + layer = i->first; + break; } } + + if (layer) { + emit cancelButtonPressed(layer); + } } void