comparison main/MainWindow.cpp @ 759:e2d2ac12577c

Tidy
author Chris Cannam
date Wed, 13 Aug 2014 16:09:11 +0100
parents 66aa86070aa4
children 5b4206f7d7d4
comparison
equal deleted inserted replaced
758:66aa86070aa4 759:e2d2ac12577c
1027 void 1027 void
1028 MainWindow::setupPaneAndLayerMenus() 1028 MainWindow::setupPaneAndLayerMenus()
1029 { 1029 {
1030 if (m_paneMenu) { 1030 if (m_paneMenu) {
1031 m_paneActions.clear(); 1031 m_paneActions.clear();
1032 cerr << "clearing pane menu " << m_paneMenu << endl;
1033 m_paneMenu->clear(); 1032 m_paneMenu->clear();
1034 } else { 1033 } else {
1035 m_paneMenu = menuBar()->addMenu(tr("&Pane")); 1034 m_paneMenu = menuBar()->addMenu(tr("&Pane"));
1036 m_paneMenu->setTearOffEnabled(true); 1035 m_paneMenu->setTearOffEnabled(true);
1037 } 1036 }
1064 connect(action, SIGNAL(triggered()), this, SLOT(addPane())); 1063 connect(action, SIGNAL(triggered()), this, SLOT(addPane()));
1065 connect(this, SIGNAL(canAddPane(bool)), action, SLOT(setEnabled(bool))); 1064 connect(this, SIGNAL(canAddPane(bool)), action, SLOT(setEnabled(bool)));
1066 m_paneActions[action] = LayerConfiguration(LayerFactory::TimeRuler); 1065 m_paneActions[action] = LayerConfiguration(LayerFactory::TimeRuler);
1067 m_keyReference->registerShortcut(action); 1066 m_keyReference->registerShortcut(action);
1068 menu->addAction(action); 1067 menu->addAction(action);
1069 cerr << "created new pane action " << action << ", name " << action->text() << endl;
1070 1068
1071 menu->addSeparator(); 1069 menu->addSeparator();
1072 1070
1073 menu = m_layerMenu; 1071 menu = m_layerMenu;
1074 1072
1263 menu->addAction(action); 1261 menu->addAction(action);
1264 1262
1265 } else { 1263 } else {
1266 1264
1267 if (!submenu) { 1265 if (!submenu) {
1268 cerr << "adding submenu of name " << mainText << " to menu " << menu << ", " << menu->title() << endl;
1269 submenu = menu->addMenu(mainText); 1266 submenu = menu->addMenu(mainText);
1270 submenu->setTearOffEnabled(true); 1267 submenu->setTearOffEnabled(true);
1271 } else if (isDefault) { 1268 } else if (isDefault) {
1272 submenu->addSeparator(); 1269 submenu->addSeparator();
1273 } 1270 }
1437 menu->addAction(action); 1434 menu->addAction(action);
1438 m_rightButtonLayerMenu->addAction(action); 1435 m_rightButtonLayerMenu->addAction(action);
1439 1436
1440 m_keyReference->registerShortcut(raction); // rename after delete, so delete layer goes next to delete pane 1437 m_keyReference->registerShortcut(raction); // rename after delete, so delete layer goes next to delete pane
1441 m_keyReference->registerShortcut(eaction); // edit also after delete 1438 m_keyReference->registerShortcut(eaction); // edit also after delete
1442
1443 cerr << "pane menu contains:" << endl;
1444 foreach (QAction *a, m_paneMenu->actions()) {
1445 if (a->isSeparator()) {
1446 cerr << "-----" << endl;
1447 continue;
1448 }
1449 cerr << a->text() << " " << a->shortcut().toString() << endl;
1450 if (a->menu()) {
1451 foreach (QAction *aa, a->menu()->actions()) {
1452 cerr << " " << aa->text() << " " << aa->shortcut().toString() << endl;
1453 }
1454 }
1455 }
1456 1439
1457 finaliseMenus(); 1440 finaliseMenus();
1458 } 1441 }
1459 1442
1460 void 1443 void