mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +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();
|
addSeparator();
|
||||||
|
|
||||||
QList<QAction *> additionalActions;
|
QList<QAction *> additionalActions;
|
||||||
if (props.isDirectory() && props.isLocal()) {
|
if (props.isDirectory() && props.isLocal() && ContextMenuSettings::showOpenTerminal()) {
|
||||||
additionalActions << m_mainWindow->actionCollection()->action(QStringLiteral("open_terminal"));
|
additionalActions << m_mainWindow->actionCollection()->action(QStringLiteral("open_terminal"));
|
||||||
}
|
}
|
||||||
fileItemActions.addActionsTo(this, KFileItemActions::MenuActionSource::All, additionalActions);
|
fileItemActions.addActionsTo(this, KFileItemActions::MenuActionSource::All, additionalActions);
|
||||||
|
|
|
@ -122,6 +122,8 @@ bool ContextMenuSettingsPage::entryVisible(const QString& id)
|
||||||
return ContextMenuSettings::showCopyLocation();
|
return ContextMenuSettings::showCopyLocation();
|
||||||
} else if (id == "duplicate") {
|
} else if (id == "duplicate") {
|
||||||
return ContextMenuSettings::showDuplicateHere();
|
return ContextMenuSettings::showDuplicateHere();
|
||||||
|
} else if (id == "open_terminal") {
|
||||||
|
return ContextMenuSettings::showOpenTerminal();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -142,6 +144,8 @@ void ContextMenuSettingsPage::setEntryVisible(const QString& id, bool visible)
|
||||||
ContextMenuSettings::setShowCopyLocation(visible);
|
ContextMenuSettings::setShowCopyLocation(visible);
|
||||||
} else if (id == "duplicate") {
|
} else if (id == "duplicate") {
|
||||||
ContextMenuSettings::setShowDuplicateHere(visible);
|
ContextMenuSettings::setShowDuplicateHere(visible);
|
||||||
|
} else if (id == "open_terminal") {
|
||||||
|
ContextMenuSettings::setShowOpenTerminal(visible);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,5 +38,9 @@
|
||||||
<label>Show 'Duplicate Here' in context menu.</label>
|
<label>Show 'Duplicate Here' in context menu.</label>
|
||||||
<default>true</default>
|
<default>true</default>
|
||||||
</entry>
|
</entry>
|
||||||
|
<entry name="ShowOpenTerminal" type="Bool">
|
||||||
|
<label>Show 'Open Terminal' in context menu.</label>
|
||||||
|
<default>true</default>
|
||||||
|
</entry>
|
||||||
</group>
|
</group>
|
||||||
</kcfg>
|
</kcfg>
|
||||||
|
|
|
@ -85,7 +85,8 @@ DolphinSettingsDialog::DolphinSettingsDialog(const QUrl& url, QWidget* parent, K
|
||||||
QStringLiteral("open_in_new_tab"),
|
QStringLiteral("open_in_new_tab"),
|
||||||
QStringLiteral("open_in_new_window"),
|
QStringLiteral("open_in_new_window"),
|
||||||
QStringLiteral("copy_location"),
|
QStringLiteral("copy_location"),
|
||||||
QStringLiteral("duplicate")
|
QStringLiteral("duplicate"),
|
||||||
|
QStringLiteral("open_terminal"),
|
||||||
});
|
});
|
||||||
KPageWidgetItem* contextMenuSettingsFrame = addPage(contextMenuSettingsPage,
|
KPageWidgetItem* contextMenuSettingsFrame = addPage(contextMenuSettingsPage,
|
||||||
i18nc("@title:group", "Context Menu"));
|
i18nc("@title:group", "Context Menu"));
|
||||||
|
|
Loading…
Reference in a new issue