| 47 | } |
| 48 | |
| 49 | void NotebookView::initActions() { |
| 50 | m_actionGroup = new QActionGroup(this); |
| 51 | m_actionGroup->setExclusive(false); |
| 52 | |
| 53 | // general notebook specific actions |
| 54 | m_zoomIn = new QAction(QIcon::fromTheme(QLatin1String("zoom-in")), i18n("Zoom In"), m_actionGroup); |
| 55 | m_zoomIn->setData(QStringLiteral("view_zoom_in")); |
| 56 | m_zoomIn->setShortcut(Qt::CTRL | Qt::Key_Plus); |
| 57 | |
| 58 | m_zoomOut = new QAction(QIcon::fromTheme(QLatin1String("zoom-out")), i18n("Zoom Out"), m_actionGroup); |
| 59 | m_zoomOut->setData(QStringLiteral("view_zoom_out")); |
| 60 | m_zoomOut->setShortcut(Qt::CTRL | Qt::Key_Minus); |
| 61 | |
| 62 | m_find = new QAction(QIcon::fromTheme(QLatin1String("edit-find")), i18n("Find"), m_actionGroup); |
| 63 | m_find->setData(QStringLiteral("edit_find")); |
| 64 | m_find->setShortcut(Qt::CTRL | Qt::Key_F); |
| 65 | |
| 66 | m_replace = new QAction(QIcon::fromTheme(QLatin1String("edit-find-replace")), i18n("Replace"), m_actionGroup); |
| 67 | m_replace->setData(QStringLiteral("edit_replace")); |
| 68 | m_replace->setShortcut(Qt::CTRL | Qt::Key_R); |
| 69 | |
| 70 | m_restartBackendAction = new QAction(QIcon::fromTheme(QLatin1String("system-reboot")), i18n("Restart Backend"), m_actionGroup); |
| 71 | m_restartBackendAction->setData(QStringLiteral("restart_backend")); |
| 72 | |
| 73 | m_evaluateWorsheetAction = new QAction(QIcon::fromTheme(QLatin1String("system-run")), i18n("Evaluate Notebook"), m_actionGroup); |
| 74 | m_evaluateWorsheetAction->setData(QStringLiteral("evaluate_worksheet")); |
| 75 | |
| 76 | // all other actions are initialized in initMenus() since they are only required for the main and context menu |
| 77 | |
| 78 | connect(m_actionGroup, &QActionGroup::triggered, this, &NotebookView::triggerAction); |
| 79 | } |
| 80 | |
| 81 | void NotebookView::initMenus() { |
| 82 | // initialize the remaining actions |