MCPcopy Create free account
hub / github.com/KDE/labplot / initMenus

Method initMenus

src/frontend/notebook/NotebookView.cpp:81–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81void NotebookView::initMenus() {
82 // initialize the remaining actions
83
84 // entry specific actions
85 m_evaluateEntryAction = new QAction(QIcon::fromTheme(QLatin1String("media-playback-start")), i18n("Evaluate Entry"), m_actionGroup);
86 m_evaluateEntryAction->setShortcut(Qt::SHIFT | Qt::Key_Return);
87 m_evaluateEntryAction->setData(QStringLiteral("evaluate_current"));
88
89 m_removeCurrentEntryAction = new QAction(QIcon::fromTheme(QLatin1String("edit-delete")), i18n("Remove Current Entry"), m_actionGroup);
90 m_removeCurrentEntryAction->setData(QStringLiteral("remove_current"));
91
92 // actions for the "Add New" menu
93 auto* insertCommandEntryAction = new QAction(QIcon::fromTheme(QLatin1String("run-build")), i18n("Command"), m_actionGroup);
94 insertCommandEntryAction->setData(QStringLiteral("insert_command_entry"));
95 insertCommandEntryAction->setShortcut(Qt::CTRL | Qt::Key_Return);
96
97 auto* insertTextEntryAction = new QAction(QIcon::fromTheme(QLatin1String("draw-text")), i18n("Text"), m_actionGroup);
98 insertTextEntryAction->setData(QStringLiteral("insert_text_entry"));
99
100 // markdown entry is only available if cantor was compiled with libdiscovery (cantor 18.12 and later)
101 QAction* insertMarkdownEntryAction = nullptr;
102 if (m_part->action(QStringLiteral("insert_markdown_entry"))) {
103 insertMarkdownEntryAction = new QAction(QIcon::fromTheme(QLatin1String("text-x-markdown")), i18n("Markdown"), m_actionGroup);
104 insertMarkdownEntryAction->setData(QStringLiteral("insert_markdown_entry"));
105 }
106
107 auto* insertLatexEntryAction = new QAction(QIcon::fromTheme(QLatin1String("text-x-tex")), i18n("LaTeX"), m_actionGroup);
108 insertLatexEntryAction->setData(QStringLiteral("insert_latex_entry"));
109
110 auto* insertImageEntryAction = new QAction(QIcon::fromTheme(QLatin1String("image-x-generic")), i18n("Image"), m_actionGroup);
111 insertImageEntryAction->setData(QStringLiteral("insert_image_entry"));
112
113 auto* insertPageBreakAction = new QAction(QIcon::fromTheme(QLatin1String("go-next-view-page")), i18n("Page Break"), m_actionGroup);
114 insertPageBreakAction->setData(QStringLiteral("insert_page_break_entry"));
115
116 // auto* insertHorizLineAction = new QAction(QIcon::fromTheme(QLatin1String("newline")), i18n("Horizontal Line"), m_actionGroup);
117 // insertHorizLineAction->setData(QStringLiteral("insert_horizontal_line_entry"));
118
119 // auto* insertHierarchyEntryAction = new QAction(QIcon::fromTheme(QLatin1String("view-list-tree")), i18n("Hierarchy"), m_actionGroup);
120 // insertHierarchyEntryAction->setData(QStringLiteral("insert_hierarchy_entry"));
121
122 // actions for "assistants", that are backend specific and not always available
123 QAction* computeEigenvectorsAction = nullptr;
124 if (m_part->action(QStringLiteral("eigenvectors_assistant"))) {
125 computeEigenvectorsAction = new QAction(i18n("Compute Eigenvectors"), m_actionGroup);
126 computeEigenvectorsAction->setData(QStringLiteral("eigenvectors_assistant"));
127 }
128
129 QAction* createMatrixAction = nullptr;
130 if (m_part->action(QStringLiteral("creatematrix_assistant"))) {
131 createMatrixAction = new QAction(i18n("Create Matrix"), m_actionGroup);
132 createMatrixAction->setData(QStringLiteral("creatematrix_assistant"));
133 }
134
135 QAction* computeEigenvaluesAction = nullptr;
136 if (m_part->action(QStringLiteral("eigenvalues_assistant"))) {
137 computeEigenvaluesAction = new QAction(i18n("Compute Eigenvalues"), m_actionGroup);
138 computeEigenvaluesAction->setData(QStringLiteral("eigenvalues_assistant"));

Callers

nothing calls this directly

Calls 4

addSeparatorMethod · 0.80
setDataMethod · 0.45
widgetMethod · 0.45
setIconMethod · 0.45

Tested by

no test coverage detected