comparison src/MainWindow.cpp @ 250:e9a0b3fad713

Remove tool-specific keyboard shortcut reference registration from Pane and put it in MainWindow (as it depends on which tools are in use)
author Chris Cannam
date Wed, 02 Apr 2014 09:01:56 +0100
parents 852ee50c0de5
children 3b5ea600829c
comparison
equal deleted inserted replaced
249:271bea0f199b 250:e9a0b3fad713
491 491
492 QToolBar *toolbar = addToolBar(tr("Tools Toolbar")); 492 QToolBar *toolbar = addToolBar(tr("Tools Toolbar"));
493 493
494 CommandHistory::getInstance()->registerToolbar(toolbar); 494 CommandHistory::getInstance()->registerToolbar(toolbar);
495 495
496 QActionGroup *group = new QActionGroup(this);
497
498 IconLoader il;
499
496 m_keyReference->setCategory(tr("Tool Selection")); 500 m_keyReference->setCategory(tr("Tool Selection"));
497
498 QActionGroup *group = new QActionGroup(this);
499
500 IconLoader il;
501
502 QAction *action = toolbar->addAction(il.load("navigate"), 501 QAction *action = toolbar->addAction(il.load("navigate"),
503 tr("Navigate")); 502 tr("Navigate"));
504 action->setCheckable(true); 503 action->setCheckable(true);
505 action->setChecked(true); 504 action->setChecked(true);
506 action->setShortcut(tr("1")); 505 action->setShortcut(tr("1"));
509 connect(this, SIGNAL(replacedDocument()), action, SLOT(trigger())); 508 connect(this, SIGNAL(replacedDocument()), action, SLOT(trigger()));
510 group->addAction(action); 509 group->addAction(action);
511 menu->addAction(action); 510 menu->addAction(action);
512 m_keyReference->registerShortcut(action); 511 m_keyReference->registerShortcut(action);
513 512
513 m_keyReference->setCategory
514 (tr("Navigate Tool Mouse Actions"));
515 m_keyReference->registerShortcut
516 (tr("Navigate"), tr("Left"),
517 tr("Click left button and drag to move around"));
518 m_keyReference->registerShortcut
519 (tr("Re-Analyse Area"), tr("Shift+Left"),
520 tr("Shift-click left button and drag to define a specific pitch and time range to re-analyse"));
521 m_keyReference->registerShortcut
522 (tr("Edit"), tr("Double-Click Left"),
523 tr("Double-click left button on an item to edit it"));
524
525 m_keyReference->setCategory(tr("Tool Selection"));
514 action = toolbar->addAction(il.load("move"), 526 action = toolbar->addAction(il.load("move"),
515 tr("Edit")); 527 tr("Edit"));
516 action->setCheckable(true); 528 action->setCheckable(true);
517 action->setShortcut(tr("2")); 529 action->setShortcut(tr("2"));
518 action->setStatusTip(tr("Edit with Note Intelligence")); 530 action->setStatusTip(tr("Edit with Note Intelligence"));
520 connect(this, SIGNAL(canEditLayer(bool)), action, SLOT(setEnabled(bool))); 532 connect(this, SIGNAL(canEditLayer(bool)), action, SLOT(setEnabled(bool)));
521 group->addAction(action); 533 group->addAction(action);
522 menu->addAction(action); 534 menu->addAction(action);
523 m_keyReference->registerShortcut(action); 535 m_keyReference->registerShortcut(action);
524 536
537 m_keyReference->setCategory
538 (tr("Note Edit Tool Mouse Actions"));
539 m_keyReference->registerShortcut
540 (tr("Adjust Pitch"), tr("Left"),
541 tr("Click left button on the main part of a note and drag to move it up or down"));
542 m_keyReference->registerShortcut
543 (tr("Split"), tr("Left"),
544 tr("Click left button on the bottom edge of a note to split it at the click point"));
545 m_keyReference->registerShortcut
546 (tr("Resize"), tr("Left"),
547 tr("Click left button on the left or right edge of a note and drag to change the time or duration of the note"));
548 m_keyReference->registerShortcut
549 (tr("Erase"), tr("Shift+Left"),
550 tr("Shift-click left button on a note to remove it"));
551
552
525 /* Remove for now... 553 /* Remove for now...
526 554
555 m_keyReference->setCategory(tr("Tool Selection"));
527 action = toolbar->addAction(il.load("notes"), 556 action = toolbar->addAction(il.load("notes"),
528 tr("Free Edit")); 557 tr("Free Edit"));
529 action->setCheckable(true); 558 action->setCheckable(true);
530 action->setShortcut(tr("3")); 559 action->setShortcut(tr("3"));
531 action->setStatusTip(tr("Free Edit")); 560 action->setStatusTip(tr("Free Edit"));