comparison main/MainWindow.cpp @ 458:a94be56cf98f toggle

Add/remove several actions from the Playback menu when switching mode: constrain playback to selection, loop, solo, align
author mathieub <mathieu.barthet@eecs.qmul.ac.uk>
date Mon, 04 Jul 2011 13:06:02 +0100
parents 1604cb12ce11
children f8f74f1b5b4f
comparison
equal deleted inserted replaced
454:1604cb12ce11 458:a94be56cf98f
151 m_ffwdSimilarAction(0), 151 m_ffwdSimilarAction(0),
152 m_ffwdEndAction(0), 152 m_ffwdEndAction(0),
153 m_playAction(0), 153 m_playAction(0),
154 m_playSelectionAction(0), 154 m_playSelectionAction(0),
155 m_playLoopAction(0), 155 m_playLoopAction(0),
156 m_alAction(0),
156 m_playControlsSpacer(0), 157 m_playControlsSpacer(0),
157 m_playControlsWidth(0), 158 m_playControlsWidth(0),
158 m_preferencesDialog(0), 159 m_preferencesDialog(0),
159 m_layerTreeDialog(0), 160 m_layerTreeDialog(0),
160 m_activityLog(new ActivityLog()), 161 m_activityLog(new ActivityLog()),
1858 connect(m_viewManager, SIGNAL(playSoloModeChanged(bool)), 1859 connect(m_viewManager, SIGNAL(playSoloModeChanged(bool)),
1859 m_soloAction, SLOT(setChecked(bool))); 1860 m_soloAction, SLOT(setChecked(bool)));
1860 connect(m_soloAction, SIGNAL(triggered()), this, SLOT(playSoloToggled())); 1861 connect(m_soloAction, SIGNAL(triggered()), this, SLOT(playSoloToggled()));
1861 connect(this, SIGNAL(canChangeSolo(bool)), m_soloAction, SLOT(setEnabled(bool))); 1862 connect(this, SIGNAL(canChangeSolo(bool)), m_soloAction, SLOT(setEnabled(bool)));
1862 1863
1863 QAction *alAction = 0; 1864 //QAction *alAction = 0;
1864 if (Document::canAlign()) { 1865 if (Document::canAlign()) {
1865 alAction = m_playModeToolBar->addAction(il.load("align"), 1866 m_alAction = m_playModeToolBar->addAction(il.load("align"),
1866 tr("Align File Timelines")); 1867 tr("Align File Timelines"));
1867 alAction->setCheckable(true); 1868 m_alAction->setCheckable(true);
1868 alAction->setChecked(m_viewManager->getAlignMode()); 1869 m_alAction->setChecked(m_viewManager->getAlignMode());
1869 alAction->setStatusTip(tr("Treat multiple audio files as versions of the same work, and align their timelines")); 1870 m_alAction->setStatusTip(tr("Treat multiple audio files as versions of the same work, and align their timelines"));
1870 connect(m_viewManager, SIGNAL(alignModeChanged(bool)), 1871 connect(m_viewManager, SIGNAL(alignModeChanged(bool)),
1871 alAction, SLOT(setChecked(bool))); 1872 m_alAction, SLOT(setChecked(bool)));
1872 connect(alAction, SIGNAL(triggered()), this, SLOT(alignToggled())); 1873 connect(m_alAction, SIGNAL(triggered()), this, SLOT(alignToggled()));
1873 connect(this, SIGNAL(canAlign(bool)), alAction, SLOT(setEnabled(bool))); 1874 connect(this, SIGNAL(canAlign(bool)), m_alAction, SLOT(setEnabled(bool)));
1874 } 1875 }
1875 1876
1876 m_keyReference->registerShortcut(m_playAction); 1877 m_keyReference->registerShortcut(m_playAction);
1877 m_keyReference->registerShortcut(m_playSelectionAction); 1878 m_keyReference->registerShortcut(m_playSelectionAction);
1878 m_keyReference->registerShortcut(m_playLoopAction); 1879 m_keyReference->registerShortcut(m_playLoopAction);
1879 m_keyReference->registerShortcut(m_soloAction); 1880 m_keyReference->registerShortcut(m_soloAction);
1880 if (alAction) m_keyReference->registerShortcut(alAction); 1881 if (m_alAction) m_keyReference->registerShortcut(m_alAction);
1881 m_keyReference->registerShortcut(m_rwdAction); 1882 m_keyReference->registerShortcut(m_rwdAction);
1882 m_keyReference->registerShortcut(m_ffwdAction); 1883 m_keyReference->registerShortcut(m_ffwdAction);
1883 m_keyReference->registerShortcut(m_rwdSimilarAction); 1884 m_keyReference->registerShortcut(m_rwdSimilarAction);
1884 m_keyReference->registerShortcut(m_ffwdSimilarAction); 1885 m_keyReference->registerShortcut(m_ffwdSimilarAction);
1885 m_keyReference->registerShortcut(m_rwdStartAction); 1886 m_keyReference->registerShortcut(m_rwdStartAction);
1887 1888
1888 menu->addAction(m_playAction); 1889 menu->addAction(m_playAction);
1889 menu->addAction(m_playSelectionAction); 1890 menu->addAction(m_playSelectionAction);
1890 menu->addAction(m_playLoopAction); 1891 menu->addAction(m_playLoopAction);
1891 menu->addAction(m_soloAction); 1892 menu->addAction(m_soloAction);
1892 if (alAction) menu->addAction(alAction); 1893 if (m_alAction) menu->addAction(m_alAction);
1893 menu->addSeparator(); 1894 menu->addSeparator();
1894 menu->addAction(m_rwdAction); 1895 menu->addAction(m_rwdAction);
1895 menu->addAction(m_ffwdAction); 1896 menu->addAction(m_ffwdAction);
1896 menu->addSeparator(); 1897 menu->addSeparator();
1897 menu->addAction(m_rwdSimilarAction); 1898 menu->addAction(m_rwdSimilarAction);
1903 1904
1904 m_rightButtonPlaybackMenu->addAction(m_playAction); 1905 m_rightButtonPlaybackMenu->addAction(m_playAction);
1905 m_rightButtonPlaybackMenu->addAction(m_playSelectionAction); 1906 m_rightButtonPlaybackMenu->addAction(m_playSelectionAction);
1906 m_rightButtonPlaybackMenu->addAction(m_playLoopAction); 1907 m_rightButtonPlaybackMenu->addAction(m_playLoopAction);
1907 m_rightButtonPlaybackMenu->addAction(m_soloAction); 1908 m_rightButtonPlaybackMenu->addAction(m_soloAction);
1908 if (alAction) m_rightButtonPlaybackMenu->addAction(alAction); 1909 if (m_alAction) m_rightButtonPlaybackMenu->addAction(m_alAction);
1909 m_rightButtonPlaybackMenu->addSeparator(); 1910 m_rightButtonPlaybackMenu->addSeparator();
1910 m_rightButtonPlaybackMenu->addAction(m_rwdAction); 1911 m_rightButtonPlaybackMenu->addAction(m_rwdAction);
1911 m_rightButtonPlaybackMenu->addAction(m_ffwdAction); 1912 m_rightButtonPlaybackMenu->addAction(m_ffwdAction);
1912 m_rightButtonPlaybackMenu->addSeparator(); 1913 m_rightButtonPlaybackMenu->addSeparator();
1913 m_rightButtonPlaybackMenu->addAction(m_rwdStartAction); 1914 m_rightButtonPlaybackMenu->addAction(m_rwdStartAction);
4228 4229
4229 m_playModeToolBar->setVisible(show); 4230 m_playModeToolBar->setVisible(show);
4230 m_editToolBar->setVisible(show); 4231 m_editToolBar->setVisible(show);
4231 m_toolsToolBar->setVisible(show); 4232 m_toolsToolBar->setVisible(show);
4232 4233
4234 //add/remove actions from the File menu
4233 m_importAnnotationLayerAction->setVisible(show); 4235 m_importAnnotationLayerAction->setVisible(show);
4234 m_exportAnnotationLayerAction->setVisible(show); 4236 m_exportAnnotationLayerAction->setVisible(show);
4237 //add/remove actions from the View menu
4235 m_showNoOverlaysAction->setVisible(show); 4238 m_showNoOverlaysAction->setVisible(show);
4236 m_showMinimalOverlaysAction->setVisible(show); 4239 m_showMinimalOverlaysAction->setVisible(show);
4237 m_showStandardOverlaysAction->setVisible(show); 4240 m_showStandardOverlaysAction->setVisible(show);
4238 m_showAllOverlaysAction->setVisible(show); 4241 m_showAllOverlaysAction->setVisible(show);
4239 m_showAllTimeRulersAction->setVisible(show); 4242 m_showAllTimeRulersAction->setVisible(show);
4240 m_showZoomWheelsAction->setVisible(show); 4243 m_showZoomWheelsAction->setVisible(show);
4241 m_showPropertyBoxesAction->setVisible(show); 4244 m_showPropertyBoxesAction->setVisible(show);
4242 m_showStatusBarAction->setVisible(show); 4245 m_showStatusBarAction->setVisible(show);
4246 //add/remove actions from the Playback menu
4247 m_playSelectionAction->setVisible(show);
4248 m_playLoopAction->setVisible(show);
4249 m_soloAction->setVisible(show);
4250 m_alAction->setVisible(show);
4243 4251
4244 m_playControlsSpacer->setVisible(show); 4252 m_playControlsSpacer->setVisible(show);
4245 4253
4246 if (wasMinimal) { 4254 if (wasMinimal) {
4247 resizeConstrained(settings.value("size").toSize()); 4255 resizeConstrained(settings.value("size").toSize());
4251 } 4259 }
4252 4260
4253 settings.endGroup(); 4261 settings.endGroup();
4254 4262
4255 //TO-DOS: 4263 //TO-DOS:
4264 //The Constrain Playback to Selection option is still effective when the minimal mode is activated whereas
4265 //the functionality to modify the selection has been removed from this mode. Playback mode should switch to
4266 //normal when the minimal mode is activated and then be set up again to what it was when the full mode is
4267 //activated again.
4268
4269 //done:
4256 //- when switching back to full mode, the pane is not shown entirely, should restore the previous size 4270 //- when switching back to full mode, the pane is not shown entirely, should restore the previous size
4257 //- the size of the overview (namely its width) should be increased when the minimal mode is activated 4271 //- the size of the overview (namely its width) should be increased when the minimal mode is activated
4258 //- the menus which have no effects in the minimal mode should be removed (or their actions disabled) 4272 //- the menus which have no effects in the minimal mode should be removed (or their actions disabled)
4259 //even if this doesn't lead cause the application to crash (the actual changes are made in the hidden pane(s)) 4273 //even if this doesn't lead cause the application to crash (the actual changes are made in the hidden pane(s))
4260 //- the menu actions which have no effects in the minimal mode should be removed or disabled 4274 //- the menu actions which have no effects in the minimal mode should be removed or disabled