Commit 08a4edad authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

DolphinContextMenu: Allow disabling "Open Terminal" action

BUG: 436323
FIXED-IN: 21.08
parent 996e430b
Pipeline #61459 passed with stage
in 5 minutes and 23 seconds
......@@ -508,7 +508,7 @@ void DolphinContextMenu::addAdditionalActions(KFileItemActions &fileItemActions,
addSeparator();
QList<QAction *> additionalActions;
if (props.isDirectory() && props.isLocal()) {
if (props.isDirectory() && props.isLocal() && ContextMenuSettings::showOpenTerminal()) {
additionalActions << m_mainWindow->actionCollection()->action(QStringLiteral("open_terminal"));
}
fileItemActions.addActionsTo(this, KFileItemActions::MenuActionSource::All, additionalActions);
......
......@@ -122,6 +122,8 @@ bool ContextMenuSettingsPage::entryVisible(const QString& id)
return ContextMenuSettings::showCopyLocation();
} else if (id == "duplicate") {
return ContextMenuSettings::showDuplicateHere();
} else if (id == "open_terminal") {
return ContextMenuSettings::showOpenTerminal();
}
return false;
}
......@@ -142,6 +144,8 @@ void ContextMenuSettingsPage::setEntryVisible(const QString& id, bool visible)
ContextMenuSettings::setShowCopyLocation(visible);
} else if (id == "duplicate") {
ContextMenuSettings::setShowDuplicateHere(visible);
} else if (id == "open_terminal") {
ContextMenuSettings::setShowOpenTerminal(visible);
}
}
......
......@@ -38,5 +38,9 @@
<label>Show 'Duplicate Here' in context menu.</label>
<default>true</default>
</entry>
<entry name="ShowOpenTerminal" type="Bool">
<label>Show 'Open Terminal' in context menu.</label>
<default>true</default>
</entry>
</group>
</kcfg>
......@@ -85,7 +85,8 @@ DolphinSettingsDialog::DolphinSettingsDialog(const QUrl& url, QWidget* parent, K
QStringLiteral("open_in_new_tab"),
QStringLiteral("open_in_new_window"),
QStringLiteral("copy_location"),
QStringLiteral("duplicate")
QStringLiteral("duplicate"),
QStringLiteral("open_terminal"),
});
KPageWidgetItem* contextMenuSettingsFrame = addPage(contextMenuSettingsPage,
i18nc("@title:group", "Context Menu"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment