comparison main/MainWindow.cpp @ 490:bc04d651f8a4

Ensure all windows are closed when the main one is (thus exiting the application even if some other windows were still open)
author Chris Cannam
date Thu, 19 Jan 2012 15:36:59 +0000
parents a6cbec451508
children e583f57f1311
comparison
equal deleted inserted replaced
488:073733da4b6c 490:bc04d651f8a4
147 m_rightButtonTransformsMenu(0), 147 m_rightButtonTransformsMenu(0),
148 m_rightButtonPlaybackMenu(0), 148 m_rightButtonPlaybackMenu(0),
149 m_soloAction(0), 149 m_soloAction(0),
150 m_soloModified(false), 150 m_soloModified(false),
151 m_prevSolo(false), 151 m_prevSolo(false),
152 m_exiting(false),
152 m_rwdStartAction(0), 153 m_rwdStartAction(0),
153 m_rwdSimilarAction(0), 154 m_rwdSimilarAction(0),
154 m_rwdAction(0), 155 m_rwdAction(0),
155 m_ffwdAction(0), 156 m_ffwdAction(0),
156 m_ffwdSimilarAction(0), 157 m_ffwdSimilarAction(0),
2987 } 2988 }
2988 2989
2989 void 2990 void
2990 MainWindow::closeEvent(QCloseEvent *e) 2991 MainWindow::closeEvent(QCloseEvent *e)
2991 { 2992 {
2993 if (m_exiting) {
2994 e->accept();
2995 return;
2996 }
2997
2992 // SVDEBUG << "MainWindow::closeEvent" << endl; 2998 // SVDEBUG << "MainWindow::closeEvent" << endl;
2993 2999
2994 if (m_openingAudioFile) { 3000 if (m_openingAudioFile) {
2995 // std::cerr << "Busy - ignoring close event" << std::endl; 3001 // std::cerr << "Busy - ignoring close event" << std::endl;
2996 e->ignore(); 3002 e->ignore();
3019 } 3025 }
3020 3026
3021 closeSession(); 3027 closeSession();
3022 3028
3023 e->accept(); 3029 e->accept();
3030
3031 m_exiting = true;
3032 qApp->closeAllWindows();
3033
3024 return; 3034 return;
3025 } 3035 }
3026 3036
3027 bool 3037 bool
3028 MainWindow::commitData(bool mayAskUser) 3038 MainWindow::commitData(bool mayAskUser)