Changeset View
Changeset View
Standalone View
Standalone View
src/views/dolphinviewactionhandler.cpp
Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Line(s) | 90 | { | |||
---|---|---|---|---|---|
117 | 117 | | |||
118 | // This action is useful for being enabled when KStandardAction::MoveToTrash should be | 118 | // This action is useful for being enabled when KStandardAction::MoveToTrash should be | ||
119 | // disabled and KStandardAction::DeleteFile is enabled (e.g. non-local files), so that Key_Del | 119 | // disabled and KStandardAction::DeleteFile is enabled (e.g. non-local files), so that Key_Del | ||
120 | // can be used for deleting the file (#76016). It needs to be a separate action | 120 | // can be used for deleting the file (#76016). It needs to be a separate action | ||
121 | // so that the Edit menu isn't affected. | 121 | // so that the Edit menu isn't affected. | ||
122 | QAction* deleteWithTrashShortcut = m_actionCollection->addAction(QStringLiteral("delete_shortcut")); | 122 | QAction* deleteWithTrashShortcut = m_actionCollection->addAction(QStringLiteral("delete_shortcut")); | ||
123 | // The descriptive text is just for the shortcuts editor. | 123 | // The descriptive text is just for the shortcuts editor. | ||
124 | deleteWithTrashShortcut->setText(i18nc("@action \"Move to Trash\" for non-local files, etc.", "Delete (using shortcut for Trash)")); | 124 | deleteWithTrashShortcut->setText(i18nc("@action \"Move to Trash\" for non-local files, etc.", "Delete (using shortcut for Trash)")); | ||
125 | m_actionCollection->setDefaultShortcut(deleteWithTrashShortcut, QKeySequence::Delete); | 125 | m_actionCollection->setDefaultShortcuts(deleteWithTrashShortcut, KStandardShortcut::moveToTrash()); | ||
126 | deleteWithTrashShortcut->setEnabled(false); | 126 | deleteWithTrashShortcut->setEnabled(false); | ||
127 | connect(deleteWithTrashShortcut, &QAction::triggered, this, &DolphinViewActionHandler::slotDeleteItems); | 127 | connect(deleteWithTrashShortcut, &QAction::triggered, this, &DolphinViewActionHandler::slotDeleteItems); | ||
128 | 128 | | |||
129 | QAction *propertiesAction = m_actionCollection->addAction( QStringLiteral("properties") ); | 129 | QAction *propertiesAction = m_actionCollection->addAction( QStringLiteral("properties") ); | ||
130 | // Well, it's the File menu in dolphinmainwindow and the Edit menu in dolphinpart... :) | 130 | // Well, it's the File menu in dolphinmainwindow and the Edit menu in dolphinpart... :) | ||
131 | propertiesAction->setText( i18nc("@action:inmenu File", "Properties") ); | 131 | propertiesAction->setText( i18nc("@action:inmenu File", "Properties") ); | ||
132 | propertiesAction->setIcon(QIcon::fromTheme(QStringLiteral("document-properties"))); | 132 | propertiesAction->setIcon(QIcon::fromTheme(QStringLiteral("document-properties"))); | ||
133 | m_actionCollection->setDefaultShortcuts(propertiesAction, {Qt::ALT + Qt::Key_Return, Qt::ALT + Qt::Key_Enter}); | 133 | m_actionCollection->setDefaultShortcuts(propertiesAction, {Qt::ALT + Qt::Key_Return, Qt::ALT + Qt::Key_Enter}); | ||
▲ Show 20 Lines • Show All 465 Lines • Show Last 20 Lines |