comparison main/MainWindow.cpp @ 753:61c0f32d93b3

Some temporary action debug output
author Chris Cannam
date Wed, 13 Aug 2014 09:09:16 +0100
parents 1192963e2d83
children 7d0367e9642c
comparison
equal deleted inserted replaced
752:37a65d229dc5 753:61c0f32d93b3
1063 connect(action, SIGNAL(triggered()), this, SLOT(addPane())); 1063 connect(action, SIGNAL(triggered()), this, SLOT(addPane()));
1064 connect(this, SIGNAL(canAddPane(bool)), action, SLOT(setEnabled(bool))); 1064 connect(this, SIGNAL(canAddPane(bool)), action, SLOT(setEnabled(bool)));
1065 m_paneActions[action] = LayerConfiguration(LayerFactory::TimeRuler); 1065 m_paneActions[action] = LayerConfiguration(LayerFactory::TimeRuler);
1066 m_keyReference->registerShortcut(action); 1066 m_keyReference->registerShortcut(action);
1067 menu->addAction(action); 1067 menu->addAction(action);
1068 cerr << "created new pane action " << action << ", name " << action->text() << endl;
1068 1069
1069 menu->addSeparator(); 1070 menu->addSeparator();
1070 1071
1071 menu = m_layerMenu; 1072 menu = m_layerMenu;
1072 1073
3422 void 3423 void
3423 MainWindow::addPane() 3424 MainWindow::addPane()
3424 { 3425 {
3425 QObject *s = sender(); 3426 QObject *s = sender();
3426 QAction *action = dynamic_cast<QAction *>(s); 3427 QAction *action = dynamic_cast<QAction *>(s);
3428
3429 cerr << "addPane: sender is " << s << ", action is " << action << ", name " << action->text() << endl;
3427 3430
3428 if (!action) { 3431 if (!action) {
3429 cerr << "WARNING: MainWindow::addPane: sender is not an action" 3432 cerr << "WARNING: MainWindow::addPane: sender is not an action"
3430 << endl; 3433 << endl;
3431 return; 3434 return;
3434 PaneActionMap::iterator i = m_paneActions.find(action); 3437 PaneActionMap::iterator i = m_paneActions.find(action);
3435 3438
3436 if (i == m_paneActions.end()) { 3439 if (i == m_paneActions.end()) {
3437 cerr << "WARNING: MainWindow::addPane: unknown action " 3440 cerr << "WARNING: MainWindow::addPane: unknown action "
3438 << action->objectName() << endl; 3441 << action->objectName() << endl;
3442 cerr << "known actions are:" << endl;
3443 for (PaneActionMap::const_iterator i = m_paneActions.begin();
3444 i != m_paneActions.end(); ++i) {
3445 cerr << i->first << ", name " << i->first->text() << endl;
3446 }
3439 return; 3447 return;
3440 } 3448 }
3441 3449
3442 addPane(i->second, action->text()); 3450 addPane(i->second, action->text());
3443 } 3451 }