Changeset View
Changeset View
Standalone View
Standalone View
src/dolphinpart.cpp
Show First 20 Lines • Show All 174 Lines • ▼ Show 20 Line(s) | 162 | { | |||
---|---|---|---|---|---|
175 | selectItemsMatching->setText(i18nc("@action:inmenu Edit", "Select Items Matching...")); | 175 | selectItemsMatching->setText(i18nc("@action:inmenu Edit", "Select Items Matching...")); | ||
176 | actionCollection()->setDefaultShortcut(selectItemsMatching, Qt::CTRL + Qt::Key_S); | 176 | actionCollection()->setDefaultShortcut(selectItemsMatching, Qt::CTRL + Qt::Key_S); | ||
177 | connect(selectItemsMatching, &QAction::triggered, this, &DolphinPart::slotSelectItemsMatchingPattern); | 177 | connect(selectItemsMatching, &QAction::triggered, this, &DolphinPart::slotSelectItemsMatchingPattern); | ||
178 | 178 | | |||
179 | QAction* unselectItemsMatching = actionCollection()->addAction(QStringLiteral("unselect_items_matching")); | 179 | QAction* unselectItemsMatching = actionCollection()->addAction(QStringLiteral("unselect_items_matching")); | ||
180 | unselectItemsMatching->setText(i18nc("@action:inmenu Edit", "Unselect Items Matching...")); | 180 | unselectItemsMatching->setText(i18nc("@action:inmenu Edit", "Unselect Items Matching...")); | ||
181 | connect(unselectItemsMatching, &QAction::triggered, this, &DolphinPart::slotUnselectItemsMatchingPattern); | 181 | connect(unselectItemsMatching, &QAction::triggered, this, &DolphinPart::slotUnselectItemsMatchingPattern); | ||
182 | 182 | | |||
183 | actionCollection()->addAction(KStandardAction::SelectAll, QStringLiteral("select_all"), m_view, SLOT(selectAll())); | 183 | KStandardAction::selectAll(m_view, &DolphinView::selectAll, actionCollection()); | ||
elvisangelaccio: Please port to `KStandardAction::selectAll()` also here. | |||||
184 | 184 | | |||
185 | QAction* unselectAll = actionCollection()->addAction(QStringLiteral("unselect_all")); | 185 | QAction* unselectAll = actionCollection()->addAction(QStringLiteral("unselect_all")); | ||
186 | unselectAll->setText(i18nc("@action:inmenu Edit", "Unselect All")); | 186 | unselectAll->setText(i18nc("@action:inmenu Edit", "Unselect All")); | ||
187 | connect(unselectAll, &QAction::triggered, m_view, &DolphinView::clearSelection); | 187 | connect(unselectAll, &QAction::triggered, m_view, &DolphinView::clearSelection); | ||
188 | 188 | | |||
rizzitello: should a shortcut be set for this action? | |||||
rominf: I don't know. I just unhardcoded (softcoded?) shortcuts | |||||
Whether or not this action should get a shortcut (I think it should!) Is unrelated to this patch and should be handled separately. But in fact I don't even see it exposed in the UI at all... ngraham: Whether or not this action should get a shortcut (I think it should!) Is unrelated to this… | |||||
189 | QAction* invertSelection = actionCollection()->addAction(QStringLiteral("invert_selection")); | 189 | QAction* invertSelection = actionCollection()->addAction(QStringLiteral("invert_selection")); | ||
190 | invertSelection->setText(i18nc("@action:inmenu Edit", "Invert Selection")); | 190 | invertSelection->setText(i18nc("@action:inmenu Edit", "Invert Selection")); | ||
191 | actionCollection()->setDefaultShortcut(invertSelection, Qt::CTRL + Qt::SHIFT + Qt::Key_A); | 191 | actionCollection()->setDefaultShortcut(invertSelection, Qt::CTRL + Qt::SHIFT + Qt::Key_A); | ||
192 | connect(invertSelection, &QAction::triggered, m_view, &DolphinView::invertSelection); | 192 | connect(invertSelection, &QAction::triggered, m_view, &DolphinView::invertSelection); | ||
193 | 193 | | |||
194 | // View menu: all done by DolphinViewActionHandler | 194 | // View menu: all done by DolphinViewActionHandler | ||
195 | 195 | | |||
196 | // Go menu | 196 | // Go menu | ||
Show All 14 Lines | |||||
211 | createGoAction("go_trash", "user-trash", | 211 | createGoAction("go_trash", "user-trash", | ||
212 | i18nc("@action:inmenu Go", "Trash"), QStringLiteral("trash:/"), | 212 | i18nc("@action:inmenu Go", "Trash"), QStringLiteral("trash:/"), | ||
213 | goActionGroup); | 213 | goActionGroup); | ||
214 | createGoAction("go_autostart", "", | 214 | createGoAction("go_autostart", "", | ||
215 | i18nc("@action:inmenu Go", "Autostart"), QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/autostart", | 215 | i18nc("@action:inmenu Go", "Autostart"), QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/autostart", | ||
216 | goActionGroup); | 216 | goActionGroup); | ||
217 | 217 | | |||
218 | // Tools menu | 218 | // Tools menu | ||
219 | m_findFileAction = actionCollection()->addAction(QStringLiteral("find_file")); | 219 | m_findFileAction = KStandardAction::find(this, &DolphinPart::slotFindFile, actionCollection()); | ||
220 | m_findFileAction->setText(i18nc("@action:inmenu Tools", "Find File...")); | 220 | m_findFileAction->setText(i18nc("@action:inmenu Tools", "Find File...")); | ||
221 | actionCollection()->setDefaultShortcut(m_findFileAction, Qt::CTRL + Qt::Key_F); | | |||
222 | m_findFileAction->setIcon(QIcon::fromTheme(QStringLiteral("edit-find"))); | | |||
223 | connect(m_findFileAction, &QAction::triggered, this, &DolphinPart::slotFindFile); | | |||
224 | 221 | | |||
elvisangelaccio: Please use `KStandardAction::Find`. | |||||
225 | #ifndef Q_OS_WIN | 222 | #ifndef Q_OS_WIN | ||
226 | if (KAuthorized::authorize(QStringLiteral("shell_access"))) { | 223 | if (KAuthorized::authorize(QStringLiteral("shell_access"))) { | ||
227 | m_openTerminalAction = actionCollection()->addAction(QStringLiteral("open_terminal")); | 224 | m_openTerminalAction = actionCollection()->addAction(QStringLiteral("open_terminal")); | ||
228 | m_openTerminalAction->setIcon(QIcon::fromTheme(QStringLiteral("utilities-terminal"))); | 225 | m_openTerminalAction->setIcon(QIcon::fromTheme(QStringLiteral("utilities-terminal"))); | ||
229 | m_openTerminalAction->setText(i18nc("@action:inmenu Tools", "Open &Terminal")); | 226 | m_openTerminalAction->setText(i18nc("@action:inmenu Tools", "Open &Terminal")); | ||
230 | connect(m_openTerminalAction, &QAction::triggered, this, &DolphinPart::slotOpenTerminal); | 227 | connect(m_openTerminalAction, &QAction::triggered, this, &DolphinPart::slotOpenTerminal); | ||
231 | actionCollection()->setDefaultShortcut(m_openTerminalAction, Qt::Key_F4); | 228 | actionCollection()->setDefaultShortcut(m_openTerminalAction, Qt::Key_F4); | ||
232 | } | 229 | } | ||
▲ Show 20 Lines • Show All 385 Lines • Show Last 20 Lines |
Please port to KStandardAction::selectAll() also here.