comparison main/MainWindow.cpp @ 489:c11a29843fe1 fullscreen

Start hacking in some fullscreen stuff (so far, this is just a mess)
author Chris Cannam
date Thu, 19 Jan 2012 15:34:33 +0000
parents a6cbec451508
children 9137b619b652
comparison
equal deleted inserted replaced
488:073733da4b6c 489:c11a29843fe1
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),
194 195
195 QGridLayout *layout = new QGridLayout; 196 QGridLayout *layout = new QGridLayout;
196 197
197 m_descriptionLabel = new QLabel; //!!! hang on, this is declared in base class -- should be declared and initialised by same class 198 m_descriptionLabel = new QLabel; //!!! hang on, this is declared in base class -- should be declared and initialised by same class
198 199
199 QScrollArea *scroll = new QScrollArea(frame); 200 m_mainScroll = new QScrollArea(frame);
200 scroll->setWidgetResizable(true); 201 m_mainScroll->setWidgetResizable(true);
201 scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 202 m_mainScroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
202 scroll->setFrameShape(QFrame::NoFrame); 203 m_mainScroll->setFrameShape(QFrame::NoFrame);
203 204
204 scroll->setWidget(m_paneStack); 205 m_mainScroll->setWidget(m_paneStack);
205 206
206 m_overview = new Overview(frame); 207 m_overview = new Overview(frame);
207 m_overview->setViewManager(m_viewManager); 208 m_overview->setViewManager(m_viewManager);
208 m_overview->setFixedHeight(40); 209 m_overview->setFixedHeight(40);
209 #ifndef _WIN32 210 #ifndef _WIN32
256 settings.endGroup(); 257 settings.endGroup();
257 258
258 m_playControlsSpacer = new QFrame; 259 m_playControlsSpacer = new QFrame;
259 260
260 layout->setSpacing(4); 261 layout->setSpacing(4);
261 layout->addWidget(scroll, 0, 0, 1, 5); 262 layout->addWidget(m_mainScroll, 0, 0, 1, 5);
262 layout->addWidget(m_overview, 1, 1); 263 layout->addWidget(m_overview, 1, 1);
263 layout->addWidget(m_playControlsSpacer, 1, 2); 264 layout->addWidget(m_playControlsSpacer, 1, 2);
264 layout->addWidget(m_playSpeed, 1, 3); 265 layout->addWidget(m_playSpeed, 1, 3);
265 layout->addWidget(m_fader, 1, 4); 266 layout->addWidget(m_fader, 1, 4);
266 267
368 setupViewMenu(); 369 setupViewMenu();
369 setupPaneAndLayerMenus(); 370 setupPaneAndLayerMenus();
370 setupTransformsMenu(); 371 setupTransformsMenu();
371 372
372 m_mainMenusCreated = true; 373 m_mainMenusCreated = true;
374 }
375
376 void
377 MainWindow::goFullScreen()
378 {
379 m_paneStack->setParent(0);
380 m_paneStack->showFullScreen();
373 } 381 }
374 382
375 void 383 void
376 MainWindow::setupFileMenu() 384 MainWindow::setupFileMenu()
377 { 385 {
2987 } 2995 }
2988 2996
2989 void 2997 void
2990 MainWindow::closeEvent(QCloseEvent *e) 2998 MainWindow::closeEvent(QCloseEvent *e)
2991 { 2999 {
3000 if (m_exiting) {
3001 e->accept();
3002 return;
3003 }
3004
2992 // SVDEBUG << "MainWindow::closeEvent" << endl; 3005 // SVDEBUG << "MainWindow::closeEvent" << endl;
2993 3006
2994 if (m_openingAudioFile) { 3007 if (m_openingAudioFile) {
2995 // std::cerr << "Busy - ignoring close event" << std::endl; 3008 // std::cerr << "Busy - ignoring close event" << std::endl;
2996 e->ignore(); 3009 e->ignore();
3019 } 3032 }
3020 3033
3021 closeSession(); 3034 closeSession();
3022 3035
3023 e->accept(); 3036 e->accept();
3037
3038 m_exiting = true;
3039 qApp->closeAllWindows();
3040
3024 return; 3041 return;
3025 } 3042 }
3026 3043
3027 bool 3044 bool
3028 MainWindow::commitData(bool mayAskUser) 3045 MainWindow::commitData(bool mayAskUser)