Exemplo n.º 1
0
void DXmlGuiWindow::createSidebarActions()
{
    KActionCollection* const ac = actionCollection();
    QAction* const tlsb = new QAction(i18n("Toggle Left Side-bar"), this);
    connect(tlsb, SIGNAL(triggered()), this, SLOT(slotToggleLeftSideBar()));
    ac->addAction(QLatin1String("toggle-left-sidebar"), tlsb);
    ac->setDefaultShortcut(tlsb, Qt::CTRL + Qt::META + Qt::Key_Left);

    QAction* const trsb = new QAction(i18n("Toggle Right Side-bar"), this);
    connect(trsb, SIGNAL(triggered()), this, SLOT(slotToggleRightSideBar()));
    ac->addAction(QLatin1String("toggle-right-sidebar"), trsb);
    ac->setDefaultShortcut(trsb, Qt::CTRL + Qt::META + Qt::Key_Right);

    QAction* const plsb = new QAction(i18n("Previous Left Side-bar Tab"), this);
    connect(plsb, SIGNAL(triggered()), this, SLOT(slotPreviousLeftSideBarTab()));
    ac->addAction(QLatin1String("previous-left-sidebar-tab"), plsb);
    ac->setDefaultShortcut(plsb, Qt::CTRL + Qt::META + Qt::Key_Home);

    QAction* const nlsb = new QAction(i18n("Next Left Side-bar Tab"), this);
    connect(nlsb, SIGNAL(triggered()), this, SLOT(slotNextLeftSideBarTab()));
    ac->addAction(QLatin1String("next-left-sidebar-tab"), nlsb);
    ac->setDefaultShortcut(nlsb, Qt::CTRL + Qt::META + Qt::Key_End);

    QAction* const prsb = new QAction(i18n("Previous Right Side-bar Tab"), this);
    connect(prsb, SIGNAL(triggered()), this, SLOT(slotPreviousRightSideBarTab()));
    ac->addAction(QLatin1String("previous-right-sidebar-tab"), prsb);
    ac->setDefaultShortcut(prsb, Qt::CTRL + Qt::META + Qt::Key_PageUp);

    QAction* const nrsb = new QAction(i18n("Next Right Side-bar Tab"), this);
    connect(nrsb, SIGNAL(triggered()), this, SLOT(slotNextRightSideBarTab()));
    ac->addAction(QLatin1String("next-right-sidebar-tab"), nrsb);
    ac->setDefaultShortcut(nrsb, Qt::CTRL + Qt::META + Qt::Key_PageDown);
}
Exemplo n.º 2
0
void DXmlGuiWindow::createSidebarActions()
{
    KAction* const tlsb = new KAction(i18n("Toggle Left Side-bar"), this);
    tlsb->setShortcut(KShortcut(Qt::CTRL + Qt::META + Qt::Key_Left));
    tlsb->setShortcutConfigurable(true);
    connect(tlsb, SIGNAL(triggered()), this, SLOT(slotToggleLeftSideBar()));
    actionCollection()->addAction("toggle-left-sidebar", tlsb);

    KAction* const trsb = new KAction(i18n("Toggle Right Side-bar"), this);
    trsb->setShortcut(KShortcut(Qt::CTRL + Qt::META + Qt::Key_Right));
    trsb->setShortcutConfigurable(true);
    connect(trsb, SIGNAL(triggered()), this, SLOT(slotToggleRightSideBar()));
    actionCollection()->addAction("toggle-right-sidebar", trsb);

    KAction* const plsb = new KAction(i18n("Previous Left Side-bar Tab"), this);
    plsb->setShortcut(KShortcut(Qt::CTRL + Qt::META + Qt::Key_Home));
    plsb->setShortcutConfigurable(true);
    connect(plsb, SIGNAL(triggered()), this, SLOT(slotPreviousLeftSideBarTab()));
    actionCollection()->addAction("previous-left-sidebar-tab", plsb);

    KAction* const nlsb = new KAction(i18n("Next Left Side-bar Tab"), this);
    nlsb->setShortcut(KShortcut(Qt::CTRL + Qt::META + Qt::Key_End));
    nlsb->setShortcutConfigurable(true);
    connect(nlsb, SIGNAL(triggered()), this, SLOT(slotNextLeftSideBarTab()));
    actionCollection()->addAction("next-left-sidebar-tab", nlsb);

    KAction* const prsb = new KAction(i18n("Previous Right Side-bar Tab"), this);
    prsb->setShortcut(KShortcut(Qt::CTRL + Qt::META + Qt::Key_PageUp));
    prsb->setShortcutConfigurable(true);
    connect(prsb, SIGNAL(triggered()), this, SLOT(slotPreviousRightSideBarTab()));
    actionCollection()->addAction("previous-right-sidebar-tab", prsb);

    KAction* const nrsb = new KAction(i18n("Next Right Side-bar Tab"), this);
    nrsb->setShortcut(KShortcut(Qt::CTRL + Qt::META + Qt::Key_PageDown));
    nrsb->setShortcutConfigurable(true);
    connect(nrsb, SIGNAL(triggered()), this, SLOT(slotNextRightSideBarTab()));
    actionCollection()->addAction("next-right-sidebar-tab", nrsb);
}