comparison main/MainWindow.cpp @ 72:34dc23246f46

* Press X to toggle the property boxes
author Chris Cannam
date Tue, 14 Nov 2006 16:06:00 +0000
parents e269ae6ed008
children e200055fe80b
comparison
equal deleted inserted replaced
71:51f34d378a3a 72:34dc23246f46
593 action->setStatusTip(tr("Zoom to show the whole file")); 593 action->setStatusTip(tr("Zoom to show the whole file"));
594 connect(action, SIGNAL(triggered()), this, SLOT(zoomToFit())); 594 connect(action, SIGNAL(triggered()), this, SLOT(zoomToFit()));
595 connect(this, SIGNAL(canZoom(bool)), action, SLOT(setEnabled(bool))); 595 connect(this, SIGNAL(canZoom(bool)), action, SLOT(setEnabled(bool)));
596 menu->addAction(action); 596 menu->addAction(action);
597 597
598 menu->addSeparator();
599
598 action = new QAction(tr("Show &Zoom Wheels"), this); 600 action = new QAction(tr("Show &Zoom Wheels"), this);
599 action->setShortcut(tr("Z")); 601 action->setShortcut(tr("Z"));
600 action->setStatusTip(tr("Show thumbwheels for zooming horizontally and vertically")); 602 action->setStatusTip(tr("Show thumbwheels for zooming horizontally and vertically"));
601 connect(action, SIGNAL(triggered()), this, SLOT(toggleZoomWheels())); 603 connect(action, SIGNAL(triggered()), this, SLOT(toggleZoomWheels()));
602 action->setCheckable(true); 604 action->setCheckable(true);
603 action->setChecked(m_viewManager->getZoomWheelsEnabled()); 605 action->setChecked(m_viewManager->getZoomWheelsEnabled());
606 menu->addAction(action);
607
608 action = new QAction(tr("Show Property Bo&xes"), this);
609 action->setShortcut(tr("X"));
610 action->setStatusTip(tr("Show the layer property boxes at the side of the main window"));
611 connect(action, SIGNAL(triggered()), this, SLOT(togglePropertyBoxes()));
612 action->setCheckable(true);
613 action->setChecked(true);
604 menu->addAction(action); 614 menu->addAction(action);
605 615
606 /*!!! This one doesn't work properly yet 616 /*!!! This one doesn't work properly yet
607 */ 617 */
608 menu->addSeparator(); 618 menu->addSeparator();
2783 m_viewManager->setZoomWheelsEnabled(true); 2793 m_viewManager->setZoomWheelsEnabled(true);
2784 } 2794 }
2785 } 2795 }
2786 2796
2787 void 2797 void
2798 MainWindow::togglePropertyBoxes()
2799 {
2800 if (m_paneStack->getLayoutStyle() == PaneStack::NoPropertyStacks) {
2801 if (Preferences::getInstance()->getPropertyBoxLayout() ==
2802 Preferences::VerticallyStacked) {
2803 m_paneStack->setLayoutStyle(PaneStack::PropertyStackPerPaneLayout);
2804 } else {
2805 m_paneStack->setLayoutStyle(PaneStack::SinglePropertyStackLayout);
2806 }
2807 } else {
2808 m_paneStack->setLayoutStyle(PaneStack::NoPropertyStacks);
2809 }
2810 }
2811
2812 void
2813 MainWindow::preferenceChanged(PropertyContainer::PropertyName name)
2814 {
2815 if (name == "Property Box Layout") {
2816 if (m_paneStack->getLayoutStyle() != PaneStack::NoPropertyStacks) {
2817 if (Preferences::getInstance()->getPropertyBoxLayout() ==
2818 Preferences::VerticallyStacked) {
2819 m_paneStack->setLayoutStyle(PaneStack::PropertyStackPerPaneLayout);
2820 } else {
2821 m_paneStack->setLayoutStyle(PaneStack::SinglePropertyStackLayout);
2822 }
2823 }
2824 }
2825 }
2826
2827 void
2788 MainWindow::play() 2828 MainWindow::play()
2789 { 2829 {
2790 if (m_playSource->isPlaying()) { 2830 if (m_playSource->isPlaying()) {
2791 m_playSource->stop(); 2831 m_playSource->stop();
2792 } else { 2832 } else {
3705 } else { 3745 } else {
3706 m_viewManager->setOverlayMode(ViewManager::AllOverlays); 3746 m_viewManager->setOverlayMode(ViewManager::AllOverlays);
3707 } 3747 }
3708 } else if (property == "zoomwheels") { 3748 } else if (property == "zoomwheels") {
3709 m_viewManager->setZoomWheelsEnabled(value > 0.5); 3749 m_viewManager->setZoomWheelsEnabled(value > 0.5);
3750 } else if (property == "propertyboxes") {
3751 bool toggle = ((value < 0.5) !=
3752 (m_paneStack->getLayoutStyle() == PaneStack::NoPropertyStacks));
3753 if (toggle) togglePropertyBoxes();
3710 } 3754 }
3711 3755
3712 } else { 3756 } else {
3713 PropertyContainer *container = 0; 3757 PropertyContainer *container = 0;
3714 Pane *pane = m_paneStack->getCurrentPane(); 3758 Pane *pane = m_paneStack->getCurrentPane();
3856 std::cerr << "WARNING: MainWindow::handleOSCMessage: Unknown or unsupported " 3900 std::cerr << "WARNING: MainWindow::handleOSCMessage: Unknown or unsupported "
3857 << "method \"" << message.getMethod().toStdString() 3901 << "method \"" << message.getMethod().toStdString()
3858 << "\"" << std::endl; 3902 << "\"" << std::endl;
3859 } 3903 }
3860 3904
3861 }
3862
3863 void
3864 MainWindow::preferenceChanged(PropertyContainer::PropertyName name)
3865 {
3866 if (name == "Property Box Layout") {
3867 if (Preferences::getInstance()->getPropertyBoxLayout() ==
3868 Preferences::VerticallyStacked) {
3869 m_paneStack->setLayoutStyle(PaneStack::PropertyStackPerPaneLayout);
3870 } else {
3871 m_paneStack->setLayoutStyle(PaneStack::SinglePropertyStackLayout);
3872 }
3873 }
3874 } 3905 }
3875 3906
3876 void 3907 void
3877 MainWindow::preferences() 3908 MainWindow::preferences()
3878 { 3909 {