Logo Search packages:      
Sourcecode: rosegarden version File versions  Download package

void NotationView::setupActions (  )  [protected, virtual]

create menus and toolbars

!! not here yet new KAction(i18n("Move Selection Left"), Key_Minus, this, SLOT(slotMoveSelectionLeft()), actionCollection(), "move_selection_left");

Definition at line 1198 of file notationview.cpp.

References NotationHLayout::getAvailableProportions(), NotationHLayout::getAvailableSpacings(), NotationHLayout::getProportion(), NotationHLayout::getSpacing(), setupFontSizeMenu(), slotChangeFontFromAction(), slotChangeProportionFromAction(), slotChangeSpacingFromAction(), slotCurrentStaffDown(), slotCurrentStaffUp(), slotEditAddKeySignature(), slotEditCutAndClose(), slotEditDelete(), slotEditGeneralPaste(), slotEditSelectFromStart(), slotEraseSelected(), slotFilePrint(), slotFilePrintPreview(), slotFretboard(), slotGroupBeam(), slotJumpCursorToPlayback(), slotJumpPlaybackToCursor(), slotLinearMode(), slotMakeOrnament(), slotNoteAction(), slotPreviewSelection(), slotText(), slotToggleAnnotations(), slotToggleLilyPondDirectives(), slotToggleTracking(), slotTransformsNormalizeRests(), slotTrebleClef(), slotUpdateInsertModeStatus(), Rosegarden::Indication::Slur, and NotePixmapFactory::toQPixmap().

{
    KStdAction::print(this, SLOT(slotFilePrint()), actionCollection());
    KStdAction::printPreview(this, SLOT(slotFilePrintPreview()),
                       actionCollection());

    EditViewBase::setupActions("notation.rc");
    EditView::setupActions();

    KRadioAction* noteAction = 0;
    
    // View menu stuff
    
    KActionMenu *fontActionMenu =
      new KActionMenu(i18n("Note &Font"), this, "note_font_actionmenu");

    std::set<std::string> fs(NoteFontFactory::getFontNames());
    std::vector<std::string> f(fs.begin(), fs.end());
    std::sort(f.begin(), f.end());
    
    for (std::vector<std::string>::iterator i = f.begin(); i != f.end(); ++i) {

      QString fontQName(strtoqstr(*i));

      KToggleAction *fontAction = 
          new KToggleAction
          (fontQName, 0, this, SLOT(slotChangeFontFromAction()),
           actionCollection(), "note_font_" + fontQName);

      fontAction->setChecked(*i == m_fontName);
      fontActionMenu->insert(fontAction);
    }

    actionCollection()->insert(fontActionMenu);

    m_fontSizeActionMenu =
      new KActionMenu(i18n("Si&ze"), this, "note_font_size_actionmenu");
    setupFontSizeMenu();

    actionCollection()->insert(m_fontSizeActionMenu);

    
    KActionMenu *spacingActionMenu =
      new KActionMenu(i18n("S&pacing"), this, "stretch_actionmenu");

    int defaultSpacing = m_hlayout->getSpacing();
    std::vector<int> spacings = NotationHLayout::getAvailableSpacings();

    for (std::vector<int>::iterator i = spacings.begin();
       i != spacings.end(); ++i) {
      
      KToggleAction *spacingAction =
          new KToggleAction
          (QString("%1%").arg(*i), 0, this,
           SLOT(slotChangeSpacingFromAction()),
           actionCollection(), QString("spacing_%1").arg(*i));

      spacingAction->setExclusiveGroup("spacing");
      spacingAction->setChecked(*i == defaultSpacing);
      spacingActionMenu->insert(spacingAction);
    }

    actionCollection()->insert(spacingActionMenu);
    
    KActionMenu *proportionActionMenu =
      new KActionMenu(i18n("Du&ration Factor"), this, "proportion_actionmenu");

    int defaultProportion = m_hlayout->getProportion();
    std::vector<int> proportions = NotationHLayout::getAvailableProportions();

    for (std::vector<int>::iterator i = proportions.begin();
       i != proportions.end(); ++i) {
      
      QString name = QString("%1%").arg(*i);
      if (*i == 0) name = i18n("None");

      KToggleAction *proportionAction =
          new KToggleAction
          (name, 0, this,
           SLOT(slotChangeProportionFromAction()),
           actionCollection(), QString("proportion_%1").arg(*i));

      proportionAction->setExclusiveGroup("proportion");
      proportionAction->setChecked(*i == defaultProportion);
      proportionActionMenu->insert(proportionAction);
    }

    actionCollection()->insert(proportionActionMenu);

    KActionMenu *styleActionMenu =
      new KActionMenu(i18n("Note &Style"), this, "note_style_actionmenu");

    std::vector<NoteStyleName> styles
          (NoteStyleFactory::getAvailableStyleNames());

    for (std::vector<NoteStyleName>::iterator i = styles.begin();
       i != styles.end(); ++i) {

      QString styleQName(strtoqstr(*i));

      KAction *styleAction =
          new KAction
          (styleQName, 0, this, SLOT(slotSetStyleFromAction()),
           actionCollection(), "style_" + styleQName);

      styleActionMenu->insert(styleAction);
    }

    actionCollection()->insert(styleActionMenu);

    KActionMenu *ornamentActionMenu =
      new KActionMenu(i18n("Use Ornament"), this, "ornament_actionmenu");



    new KAction
      (i18n("Insert Rest"), Key_P, this, SLOT(slotInsertRest()),
       actionCollection(), QString("insert_rest"));

    new KAction
      (i18n("Switch from Note to Rest"), Key_T, this,
       SLOT(slotSwitchFromNoteToRest()),
       actionCollection(), QString("switch_from_note_to_rest"));

    new KAction
      (i18n("Switch from Rest to Note"), Key_Y, this,
       SLOT(slotSwitchFromRestToNote()),
       actionCollection(), QString("switch_from_rest_to_note"));


    // setup Notes menu & toolbar
    QIconSet icon;
 
    for (NoteActionDataMap::Iterator actionDataIter = m_noteActionDataMap->begin();
       actionDataIter != m_noteActionDataMap->end();
       ++actionDataIter) {

        NoteActionData noteActionData = *actionDataIter;
        
        icon = QIconSet
          (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
           (noteActionData.pixmapName)));
        noteAction = new KRadioAction(noteActionData.title,
                              icon,
                              noteActionData.keycode,
                              this,
                                      SLOT(slotNoteAction()),
                                      actionCollection(),
                              noteActionData.actionName);
        noteAction->setExclusiveGroup("notes");

        if (noteActionData.noteType == Note::Crotchet &&
          noteActionData.dots == 0 && !noteActionData.rest) {
            m_selectDefaultNote = noteAction;
      }
    }

    // Note duration change actions
    for (NoteChangeActionDataMap::Iterator actionDataIter = m_noteChangeActionDataMap->begin();
       actionDataIter != m_noteChangeActionDataMap->end();
       ++actionDataIter) {

      NoteChangeActionData data = *actionDataIter;

        icon = QIconSet
          (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
                                (data.pixmapName)));

      KAction *action = new KAction(data.title,
                              icon,
                              data.keycode,
                              this,
                              SLOT(slotNoteChangeAction()),
                              actionCollection(),
                              data.actionName);
    }

    //
    // Accidentals
    //
    static QString actionsAccidental[][4] = 
        {
            { i18n("No accidental"),  "1slotNoAccidental()",  "no_accidental",           "accidental-none" },
            { i18n("Follow previous accidental"),  "1slotFollowAccidental()",  "follow_accidental",           "accidental-follow" },
            { i18n("Sharp"),          "1slotSharp()",         "sharp_accidental",        "accidental-sharp" },
            { i18n("Flat"),           "1slotFlat()",          "flat_accidental",         "accidental-flat" },
            { i18n("Natural"),        "1slotNatural()",       "natural_accidental",      "accidental-natural" },
            { i18n("Double sharp"),   "1slotDoubleSharp()",   "double_sharp_accidental", "accidental-doublesharp" },
            { i18n("Double flat"),    "1slotDoubleFlat()",    "double_flat_accidental",  "accidental-doubleflat" }
        };

    for (unsigned int i = 0;
       i < sizeof(actionsAccidental)/sizeof(actionsAccidental[0]); ++i) {

        icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
                        (actionsAccidental[i][3])));
        noteAction = new KRadioAction(actionsAccidental[i][0], icon, 0, this,
                                      actionsAccidental[i][1],
                                      actionCollection(), actionsAccidental[i][2]);
        noteAction->setExclusiveGroup("accidentals");
    }
    

    //
    // Clefs
    //

    // Treble
    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("clef-treble")));
    noteAction = new KRadioAction(i18n("&Treble Clef"), icon, 0, this,
                                  SLOT(slotTrebleClef()),
                                  actionCollection(), "treble_clef");
    noteAction->setExclusiveGroup("notes");

    // Tenor
    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("clef-tenor")));
    noteAction = new KRadioAction(i18n("Te&nor Clef"), icon, 0, this,
                                  SLOT(slotTenorClef()),
                                  actionCollection(), "tenor_clef");
    noteAction->setExclusiveGroup("notes");

    // Alto
    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("clef-alto")));
    noteAction = new KRadioAction(i18n("&Alto Clef"), icon, 0, this,
                                  SLOT(slotAltoClef()),
                                  actionCollection(), "alto_clef");
    noteAction->setExclusiveGroup("notes");

    // Bass
    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("clef-bass")));
    noteAction = new KRadioAction(i18n("&Bass Clef"), icon, 0, this,
                                  SLOT(slotBassClef()),
                                  actionCollection(), "bass_clef");
    noteAction->setExclusiveGroup("notes");


    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("text")));
    noteAction = new KRadioAction(i18n("&Text"), icon, Key_F8, this,
                                  SLOT(slotText()),
                                  actionCollection(), "text");
    noteAction->setExclusiveGroup("notes");

    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("fretboard")));
    noteAction = new KRadioAction(i18n("&Fretboard"), icon, Key_F9, this,
                                  SLOT(slotFretboard()),
                                  actionCollection(), "fretboard");
    noteAction->setExclusiveGroup("notes");

/*    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("lilypond")));
    noteAction = new KRadioAction(i18n("Lil&ypond Directive"), icon, Key_F9, this,
                                  SLOT(slotLilypondDirective()),
                                  actionCollection(), "lilypond_directive");
    noteAction->setExclusiveGroup("notes"); */


    //
    // Edition tools (eraser, selector...)
    //
    noteAction = new KRadioAction(i18n("&Erase"), "eraser", Key_F4,
                                  this, SLOT(slotEraseSelected()),
                                  actionCollection(), "erase");
    noteAction->setExclusiveGroup("notes");

    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("select")));
    noteAction = new KRadioAction(i18n("&Select"), icon, Key_F2,
                                  this, SLOT(slotSelectSelected()),
                                  actionCollection(), "select");
    noteAction->setExclusiveGroup("notes");

    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("step_by_step")));
    new KToggleAction(i18n("Ste&p Recording"), icon, 0, this,
                SLOT(slotToggleStepByStep()), actionCollection(),
                "toggle_step_by_step");


    // Edit menu
    new KAction(i18n("Select from Sta&rt"), 0, this,
            SLOT(slotEditSelectFromStart()), actionCollection(),
            "select_from_start");

    new KAction(i18n("Select to &End"), 0, this,
            SLOT(slotEditSelectToEnd()), actionCollection(),
            "select_to_end");

    new KAction(i18n("Select Whole St&aff"), Key_A + CTRL, this,
            SLOT(slotEditSelectWholeStaff()), actionCollection(),
            "select_whole_staff");

    new KAction(i18n("C&ut and Close"), CTRL + SHIFT + Key_X, this,
            SLOT(slotEditCutAndClose()), actionCollection(),
            "cut_and_close");

    new KAction(i18n("Pa&ste..."), CTRL + SHIFT + Key_V, this,
            SLOT(slotEditGeneralPaste()), actionCollection(),
            "general_paste");

    new KAction(i18n("De&lete"), Key_Delete, this,
            SLOT(slotEditDelete()), actionCollection(),
            "delete");

    //
    // Settings menu
    //
    int layoutMode = m_config->readNumEntry("layoutmode", 0);

    QString pixmapDir = KGlobal::dirs()->findResource("appdata", "pixmaps/");

    QCanvasPixmap pixmap(pixmapDir + "/toolbar/linear-layout.xpm");
    icon = QIconSet(pixmap);
    KRadioAction *linearModeAction = new KRadioAction
        (i18n("&Linear Layout"), icon, 0, this, SLOT(slotLinearMode()),
         actionCollection(), "linear_mode");
    linearModeAction->setExclusiveGroup("layoutMode");
    if (layoutMode == 0) linearModeAction->setChecked(true);

    pixmap.load(pixmapDir + "/toolbar/continuous-page-mode.xpm");
    icon = QIconSet(pixmap);
    KRadioAction *continuousPageModeAction = new KRadioAction
        (i18n("&Continuous Page Layout"), icon, 0, this, SLOT(slotContinuousPageMode()),
         actionCollection(), "continuous_page_mode");
    continuousPageModeAction->setExclusiveGroup("layoutMode");
    if (layoutMode == 1) continuousPageModeAction->setChecked(true);

    pixmap.load(pixmapDir + "/toolbar/multi-page-mode.xpm");
    icon = QIconSet(pixmap);
    KRadioAction *multiPageModeAction = new KRadioAction
        (i18n("&Multiple Page Layout"), icon, 0, this, SLOT(slotMultiPageMode()),
         actionCollection(), "multi_page_mode");
    multiPageModeAction->setExclusiveGroup("layoutMode");
    if (layoutMode == 2) multiPageModeAction->setChecked(true);

    new KToggleAction(i18n("Show Ch&ord Name Ruler"), 0, this,
                      SLOT(slotToggleChordsRuler()),
                      actionCollection(), "show_chords_ruler");

    new KToggleAction(i18n("Show Ra&w Note Ruler"), 0, this,
                      SLOT(slotToggleRawNoteRuler()),
                      actionCollection(), "show_raw_note_ruler");

    new KToggleAction(i18n("Show &Tempo Ruler"), 0, this,
                      SLOT(slotToggleTempoRuler()),
                      actionCollection(), "show_tempo_ruler");

    new KToggleAction(i18n("Show &Annotations"), 0, this,
                      SLOT(slotToggleAnnotations()),
                      actionCollection(), "show_annotations");

    new KToggleAction(i18n("Show Lily&Pond Directives"), 0, this,
                      SLOT(slotToggleLilyPondDirectives()),
                      actionCollection(), "show_lilypond_directives");

    new KAction(i18n("Open L&yric Editor"), 0, this, SLOT(slotEditLyrics()),
            actionCollection(), "lyric_editor");

    //
    // Group menu
    //
    icon = QIconSet
        (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
        ("group-beam")));

    new KAction(NotesMenuBeamCommand::getGlobalName(), icon, Key_B + CTRL, this,
                SLOT(slotGroupBeam()), actionCollection(), "beam");

    new KAction(NotesMenuAutoBeamCommand::getGlobalName(), 0, this,
                SLOT(slotGroupAutoBeam()), actionCollection(), "auto_beam");

    icon = QIconSet
        (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
        ("group-unbeam")));

    new KAction(NotesMenuBreakCommand::getGlobalName(), icon, Key_U + CTRL, this,
                SLOT(slotGroupBreak()), actionCollection(), "break_group");
    
    icon = QIconSet
        (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
        ("group-simple-tuplet")));

    new KAction(AdjustMenuTupletCommand::getGlobalName(true), icon, Key_R + CTRL, this,
            SLOT(slotGroupSimpleTuplet()), actionCollection(), "simple_tuplet");

    icon = QIconSet
        (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
        ("group-tuplet")));

    new KAction(AdjustMenuTupletCommand::getGlobalName(false), icon, Key_T + CTRL, this,
            SLOT(slotGroupGeneralTuplet()), actionCollection(), "tuplet");

    new KAction(AdjustMenuUnTupletCommand::getGlobalName(), 0, this,
                SLOT(slotGroupUnTuplet()), actionCollection(), "break_tuplets");

    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("triplet")));
    (new KToggleAction(i18n("Trip&let Insert Mode"), icon, Key_G,
                   this, SLOT(slotUpdateInsertModeStatus()),
                       actionCollection(), "triplet_mode"))->
      setChecked(false);

    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("chord")));
    (new KToggleAction(i18n("C&hord Insert Mode"), icon, Key_H,
                   this, SLOT(slotUpdateInsertModeStatus()),
                  actionCollection(), "chord_mode"))->
      setChecked(false);

    icon = QIconSet
        (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
        ("group-grace")));

    new KAction(AdjustMenuGraceCommand::getGlobalName(), icon, 0, this,
            SLOT(slotGroupGrace()), actionCollection(), "grace");

    new KAction(AdjustMenuUnGraceCommand::getGlobalName(), 0, this,
            SLOT(slotGroupUnGrace()), actionCollection(), "ungrace");

    icon = QIconSet
        (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
        ("group-slur")));

    new KAction(NotesMenuAddIndicationCommand::getGlobalName
                (Rosegarden::Indication::Slur), icon, Key_ParenRight, this,
                SLOT(slotGroupSlur()), actionCollection(), "slur");

    new KAction(NotesMenuAddIndicationCommand::getGlobalName
                (Rosegarden::Indication::PhrasingSlur), 0, Key_ParenRight + CTRL, this,
                SLOT(slotGroupPhrasingSlur()), actionCollection(), "phrasing_slur");

    icon = QIconSet
        (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
        ("group-glissando")));

    new KAction(NotesMenuAddIndicationCommand::getGlobalName
                (Rosegarden::Indication::Glissando), icon, 0, this,
                SLOT(slotGroupGlissando()), actionCollection(), "glissando");

    icon = QIconSet
        (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
        ("group-crescendo")));

    new KAction(NotesMenuAddIndicationCommand::getGlobalName
                (Rosegarden::Indication::Crescendo), icon, Key_Less, this,
                SLOT(slotGroupCrescendo()), actionCollection(), "crescendo");

    icon = QIconSet
        (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
        ("group-decrescendo")));

    new KAction(NotesMenuAddIndicationCommand::getGlobalName
                (Rosegarden::Indication::Decrescendo), icon, Key_Greater, this,
                SLOT(slotGroupDecrescendo()), actionCollection(), "decrescendo");

    new KAction(NotesMenuAddIndicationCommand::getGlobalName
                (Rosegarden::Indication::QuindicesimaUp), 0, 0, this,
                SLOT(slotGroupOctave2Up()), actionCollection(), "octave_2up");

    icon = QIconSet
        (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
        ("group-ottava")));

    new KAction(NotesMenuAddIndicationCommand::getGlobalName
                (Rosegarden::Indication::OttavaUp), icon, 0, this,
                SLOT(slotGroupOctaveUp()), actionCollection(), "octave_up");

    new KAction(NotesMenuAddIndicationCommand::getGlobalName
                (Rosegarden::Indication::OttavaDown), 0, 0, this,
                SLOT(slotGroupOctaveDown()), actionCollection(), "octave_down");

    new KAction(NotesMenuAddIndicationCommand::getGlobalName
                (Rosegarden::Indication::QuindicesimaDown), 0, 0, this,
                SLOT(slotGroupOctave2Down()), actionCollection(), "octave_2down");

    icon = QIconSet
        (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
        ("group-chord")));
    new KAction(AdjustMenuMakeChordCommand::getGlobalName(), icon, 0, this,
            SLOT(slotGroupMakeChord()), actionCollection(), "make_chord");

    // setup Transforms menu
    new KAction(AdjustMenuNormalizeRestsCommand::getGlobalName(), Key_N + CTRL, this,
                SLOT(slotTransformsNormalizeRests()), actionCollection(),
                "normalize_rests");

    new KAction(AdjustMenuCollapseRestsCommand::getGlobalName(), 0, this,
                SLOT(slotTransformsCollapseRests()), actionCollection(),
                "collapse_rests_aggressively");

    new KAction(AdjustMenuCollapseNotesCommand::getGlobalName(), Key_Equal + CTRL, this,
                SLOT(slotTransformsCollapseNotes()), actionCollection(),
                "collapse_notes");

    icon = QIconSet
        (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
        ("transforms-tie")));

    new KAction(NotesMenuTieNotesCommand::getGlobalName(), icon, Key_AsciiTilde, this,
                SLOT(slotTransformsTieNotes()), actionCollection(),
                "tie_notes");

    new KAction(AdjustMenuUntieNotesCommand::getGlobalName(), 0, this,
                SLOT(slotTransformsUntieNotes()), actionCollection(),
                "untie_notes");

    new KAction(AdjustMenuMakeNotesViableCommand::getGlobalName(), 0, this,
            SLOT(slotTransformsMakeNotesViable()), actionCollection(),
            "make_notes_viable");

    icon = QIconSet
        (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
        ("transforms-decounterpoint")));

    new KAction(AdjustMenuDeCounterpointCommand::getGlobalName(), icon, 0, this,
            SLOT(slotTransformsDeCounterpoint()), actionCollection(),
            "de_counterpoint");

    new KAction(AdjustMenuChangeStemsCommand::getGlobalName(true),
            0, Key_PageUp + CTRL, this,
                SLOT(slotTransformsStemsUp()), actionCollection(),
                "stems_up");

    new KAction(AdjustMenuChangeStemsCommand::getGlobalName(false),
            0, Key_PageDown + CTRL, this,
                SLOT(slotTransformsStemsDown()), actionCollection(),
                "stems_down");

    new KAction(AdjustMenuRestoreStemsCommand::getGlobalName(), 0, this,
                SLOT(slotTransformsRestoreStems()), actionCollection(),
                "restore_stems");

    new KAction(AdjustMenuChangeSlurPositionCommand::getGlobalName(true),
            0, this,
                SLOT(slotTransformsSlursAbove()), actionCollection(),
                "slurs_above");

    new KAction(AdjustMenuChangeSlurPositionCommand::getGlobalName(false),
            0, this,
                SLOT(slotTransformsSlursBelow()), actionCollection(),
                "slurs_below");

    new KAction(AdjustMenuRestoreSlursCommand::getGlobalName(), 0, this,
                SLOT(slotTransformsRestoreSlurs()), actionCollection(),
                "restore_slurs");

    new KAction(RespellCommand::getGlobalName
            (RespellCommand::Set, Rosegarden::Accidentals::DoubleFlat),
            0, this,
            SLOT(slotRespellDoubleFlat()), actionCollection(),
                "respell_doubleflat");

    new KAction(RespellCommand::getGlobalName
            (RespellCommand::Set, Rosegarden::Accidentals::Flat),
            0, this,
            SLOT(slotRespellFlat()), actionCollection(),
                "respell_flat");

    new KAction(RespellCommand::getGlobalName
            (RespellCommand::Set, Rosegarden::Accidentals::Natural),
            0, this,
            SLOT(slotRespellNatural()), actionCollection(),
                "respell_natural");

    new KAction(RespellCommand::getGlobalName
            (RespellCommand::Set, Rosegarden::Accidentals::Sharp),
            0, this,
            SLOT(slotRespellSharp()), actionCollection(),
                "respell_sharp");

    new KAction(RespellCommand::getGlobalName
            (RespellCommand::Set, Rosegarden::Accidentals::DoubleSharp),
            0, this,
            SLOT(slotRespellDoubleSharp()), actionCollection(),
                "respell_doublesharp");

    new KAction(RespellCommand::getGlobalName
            (RespellCommand::Up, Rosegarden::Accidentals::NoAccidental),
            Key_Up + CTRL + SHIFT, this,
            SLOT(slotRespellUp()), actionCollection(),
                "respell_up");

    new KAction(RespellCommand::getGlobalName
            (RespellCommand::Down, Rosegarden::Accidentals::NoAccidental),
            Key_Down + CTRL + SHIFT, this,
            SLOT(slotRespellDown()), actionCollection(),
                "respell_down");

    new KAction(RespellCommand::getGlobalName
            (RespellCommand::Restore, Rosegarden::Accidentals::NoAccidental),
            0, this,
            SLOT(slotRespellRestore()), actionCollection(),
                "respell_restore");

    new KAction(MakeAccidentalsCautionaryCommand::getGlobalName(true),
            0, this,
            SLOT(slotShowCautionary()), actionCollection(),
            "show_cautionary");

    new KAction(MakeAccidentalsCautionaryCommand::getGlobalName(false),
            0, this,
            SLOT(slotCancelCautionary()), actionCollection(),
            "cancel_cautionary");

    icon = QIconSet
        (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
        ("quantize")));

    new KAction(EventQuantizeCommand::getGlobalName(), icon, Key_Equal, this,
                SLOT(slotTransformsQuantize()), actionCollection(),
                "quantize");

    new KAction(AdjustMenuFixNotationQuantizeCommand::getGlobalName(), 0,
            this, SLOT(slotTransformsFixQuantization()), actionCollection(),
                "fix_quantization");

    new KAction(AdjustMenuRemoveNotationQuantizeCommand::getGlobalName(), 0,
            this, SLOT(slotTransformsRemoveQuantization()), actionCollection(),
                "remove_quantization");

    new KAction(AdjustMenuInterpretCommand::getGlobalName(), 0,
            this, SLOT(slotTransformsInterpret()), actionCollection(),
            "interpret");

    new KAction(i18n("&Dump selected events to stderr"), 0, this,
            SLOT(slotDebugDump()), actionCollection(), "debug_dump");

    for (MarkActionDataMap::Iterator i = m_markActionDataMap->begin();
       i != m_markActionDataMap->end(); ++i) {

        const MarkActionData &markActionData = *i;

      icon = QIconSet(NotePixmapFactory::toQPixmap
                  (NotePixmapFactory::makeMarkMenuPixmap(markActionData.mark)));

      new KAction(markActionData.title,
                icon,
                markActionData.keycode,
                this,
                SLOT(slotAddMark()),
                actionCollection(),
                markActionData.actionName);
    }

    icon = QIconSet
        (NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
        ("text-mark")));

    new KAction(NotesMenuAddTextMarkCommand::getGlobalName(), icon, 0, this,
                SLOT(slotMarksAddTextMark()), actionCollection(),
                "add_text_mark");

    new KAction(NotesMenuAddFingeringMarkCommand::getGlobalName("0"), 0, Key_0 + ALT, this,
                SLOT(slotMarksAddFingeringMarkFromAction()), actionCollection(),
                "add_fingering_0");

    new KAction(NotesMenuAddFingeringMarkCommand::getGlobalName("1"), 0, Key_1 + ALT, this,
                SLOT(slotMarksAddFingeringMarkFromAction()), actionCollection(),
                "add_fingering_1");

    new KAction(NotesMenuAddFingeringMarkCommand::getGlobalName("2"), 0, Key_2 + ALT, this,
                SLOT(slotMarksAddFingeringMarkFromAction()), actionCollection(),
                "add_fingering_2");

    new KAction(NotesMenuAddFingeringMarkCommand::getGlobalName("3"), 0, Key_3 + ALT, this,
                SLOT(slotMarksAddFingeringMarkFromAction()), actionCollection(),
                "add_fingering_3");

    new KAction(NotesMenuAddFingeringMarkCommand::getGlobalName("4"), 0, Key_4 + ALT, this,
                SLOT(slotMarksAddFingeringMarkFromAction()), actionCollection(),
                "add_fingering_4");

    new KAction(NotesMenuAddFingeringMarkCommand::getGlobalName("5"), 0, Key_5 + ALT, this,
                SLOT(slotMarksAddFingeringMarkFromAction()), actionCollection(),
                "add_fingering_5");

    new KAction(NotesMenuAddFingeringMarkCommand::getGlobalName("+"), 0, Key_9 + ALT, this,
                SLOT(slotMarksAddFingeringMarkFromAction()), actionCollection(),
                "add_fingering_plus");

    new KAction(NotesMenuAddFingeringMarkCommand::getGlobalName(), 0, 0, this,
                SLOT(slotMarksAddFingeringMark()), actionCollection(),
                "add_fingering_mark");

    new KAction(NotesMenuRemoveMarksCommand::getGlobalName(), 0, this,
                SLOT(slotMarksRemoveMarks()), actionCollection(),
                "remove_marks");

    new KAction(NotesMenuRemoveFingeringMarksCommand::getGlobalName(), 0, this,
                SLOT(slotMarksRemoveFingeringMarks()), actionCollection(),
                "remove_fingering_marks");

    new KAction(i18n("Ma&ke Ornament..."), 0, this,
            SLOT(slotMakeOrnament()), actionCollection(),
            "make_ornament");

    new KAction(i18n("Trigger &Ornament..."), 0, this,
            SLOT(slotUseOrnament()), actionCollection(),
            "use_ornament");

    new KAction(i18n("Remove Ornament..."), 0, this,
            SLOT(slotRemoveOrnament()), actionCollection(),
            "remove_ornament");

    static QString slashTitles[] = {
      i18n("&None"), "&1", "&2", "&3", "&4", "&5"
    };
    for (int i = 0; i <= 5; ++i) {
      new KAction(slashTitles[i], 0, this,
                SLOT(slotAddSlashes()), actionCollection(),
                QString("slashes_%1").arg(i));
    }

    new KAction(i18n("Add Fretboard"),
            0,
            this,
            SLOT(slotAddFretboard()),
            actionCollection(),
            "add_fretboard");

    new KAction(ClefInsertionCommand::getGlobalName(), 0, this,
                SLOT(slotEditAddClef()), actionCollection(),
                "add_clef");

    new KAction(KeyInsertionCommand::getGlobalName(), 0, this,
                SLOT(slotEditAddKeySignature()), actionCollection(),
                "add_key_signature");

    new KAction(SustainInsertionCommand::getGlobalName(true), 0, this,
                SLOT(slotEditAddSustainDown()), actionCollection(),
                "add_sustain_down");

    new KAction(SustainInsertionCommand::getGlobalName(false), 0, this,
                SLOT(slotEditAddSustainUp()), actionCollection(),
                "add_sustain_up");

    // setup Settings menu
    static QString actionsToolbars[][4] = 
        {
            { i18n("Show T&ools Toolbar"),  "1slotToggleToolsToolBar()",  "show_tools_toolbar",                    "palette-tools" },
            { i18n("Show &Notes Toolbar"),  "1slotToggleNotesToolBar()",  "show_notes_toolbar",                    "palette-notes" },
            { i18n("Show &Rests Toolbar"),  "1slotToggleRestsToolBar()",  "show_rests_toolbar",                    "palette-rests" },
            { i18n("Show &Accidentals Toolbar"),   "1slotToggleAccidentalsToolBar()",  "show_accidentals_toolbar", "palette-accidentals" },
            { i18n("Show Cle&fs Toolbar"),  "1slotToggleClefsToolBar()",  "show_clefs_toolbar",
          "palette-clefs" },
            { i18n("Show &Marks Toolbar"), "1slotToggleMarksToolBar()",   "show_marks_toolbar",
          "palette-marks" },
            { i18n("Show &Group Toolbar"), "1slotToggleGroupToolBar()",   "show_group_toolbar",
          "palette-group" },            
            { i18n("Show &Layout Toolbar"), "1slotToggleLayoutToolBar()", "show_layout_toolbar",
          "palette-font" },
            { i18n("Show Trans&port Toolbar"), "1slotToggleTransportToolBar()", "show_transport_toolbar",
        "palette-transport" },
            { i18n("Show M&eta Toolbar"), "1slotToggleMetaToolBar()", "show_meta_toolbar",
          "palette-meta" }
        };

    for (unsigned int i = 0;
       i < sizeof(actionsToolbars)/sizeof(actionsToolbars[0]); ++i) {

        icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap(actionsToolbars[i][3])));

        new KToggleAction(actionsToolbars[i][0], icon, 0,
                          this, actionsToolbars[i][1],
                          actionCollection(), actionsToolbars[i][2]);
    }

    new KAction(i18n("Cursor &Back"), 0, Key_Left, this,
            SLOT(slotStepBackward()), actionCollection(),
            "cursor_back");

    new KAction(i18n("Cursor &Forward"), 0, Key_Right, this,
            SLOT(slotStepForward()), actionCollection(),
            "cursor_forward");

    new KAction(i18n("Cursor Ba&ck Bar"), 0, Key_Left + CTRL, this,
            SLOT(slotJumpBackward()), actionCollection(),
            "cursor_back_bar");

    new KAction(i18n("Cursor For&ward Bar"), 0, Key_Right + CTRL, this,
            SLOT(slotJumpForward()), actionCollection(),
            "cursor_forward_bar");

    new KAction(i18n("Cursor Back and Se&lect"), SHIFT + Key_Left, this,
            SLOT(slotExtendSelectionBackward()), actionCollection(),
            "extend_selection_backward");

    new KAction(i18n("Cursor Forward and &Select"), SHIFT + Key_Right, this,
            SLOT(slotExtendSelectionForward()), actionCollection(),
            "extend_selection_forward");

    new KAction(i18n("Cursor Back Bar and Select"), SHIFT + CTRL + Key_Left, this,
            SLOT(slotExtendSelectionBackwardBar()), actionCollection(),
            "extend_selection_backward_bar");

    new KAction(i18n("Cursor Forward Bar and Select"), SHIFT + CTRL + Key_Right, this,
            SLOT(slotExtendSelectionForwardBar()), actionCollection(),
            "extend_selection_forward_bar");

/*!!! not here yet
    new KAction(i18n("Move Selection Left"), Key_Minus, this,
            SLOT(slotMoveSelectionLeft()), actionCollection(),
            "move_selection_left");
*/

    new KAction(i18n("Cursor to St&art"), 0,
            /* #1025717: conflicting meanings for ctrl+a - dupe with Select All
              Key_A + CTRL, */ this,
            SLOT(slotJumpToStart()), actionCollection(),
            "cursor_start");

    new KAction(i18n("Cursor to &End"), 0, Key_E + CTRL, this,
            SLOT(slotJumpToEnd()), actionCollection(),
            "cursor_end");

    new KAction(i18n("Cursor &Up Staff"), 0, Key_Up + SHIFT, this,
            SLOT(slotCurrentStaffUp()), actionCollection(),
            "cursor_up_staff");

    new KAction(i18n("Cursor &Down Staff"), 0, Key_Down + SHIFT, this,
            SLOT(slotCurrentStaffDown()), actionCollection(),
            "cursor_down_staff");

    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
                ("transport-cursor-to-pointer")));
    new KAction(i18n("Cursor to &Playback Pointer"), icon, 0, this,
            SLOT(slotJumpCursorToPlayback()), actionCollection(),
            "cursor_to_playback_pointer");

    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
                ("transport-play")));
    new KAction(i18n("&Play"), icon, Key_Enter, this,
            SIGNAL(play()), actionCollection(), "play");

    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
                ("transport-stop")));
    new KAction(i18n("&Stop"), icon, Key_Insert, this,
            SIGNAL(stop()), actionCollection(), "stop");

    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
                ("transport-rewind")));
    new KAction(i18n("Re&wind"), icon, Key_End, this,
            SIGNAL(rewindPlayback()), actionCollection(),
            "playback_pointer_back_bar");

    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
                ("transport-ffwd")));
    new KAction(i18n("&Fast Forward"), icon, Key_PageDown, this,
            SIGNAL(fastForwardPlayback()), actionCollection(),
            "playback_pointer_forward_bar");

    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
                ("transport-rewind-end")));
    new KAction(i18n("Rewind to &Beginning"), icon, 0, this,
            SIGNAL(rewindPlaybackToBeginning()), actionCollection(),
            "playback_pointer_start");

    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
                ("transport-ffwd-end")));
    new KAction(i18n("Fast Forward to &End"), icon, 0, this,
            SIGNAL(fastForwardPlaybackToEnd()), actionCollection(),
            "playback_pointer_end");

    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
                ("transport-pointer-to-cursor")));
    new KAction(i18n("Playback Pointer to &Cursor"), icon, 0, this,
            SLOT(slotJumpPlaybackToCursor()), actionCollection(),
            "playback_pointer_to_cursor");

    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
                                                 ("transport-solo")));
    new KToggleAction(i18n("&Solo"), icon, 0, this,
                SLOT(slotToggleSolo()), actionCollection(),
                "toggle_solo");

    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
                                                 ("transport-tracking")));
    (new KToggleAction(i18n("Scro&ll to Follow Playback"), icon, Key_Pause, this,
                   SLOT(slotToggleTracking()), actionCollection(),
                   "toggle_tracking"))->setChecked(m_playTracking);

    icon = QIconSet(NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap
                    ("transport-panic")));
    new KAction(i18n("Panic"), icon, Key_P + CTRL + ALT, this,
                SIGNAL(panic()), actionCollection(), "panic");

    new KAction(i18n("Set Loop to Selection"), Key_Semicolon + CTRL, this,
            SLOT(slotPreviewSelection()), actionCollection(),
            "preview_selection");

    new KAction(i18n("Clear L&oop"), Key_Colon + CTRL, this,
            SLOT(slotClearLoop()), actionCollection(),
            "clear_loop");

    new KAction(i18n("Clear Selection"), Key_Escape, this,
            SLOT(slotClearSelection()), actionCollection(),
            "clear_selection");

//    QString pixmapDir =
//    KGlobal::dirs()->findResource("appdata", "pixmaps/");
//    icon = QIconSet(QCanvasPixmap(pixmapDir + "/toolbar/eventfilter.xpm"));
    new KAction(i18n("&Filter Selection"), "filter", Key_F + CTRL, this,
                SLOT(slotFilterSelection()), actionCollection(),
                "filter_selection");

    new KAction(i18n("Push &Left"), 0, this,
            SLOT(slotFinePositionLeft()), actionCollection(),
            "fine_position_left");

    new KAction(i18n("Push &Right"), 0, this,
            SLOT(slotFinePositionRight()), actionCollection(),
            "fine_position_right");

    new KAction(i18n("Push &Up"), 0, this,
            SLOT(slotFinePositionUp()), actionCollection(),
            "fine_position_up");

    new KAction(i18n("Push &Down"), 0, this,
            SLOT(slotFinePositionDown()), actionCollection(),
            "fine_position_down");

    new KAction(i18n("Restore &Computed Positions"), 0, this,
            SLOT(slotFinePositionRestore()), actionCollection(),
            "fine_position_restore");

    new KAction(i18n("Make &Invisible"), 0, this,
            SLOT(slotMakeInvisible()), actionCollection(),
            "make_invisible");

    new KAction(i18n("Make &Visible"), 0, this,
            SLOT(slotMakeVisible()), actionCollection(),
            "make_visible");

    new KAction(i18n("Toggle Dot"), Key_Period, this,
            SLOT(slotToggleDot()), actionCollection(),
            "toggle_dot");

    new KAction(i18n("Add Dot"), Key_Period + CTRL, this,
            SLOT(slotAddDot()), actionCollection(),
            "add_dot");

    new KAction(i18n("Add Dot"), Key_Period + CTRL + ALT, this,
            SLOT(slotAddDotNotationOnly()), actionCollection(),
            "add_notation_dot");

    createGUI(getRCFileName(), false);
}


Generated by  Doxygen 1.6.0   Back to index