mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-21 17:30:15 +00:00
DolphinContextMenu: Allow disabling "Open Terminal" action
BUG: 436323 FIXED-IN: 21.08
This commit is contained in:
parent
996e430b62
commit
08a4edad3e
|
@ -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"));
|
||||
|
|
Loading…
Reference in a new issue