comparison view/View.cpp @ 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 0e971e3d93e2
comparison
equal deleted inserted replaced
1482:c1cae369979d 1483:3943d0720167
1717 View::cancelClicked() 1717 View::cancelClicked()
1718 { 1718 {
1719 QPushButton *cancel = qobject_cast<QPushButton *>(sender()); 1719 QPushButton *cancel = qobject_cast<QPushButton *>(sender());
1720 if (!cancel) return; 1720 if (!cancel) return;
1721 1721
1722 Layer *layer = nullptr;
1723
1722 for (ProgressMap::iterator i = m_progressBars.begin(); 1724 for (ProgressMap::iterator i = m_progressBars.begin();
1723 i != m_progressBars.end(); ++i) { 1725 i != m_progressBars.end(); ++i) {
1724
1725 if (i->second.cancel == cancel) { 1726 if (i->second.cancel == cancel) {
1726 1727 layer = i->first;
1727 /*!!! 1728 break;
1728 Layer *layer = i->first; 1729 }
1729 Model *model = layer->getModel(); 1730 }
1730 1731
1731 //!!! todo: restore this behaviour 1732 if (layer) {
1732 if (model) model->abandon(); 1733 emit cancelButtonPressed(layer);
1733 */
1734 }
1735 } 1734 }
1736 } 1735 }
1737 1736
1738 void 1737 void
1739 View::checkProgress(ModelId modelId) 1738 View::checkProgress(ModelId modelId)