As in bug #388266, pressing esc or closing the dialog does not stops the space calculation.
This patch adds closeEvent() and keyPressEvent() to solve the problem.
m_updateTimer->isActive() is checked in both functions to avoid calling m_updateTimer->stop() twice, causing a segfault when calculation is finished and the user closes the dialog without using the OK button.