Add options to hide some context menu entries

This commit add options to hide the following context menu entries:
- Add to Places
- Copy Location
- Duplicate Here
- Open in New Tab and Open in New Tabs
- Open in New Window
- Sort By
- View Mode

The Services settings page is renamed to Context Menu

ShowCopyMoveMenu option is moved from GeneralSettings to ContextMenuSettings

BUG: 314594
This commit is contained in:
Duong Do Minh Chau 2020-11-12 16:38:44 +07:00 committed by Elvis Angelaccio
parent b339ac1b5f
commit a512176b4b
23 changed files with 343 additions and 364 deletions

View file

@ -134,6 +134,7 @@ kconfig_add_kcfg_files(dolphinprivate_LIB_SRCS GENERATE_MOC
settings/dolphin_detailsmodesettings.kcfgc
settings/dolphin_iconsmodesettings.kcfgc
settings/dolphin_generalsettings.kcfgc
settings/dolphin_contextmenusettings.kcfgc
settings/dolphin_versioncontrolsettings.kcfgc
)
@ -238,7 +239,7 @@ set(dolphinstatic_SRCS
settings/general/statusbarsettingspage.cpp
settings/dolphinsettingsdialog.cpp
settings/navigation/navigationsettingspage.cpp
settings/services/servicessettingspage.cpp
settings/contextmenu/contextmenusettingspage.cpp
settings/settingspagebase.cpp
settings/serviceitemdelegate.cpp
settings/servicemodel.cpp
@ -285,6 +286,7 @@ kconfig_add_kcfg_files(dolphinstatic_SRCS GENERATE_MOC
settings/dolphin_compactmodesettings.kcfgc
settings/dolphin_detailsmodesettings.kcfgc
settings/dolphin_generalsettings.kcfgc
settings/dolphin_contextmenusettings.kcfgc
settings/dolphin_iconsmodesettings.kcfgc
search/dolphin_searchsettings.kcfgc
settings/dolphin_versioncontrolsettings.kcfgc
@ -369,9 +371,9 @@ set(kcm_dolphinnavigation_PART_SRCS
settings/navigation/navigationsettingspage.cpp
settings/settingspagebase.cpp)
set(kcm_dolphinservices_PART_SRCS
settings/kcm/kcmdolphinservices.cpp
settings/services/servicessettingspage.cpp
set(kcm_dolphincontextmenu_PART_SRCS
settings/kcm/kcmdolphincontextmenu.cpp
settings/contextmenu/contextmenusettingspage.cpp
settings/settingspagebase.cpp
settings/serviceitemdelegate.cpp
settings/servicemodel.cpp)
@ -398,8 +400,9 @@ kconfig_add_kcfg_files(kcm_dolphinviewmodes_PART_SRCS
kconfig_add_kcfg_files(kcm_dolphinnavigation_PART_SRCS
settings/dolphin_generalsettings.kcfgc)
kconfig_add_kcfg_files(kcm_dolphinservices_PART_SRCS
kconfig_add_kcfg_files(kcm_dolphincontextmenu_PART_SRCS
settings/dolphin_generalsettings.kcfgc
settings/dolphin_contextmenusettings.kcfgc
settings/dolphin_versioncontrolsettings.kcfgc)
kconfig_add_kcfg_files(kcm_dolphingeneral_PART_SRCS
@ -410,29 +413,29 @@ if(NOT WIN32)
# The settings are still accessible from the hamburger menu
add_library(kcm_dolphinviewmodes MODULE ${kcm_dolphinviewmodes_PART_SRCS})
add_library(kcm_dolphinnavigation MODULE ${kcm_dolphinnavigation_PART_SRCS})
add_library(kcm_dolphinservices MODULE ${kcm_dolphinservices_PART_SRCS})
add_library(kcm_dolphincontextmenu MODULE ${kcm_dolphincontextmenu_PART_SRCS})
add_library(kcm_dolphingeneral MODULE ${kcm_dolphingeneral_PART_SRCS})
target_link_libraries(kcm_dolphinviewmodes dolphinprivate)
target_link_libraries(kcm_dolphinnavigation dolphinprivate)
target_link_libraries(kcm_dolphinservices dolphinprivate)
target_link_libraries(kcm_dolphincontextmenu dolphinprivate)
target_link_libraries(kcm_dolphingeneral dolphinprivate)
install( FILES org.kde.dolphin.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} )
install( FILES settings/kcm/kcmdolphinviewmodes.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} )
install( FILES settings/kcm/kcmdolphinnavigation.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} )
install( FILES settings/kcm/kcmdolphinservices.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} )
install( FILES settings/kcm/kcmdolphincontextmenu.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} )
install( FILES settings/kcm/kcmdolphingeneral.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} )
install(TARGETS kcm_dolphinviewmodes DESTINATION ${KDE_INSTALL_PLUGINDIR} )
install(TARGETS kcm_dolphinnavigation DESTINATION ${KDE_INSTALL_PLUGINDIR} )
install(TARGETS kcm_dolphinservices DESTINATION ${KDE_INSTALL_PLUGINDIR} )
install(TARGETS kcm_dolphincontextmenu DESTINATION ${KDE_INSTALL_PLUGINDIR} )
install(TARGETS kcm_dolphingeneral DESTINATION ${KDE_INSTALL_PLUGINDIR} )
endif()
if(NOT WIN32)
add_subdirectory(settings/services/servicemenuinstaller)
install( FILES settings/services/servicemenu.knsrc DESTINATION ${KDE_INSTALL_KNSRCDIR} )
add_subdirectory(settings/contextmenu/servicemenuinstaller)
install( FILES settings/contextmenu/servicemenu.knsrc DESTINATION ${KDE_INSTALL_KNSRCDIR} )
endif()
########### install files ###############
@ -447,6 +450,7 @@ install(
install( FILES settings/dolphin_directoryviewpropertysettings.kcfg
settings/dolphin_generalsettings.kcfg
settings/dolphin_contextmenusettings.kcfg
settings/dolphin_compactmodesettings.kcfg
settings/dolphin_iconsmodesettings.kcfg
settings/dolphin_detailsmodesettings.kcfg

View file

@ -7,6 +7,7 @@
#include "dolphincontextmenu.h"
#include "dolphin_generalsettings.h"
#include "dolphin_contextmenusettings.h"
#include "dolphinmainwindow.h"
#include "dolphinnewfilemenu.h"
#include "dolphinplacesmodelsingleton.h"
@ -185,32 +186,33 @@ void DolphinContextMenu::openTrashItemContextMenu()
void DolphinContextMenu::addDirectoryItemContextMenu(KFileItemActions &fileItemActions)
{
// insert 'Open in new window' and 'Open in new tab' entries
const KFileItemListProperties& selectedItemsProps = selectedItemsProperties();
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("open_in_new_tab")));
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("open_in_new_window")));
if (ContextMenuSettings::showOpenInNewTab()) {
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("open_in_new_tab")));
}
if (ContextMenuSettings::showOpenInNewWindow()) {
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("open_in_new_window")));
}
// Insert 'Open With' entries
addOpenWithActions(fileItemActions);
// set up 'Create New' menu
DolphinNewFileMenu* newFileMenu = new DolphinNewFileMenu(m_mainWindow->actionCollection(), m_mainWindow);
const DolphinView* view = m_mainWindow->activeViewContainer()->view();
newFileMenu->setViewShowsHiddenFiles(view->hiddenFilesShown());
newFileMenu->checkUpToDate();
newFileMenu->setPopupFiles(QList<QUrl>() << m_fileInfo.url());
newFileMenu->setEnabled(selectedItemsProps.supportsWriting());
connect(newFileMenu, &DolphinNewFileMenu::fileCreated, newFileMenu, &DolphinNewFileMenu::deleteLater);
connect(newFileMenu, &DolphinNewFileMenu::directoryCreated, newFileMenu, &DolphinNewFileMenu::deleteLater);
DolphinNewFileMenu* newFileMenu = new DolphinNewFileMenu(m_mainWindow->actionCollection(), m_mainWindow);
const DolphinView* view = m_mainWindow->activeViewContainer()->view();
newFileMenu->setViewShowsHiddenFiles(view->hiddenFilesShown());
newFileMenu->checkUpToDate();
newFileMenu->setPopupFiles(QList<QUrl>() << m_fileInfo.url());
newFileMenu->setEnabled(selectedItemsProps.supportsWriting());
connect(newFileMenu, &DolphinNewFileMenu::fileCreated, newFileMenu, &DolphinNewFileMenu::deleteLater);
connect(newFileMenu, &DolphinNewFileMenu::directoryCreated, newFileMenu, &DolphinNewFileMenu::deleteLater);
QMenu* menu = newFileMenu->menu();
menu->setTitle(i18nc("@title:menu Create new folder, file, link, etc.", "Create New"));
menu->setIcon(QIcon::fromTheme(QStringLiteral("document-new")));
menu->setParent(this, Qt::Popup);
addMenu(menu);
QMenu* menu = newFileMenu->menu();
menu->setTitle(i18nc("@title:menu Create new folder, file, link, etc.", "Create New"));
menu->setIcon(QIcon::fromTheme(QStringLiteral("document-new")));
addMenu(menu);
addSeparator();
addSeparator();
}
void DolphinContextMenu::openItemContextMenu()
@ -271,7 +273,7 @@ void DolphinContextMenu::openItemContextMenu()
}
}
if (selectionHasOnlyDirs) {
if (selectionHasOnlyDirs && ContextMenuSettings::showOpenInNewTab()) {
// insert 'Open in new tab' entry
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("open_in_new_tabs")));
}
@ -284,7 +286,7 @@ void DolphinContextMenu::openItemContextMenu()
addAdditionalActions(fileItemActions, selectedItemsProps);
// insert 'Copy To' and 'Move To' sub menus
if (GeneralSettings::showCopyMoveMenu()) {
if (ContextMenuSettings::showCopyMoveMenu()) {
m_copyToMenu.setUrls(m_selectedItems.urlList());
m_copyToMenu.setReadOnly(!selectedItemsProps.supportsWriting());
m_copyToMenu.setAutoErrorHandlingEnabled(true);
@ -334,14 +336,22 @@ void DolphinContextMenu::openViewportContextMenu()
}
// Insert 'Add to Places' entry if it's not already in the places panel
if (!placeExists(m_mainWindow->activeViewContainer()->url())) {
if (ContextMenuSettings::showAddToPlaces() &&
!placeExists(m_mainWindow->activeViewContainer()->url())) {
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("add_to_places")));
}
addSeparator();
// Insert 'Sort By' and 'View Mode'
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("sort")));
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("view_mode")));
if (ContextMenuSettings::showSortBy()) {
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("sort")));
}
if (ContextMenuSettings::showViewMode()) {
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("view_mode")));
}
if (ContextMenuSettings::showSortBy() || ContextMenuSettings::showViewMode()) {
addSeparator();
}
addAdditionalActions(fileItemActions, baseUrlProperties);
addCustomActions();
@ -363,25 +373,30 @@ void DolphinContextMenu::insertDefaultItemActions(const KFileItemListProperties&
// Insert 'Cut', 'Copy', 'Copy Location' and 'Paste'
addAction(collection->action(KStandardAction::name(KStandardAction::Cut)));
addAction(collection->action(KStandardAction::name(KStandardAction::Copy)));
QAction* copyPathAction = collection->action(QString("copy_location"));
copyPathAction->setEnabled(m_selectedItems.size() == 1);
addAction(copyPathAction);
if (ContextMenuSettings::showCopyLocation()) {
QAction* copyPathAction = collection->action(QString("copy_location"));
copyPathAction->setEnabled(m_selectedItems.size() == 1);
addAction(copyPathAction);
}
QAction* pasteAction = createPasteAction();
if (pasteAction) {
addAction(pasteAction);
}
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("duplicate")));
// Insert 'Duplicate Here'
if (ContextMenuSettings::showDuplicateHere()) {
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("duplicate")));
}
// Insert 'Rename'
addAction(collection->action(KStandardAction::name(KStandardAction::RenameFile)));
// insert 'Add to Places' entry if appropriate
if (m_selectedItems.count() == 1) {
if (m_fileInfo.isDir()) {
if (!placeExists(m_fileInfo.url())) {
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("add_to_places")));
}
}
// Insert 'Add to Places' entry if appropriate
if (ContextMenuSettings::showAddToPlaces() &&
m_selectedItems.count() == 1 &&
m_fileInfo.isDir() &&
!placeExists(m_fileInfo.url())) {
addAction(m_mainWindow->actionCollection()->action(QStringLiteral("add_to_places")));
}
addSeparator();

View file

@ -4,10 +4,11 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "servicessettingspage.h"
#include "contextmenusettingspage.h"
#include "dolphin_generalsettings.h"
#include "dolphin_versioncontrolsettings.h"
#include "dolphin_contextmenusettings.h"
#include "settings/serviceitemdelegate.h"
#include "settings/servicemodel.h"
@ -34,9 +35,16 @@ namespace
const char VersionControlServicePrefix[] = "_version_control_";
const char DeleteService[] = "_delete";
const char CopyToMoveToService[] ="_copy_to_move_to";
const char AddToPlacesService[] = "_add_to_places";
const char SortByService[] = "_sort_by";
const char ViewModeService[] = "_view_mode";
const char OpenInNewTabService[] = "_open_in_new_tab";
const char OpenInNewWindowService[] = "_open_in_new_window";
const char CopyLocationService[] = "_copy_location";
const char DuplicateHereService[] = "_duplicate_here";
}
ServicesSettingsPage::ServicesSettingsPage(QWidget* parent) :
ContextMenuSettingsPage::ContextMenuSettingsPage(QWidget* parent) :
SettingsPageBase(parent),
m_initialized(false),
m_serviceModel(nullptr),
@ -70,7 +78,7 @@ ServicesSettingsPage::ServicesSettingsPage(QWidget* parent) :
m_listView->setModel(m_sortModel);
m_listView->setItemDelegate(delegate);
m_listView->setVerticalScrollMode(QListView::ScrollPerPixel);
connect(m_listView, &QListView::clicked, this, &ServicesSettingsPage::changed);
connect(m_listView, &QListView::clicked, this, &ContextMenuSettingsPage::changed);
#ifndef Q_OS_WIN
auto *downloadButton = new KNS3::Button(i18nc("@action:button", "Download New Services..."),
@ -96,9 +104,10 @@ ServicesSettingsPage::ServicesSettingsPage(QWidget* parent) :
std::sort(m_enabledVcsPlugins.begin(), m_enabledVcsPlugins.end());
}
ServicesSettingsPage::~ServicesSettingsPage() = default;
ContextMenuSettingsPage::~ContextMenuSettingsPage() {
}
void ServicesSettingsPage::applySettings()
void ContextMenuSettingsPage::applySettings()
{
if (!m_initialized) {
return;
@ -125,8 +134,29 @@ void ServicesSettingsPage::applySettings()
configGroup.writeEntry("ShowDeleteCommand", checked);
configGroup.sync();
} else if (service == QLatin1String(CopyToMoveToService)) {
GeneralSettings::setShowCopyMoveMenu(checked);
GeneralSettings::self()->save();
ContextMenuSettings::setShowCopyMoveMenu(checked);
ContextMenuSettings::self()->save();
} else if (service == QLatin1String(AddToPlacesService)) {
ContextMenuSettings::setShowAddToPlaces(checked);
ContextMenuSettings::self()->save();
} else if (service == QLatin1String(SortByService)) {
ContextMenuSettings::setShowSortBy(checked);
ContextMenuSettings::self()->save();
} else if (service == QLatin1String(ViewModeService)) {
ContextMenuSettings::setShowViewMode(checked);
ContextMenuSettings::self()->save();
} else if (service == QLatin1String(OpenInNewTabService)) {
ContextMenuSettings::setShowOpenInNewTab(checked);
ContextMenuSettings::self()->save();
} else if (service == QLatin1String(OpenInNewWindowService)) {
ContextMenuSettings::setShowOpenInNewWindow(checked);
ContextMenuSettings::self()->save();
} else if (service == QLatin1String(CopyLocationService)) {
ContextMenuSettings::setShowCopyLocation(checked);
ContextMenuSettings::self()->save();
} else if (service == QLatin1String(DuplicateHereService)) {
ContextMenuSettings::setShowDuplicateHere(checked);
ContextMenuSettings::self()->save();
} else {
showGroup.writeEntry(service, checked);
}
@ -146,7 +176,7 @@ void ServicesSettingsPage::applySettings()
}
}
void ServicesSettingsPage::restoreDefaults()
void ContextMenuSettingsPage::restoreDefaults()
{
QAbstractItemModel* model = m_listView->model();
for (int i = 0; i < model->rowCount(); ++i) {
@ -160,7 +190,7 @@ void ServicesSettingsPage::restoreDefaults()
}
}
void ServicesSettingsPage::showEvent(QShowEvent* event)
void ContextMenuSettingsPage::showEvent(QShowEvent* event)
{
if (!event->spontaneous() && !m_initialized) {
loadServices();
@ -179,7 +209,37 @@ void ServicesSettingsPage::showEvent(QShowEvent* event)
addRow(QStringLiteral("edit-copy"),
i18nc("@option:check", "'Copy To' and 'Move To' commands"),
CopyToMoveToService,
GeneralSettings::showCopyMoveMenu());
ContextMenuSettings::showCopyMoveMenu());
// Add other built-in actions
addRow(QStringLiteral("bookmark-new"),
i18nc("@option:check", "Add to Places"),
AddToPlacesService,
ContextMenuSettings::showAddToPlaces());
addRow(QStringLiteral("view-sort"),
i18nc("@option:check", "Sort By"),
SortByService,
ContextMenuSettings::showSortBy());
addRow(QStringLiteral("view-list-icons"),
i18nc("@option:check", "View Mode"),
ViewModeService,
ContextMenuSettings::showViewMode());
addRow(QStringLiteral("folder-new"),
i18nc("@option:check", "'Open in New Tab' and 'Open in New Tabs'"),
OpenInNewTabService,
ContextMenuSettings::showOpenInNewTab());
addRow(QStringLiteral("window-new"),
i18nc("@option:check", "Open in New Window"),
OpenInNewWindowService,
ContextMenuSettings::showOpenInNewWindow());
addRow(QStringLiteral("edit-copy"),
i18nc("@option:check", "Copy Location"),
CopyLocationService,
ContextMenuSettings::showCopyLocation());
addRow(QStringLiteral("edit-copy"),
i18nc("@option:check", "Duplicate Here"),
DuplicateHereService,
ContextMenuSettings::showDuplicateHere());
m_sortModel->sort(Qt::DisplayRole);
@ -188,7 +248,7 @@ void ServicesSettingsPage::showEvent(QShowEvent* event)
SettingsPageBase::showEvent(event);
}
void ServicesSettingsPage::loadServices()
void ContextMenuSettingsPage::loadServices()
{
const KConfig config(QStringLiteral("kservicemenurc"), KConfig::NoGlobals);
const KConfigGroup showGroup = config.group("Show");
@ -243,7 +303,7 @@ void ServicesSettingsPage::loadServices()
m_searchLineEdit->setFocus(Qt::OtherFocusReason);
}
void ServicesSettingsPage::loadVersionControlSystems()
void ContextMenuSettingsPage::loadVersionControlSystems()
{
const QStringList enabledPlugins = VersionControlSettings::enabledPlugins();
@ -260,7 +320,7 @@ void ServicesSettingsPage::loadVersionControlSystems()
m_sortModel->sort(Qt::DisplayRole);
}
bool ServicesSettingsPage::isInServicesList(const QString &service) const
bool ContextMenuSettingsPage::isInServicesList(const QString &service) const
{
for (int i = 0; i < m_serviceModel->rowCount(); ++i) {
const QModelIndex index = m_serviceModel->index(i, 0);
@ -271,10 +331,10 @@ bool ServicesSettingsPage::isInServicesList(const QString &service) const
return false;
}
void ServicesSettingsPage::addRow(const QString &icon,
const QString &text,
const QString &value,
bool checked)
void ContextMenuSettingsPage::addRow(const QString &icon,
const QString &text,
const QString &value,
bool checked)
{
m_serviceModel->insertRow(0);
@ -284,4 +344,3 @@ void ServicesSettingsPage::addRow(const QString &icon,
m_serviceModel->setData(index, value, ServiceModel::DesktopEntryNameRole);
m_serviceModel->setData(index, checked, Qt::CheckStateRole);
}

View file

@ -3,8 +3,8 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef SERVICESSETTINGSPAGE_H
#define SERVICESSETTINGSPAGE_H
#ifndef CONTEXTMENUSETTINGSPAGE_H
#define CONTEXTMENUSETTINGSPAGE_H
#include "settings/settingspagebase.h"
@ -16,15 +16,15 @@ class ServiceModel;
class QLineEdit;
/**
* @brief Page for the 'Services' settings of the Dolphin settings dialog.
* @brief Configurations for services in the context menu.
*/
class ServicesSettingsPage : public SettingsPageBase
class ContextMenuSettingsPage : public SettingsPageBase
{
Q_OBJECT
public:
explicit ServicesSettingsPage(QWidget* parent);
~ServicesSettingsPage() override;
explicit ContextMenuSettingsPage(QWidget* parent);
~ContextMenuSettingsPage() override;
/** @see SettingsPageBase::applySettings() */
void applySettings() override;

View file

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd">
<kcfgfile name="dolphinrc"/>
<group name="ContextMenu">
<entry name="ShowCopyMoveMenu" type="Bool">
<label>Show 'Copy To' and 'Move To' commands in context menu</label>
<default>false</default>
</entry>
<entry name="ShowAddToPlaces" type="Bool">
<label>Show 'Add to Places' in context menu.</label>
<default>true</default>
</entry>
<entry name="ShowSortBy" type="Bool">
<label>Show 'Sort By' in context menu.</label>
<default>true</default>
</entry>
<entry name="ShowViewMode" type="Bool">
<label>Show 'View Mode' in context menu.</label>
<default>true</default>
</entry>
<entry name="ShowOpenInNewTab" type="Bool">
<label>Show 'Open in New Tab' and 'Open in New Tabs' in context menu.</label>
<default>true</default>
</entry>
<entry name="ShowOpenInNewWindow" type="Bool">
<label>Show 'Open in New Window' in context menu.</label>
<default>true</default>
</entry>
<entry name="ShowCopyLocation" type="Bool">
<label>Show 'Copy Location' in context menu.</label>
<default>true</default>
</entry>
<entry name="ShowDuplicateHere" type="Bool">
<label>Show 'Duplicate Here' in context menu.</label>
<default>true</default>
</entry>
</group>
</kcfg>

View file

@ -0,0 +1,4 @@
File=dolphin_contextmenusettings.kcfg
ClassName=ContextMenuSettings
Singleton=yes
Mutators=true

View file

@ -90,10 +90,6 @@
<label>Show tooltips</label>
<default>false</default>
</entry>
<entry name="ShowCopyMoveMenu" type="Bool">
<label>Show 'Copy To' and 'Move To' commands in context menu</label>
<default>false</default>
</entry>
<entry name="ViewPropsTimestamp" type="DateTime" >
<label>Timestamp since when the view properties are valid</label>
</entry>

View file

@ -10,7 +10,7 @@
#include "dolphinmainwindow.h"
#include "general/generalsettingspage.h"
#include "navigation/navigationsettingspage.h"
#include "services/servicessettingspage.h"
#include "contextmenu/contextmenusettingspage.h"
#include "startup/startupsettingspage.h"
#include "trash/trashsettingspage.h"
#include "viewmodes/viewsettingspage.h"
@ -77,12 +77,12 @@ DolphinSettingsDialog::DolphinSettingsDialog(const QUrl& url, QWidget* parent) :
navigationSettingsFrame->setIcon(QIcon::fromTheme(QStringLiteral("preferences-desktop-navigation")));
connect(navigationSettingsPage, &NavigationSettingsPage::changed, this, &DolphinSettingsDialog::enableApply);
// Services
ServicesSettingsPage* servicesSettingsPage = new ServicesSettingsPage(this);
KPageWidgetItem* servicesSettingsFrame = addPage(servicesSettingsPage,
i18nc("@title:group", "Services"));
servicesSettingsFrame->setIcon(QIcon::fromTheme(QStringLiteral("preferences-system-services")));
connect(servicesSettingsPage, &ServicesSettingsPage::changed, this, &DolphinSettingsDialog::enableApply);
// Context Menu
auto contextMenuSettingsPage = new ContextMenuSettingsPage(this);
KPageWidgetItem* contextMenuSettingsFrame = addPage(contextMenuSettingsPage,
i18nc("@title:group", "Context Menu"));
contextMenuSettingsFrame->setIcon(QIcon::fromTheme(QStringLiteral("application-menu")));
connect(contextMenuSettingsPage, &ContextMenuSettingsPage::changed, this, &DolphinSettingsDialog::enableApply);
// Trash
SettingsPageBase* trashSettingsPage = nullptr;
@ -111,7 +111,7 @@ DolphinSettingsDialog::DolphinSettingsDialog(const QUrl& url, QWidget* parent) :
m_pages.append(startupSettingsPage);
m_pages.append(viewSettingsPage);
m_pages.append(navigationSettingsPage);
m_pages.append(servicesSettingsPage);
m_pages.append(contextMenuSettingsPage);
if (trashSettingsPage) {
m_pages.append(trashSettingsPage);
}

View file

@ -0,0 +1,47 @@
/*
* SPDX-FileCopyrightText: 2009 Peter Penz <peter.penz19@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "kcmdolphincontextmenu.h"
#include "settings/contextmenu/contextmenusettingspage.h"
#include <kconfigwidgets_version.h>
#include <KPluginFactory>
#include <KPluginLoader>
#include <QVBoxLayout>
K_PLUGIN_FACTORY(KCMDolphinContextMenuConfigFactory, registerPlugin<DolphinContextMenuConfigModule>(QStringLiteral("dolphincontextmenu"));)
DolphinContextMenuConfigModule::DolphinContextMenuConfigModule(QWidget* parent, const QVariantList& args) :
KCModule(parent, args),
m_contextMenu(nullptr)
{
setButtons(KCModule::Default | KCModule::Help);
QVBoxLayout* topLayout = new QVBoxLayout(this);
topLayout->setContentsMargins(0, 0, 0, 0);
m_contextMenu = new ContextMenuSettingsPage(this);
connect(m_contextMenu, &ContextMenuSettingsPage::changed, this, &DolphinContextMenuConfigModule::markAsChanged);
topLayout->addWidget(m_contextMenu, 0, {});
}
DolphinContextMenuConfigModule::~DolphinContextMenuConfigModule()
{
}
void DolphinContextMenuConfigModule::save()
{
m_contextMenu->applySettings();
}
void DolphinContextMenuConfigModule::defaults()
{
m_contextMenu->restoreDefaults();
}
#include "kcmdolphincontextmenu.moc"

View file

@ -0,0 +1,62 @@
Name=Dolphin Context Menu
[Desktop Entry]
Icon=application-menu
Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-Library=kcm_dolphincontextmenu
X-KDE-PluginKeyword=dolphincontextmenu
X-DocPath=dolphin/index.html#preferences-dialog-services
Name=Dolphin Context Menu
X-KDE-Keywords=file manager
X-KDE-Keywords[ar]=مدير ملفّات ملفات الملفّات الملفات
X-KDE-Keywords[ast]=xestor de ficheros
X-KDE-Keywords[az]=fayl meneceri
X-KDE-Keywords[ca]=gestor de fitxers
X-KDE-Keywords[ca@valencia]=gestor de fitxers
X-KDE-Keywords[cs]=správce souborů
X-KDE-Keywords[da]=filhåndtering
X-KDE-Keywords[de]=Dateiverwaltung
X-KDE-Keywords[el]=διαχειριστής αρχείων
X-KDE-Keywords[en_GB]=file manager
X-KDE-Keywords[es]=gestor de archivos
X-KDE-Keywords[et]=failihaldur
X-KDE-Keywords[eu]=Fitxategi-kudeatzailea
X-KDE-Keywords[fi]=tiedostonhallinta
X-KDE-Keywords[fr]=gestionnaire de fichiers
X-KDE-Keywords[gl]=xestor de ficheiros
X-KDE-Keywords[he]=מנהל קבצים
X-KDE-Keywords[hu]=fájlkezelő
X-KDE-Keywords[ia]=gerente de file
X-KDE-Keywords[id]=pengelola file
X-KDE-Keywords[it]=gestore dei file
X-KDE-Keywords[ja]=
X-KDE-Keywords[ko]=
X-KDE-Keywords[lt]=failų tvarkytuvė
X-KDE-Keywords[lv]=datņu pārvaldnieks
X-KDE-Keywords[ml]=
X-KDE-Keywords[nb]=filbehandler
X-KDE-Keywords[nl]=bestandsbeheerder
X-KDE-Keywords[nn]=filhandsamar
X-KDE-Keywords[pa]=
X-KDE-Keywords[pl]=zarządzanie plikami
X-KDE-Keywords[pt]=gestor de ficheiros
X-KDE-Keywords[pt_BR]=gerenciador de arquivos
X-KDE-Keywords[ro]=gestionar de fișiere
X-KDE-Keywords[ru]=диспетчер файлов
X-KDE-Keywords[sk]=správca súborov
X-KDE-Keywords[sl]=upravljalnik datotek
X-KDE-Keywords[sr]=file manager,менаџер фајлова
X-KDE-Keywords[sr@ijekavian]=file manager,менаџер фајлова
X-KDE-Keywords[sr@ijekavianlatin]=file manager,menadžer fajlova
X-KDE-Keywords[sr@latin]=file manager,menadžer fajlova
X-KDE-Keywords[sv]=filhanterare
X-KDE-Keywords[tr]=dosya yöneticisi
X-KDE-Keywords[uk]=менеджер,керування,файл,файли
X-KDE-Keywords[vi]=file manager,trình qun lí tp
X-KDE-Keywords[x-test]=xxfile managerxx
X-KDE-Keywords[zh_CN]=
X-KDE-Keywords[zh_TW]=

View file

@ -0,0 +1,32 @@
/*
* SPDX-FileCopyrightText: 2009 Peter Penz <peter.penz19@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef KCMDOLPHINCONTEXTMENU_H
#define KCMDOLPHINCONTEXTMENU_H
#include <KCModule>
class ContextMenuSettingsPage;
/**
* @brief Allow to configure the Dolphin context menu.
*/
class DolphinContextMenuConfigModule : public KCModule
{
Q_OBJECT
public:
DolphinContextMenuConfigModule(QWidget* parent, const QVariantList& args);
~DolphinContextMenuConfigModule() override;
void save() override;
void defaults() override;
private:
ContextMenuSettingsPage *m_contextMenu;
};
#endif

View file

@ -1,46 +0,0 @@
/*
* SPDX-FileCopyrightText: 2009 Peter Penz <peter.penz19@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "kcmdolphinservices.h"
#include "settings/services/servicessettingspage.h"
#include <kconfigwidgets_version.h>
#include <KPluginFactory>
#include <QVBoxLayout>
K_PLUGIN_FACTORY(KCMDolphinServicesConfigFactory, registerPlugin<DolphinServicesConfigModule>(QStringLiteral("dolphinservices"));)
DolphinServicesConfigModule::DolphinServicesConfigModule(QWidget* parent, const QVariantList& args) :
KCModule(parent, args),
m_services(nullptr)
{
setButtons(KCModule::Default | KCModule::Help);
QVBoxLayout* topLayout = new QVBoxLayout(this);
topLayout->setContentsMargins(0, 0, 0, 0);
m_services = new ServicesSettingsPage(this);
connect(m_services, &ServicesSettingsPage::changed, this, &DolphinServicesConfigModule::markAsChanged);
topLayout->addWidget(m_services, 0, {});
}
DolphinServicesConfigModule::~DolphinServicesConfigModule()
{
}
void DolphinServicesConfigModule::save()
{
m_services->applySettings();
}
void DolphinServicesConfigModule::defaults()
{
m_services->restoreDefaults();
}
#include "kcmdolphinservices.moc"

View file

@ -1,204 +0,0 @@
Name=Dolphin Services
Name[ar]=خدمات دولفين
Name[ast]=Servicios de Dolphin
Name[az]=Dolphin xidmətləri
Name[ca]=Serveis del Dolphin
Name[ca@valencia]=Serveis del Dolphin
Name[cs]=Služby Dolphinu
Name[da]=Dolphin-tjenester
Name[de]=Dolphin-Dienste
Name[el]=Dolphin Υπηρεσίες
Name[en_GB]=Dolphin Services
Name[es]=Servicios de Dolphin
Name[et]=Dolphini teenused
Name[eu]=Dolphin zerbitzuak
Name[fi]=Dolphin palvelut
Name[fr]=Services de Dolphin
Name[gl]=Servizos de Dolphin
Name[he]=שרותי Dolphin
Name[hu]=Dolphin szolgáltatások
Name[ia]=Servicios de Dolphin
Name[id]=Layanan Dolphin
Name[it]=Servizi di Dolphin
Name[ja]=Dolphin
Name[ko]=Dolphin
Name[lt]=Dolphin paslaugos
Name[lv]=Dolphin servisi
Name[ml]=ി
Name[nb]=Dolphin-tjenester
Name[nl]=Dolphin-services
Name[nn]=Dolphin-tenester
Name[pa]=ਿ
Name[pl]=Usługi Dolphina
Name[pt]=Serviços do Dolphin
Name[pt_BR]=Serviços do Dolphin
Name[ro]=Dolphin Servicii
Name[ru]=Действия Dolphin
Name[sk]=Služby Dolphinu
Name[sl]=Dolphin - storitve
Name[sr]=Делфинови сервиси
Name[sr@ijekavian]=Делфинови сервиси
Name[sr@ijekavianlatin]=Dolphinovi servisi
Name[sr@latin]=Dolphinovi servisi
Name[sv]=Dolphin tjänster
Name[tr]=Dolphin Servisleri
Name[uk]=Служби Dolphin
Name[vi]=Các dch v Dolphin
Name[x-test]=xxDolphin Servicesxx
Name[zh_CN]=Dolphin
Name[zh_TW]=Dolphin
[Desktop Entry]
Icon=preferences-system-services
Type=Service
X-KDE-ServiceTypes=KCModule
X-KDE-Library=kcm_dolphinservices
X-KDE-PluginKeyword=dolphinservices
X-DocPath=dolphin/index.html#preferences-dialog-services
Name=Services
Name[ar]=الخدمات
Name[ast]=Servicios
Name[az]=Xidmətlər
Name[ca]=Serveis
Name[ca@valencia]=Serveis
Name[cs]=Služby
Name[da]=Tjenester
Name[de]=KDE-Dienste
Name[el]=Υπηρεσίες
Name[en_GB]=Services
Name[es]=Servicios
Name[et]=Teenused
Name[eu]=Zerbitzuak
Name[fi]=Palvelut
Name[fr]=Services
Name[gl]=Servizos
Name[he]=שירותים
Name[hu]=Szolgáltatások
Name[ia]=Servicios
Name[id]=Layanan
Name[it]=Servizi
Name[ja]=
Name[ko]=
Name[lt]=Paslaugos
Name[lv]=Servisi
Name[ml]=
Name[nb]=Tjenester
Name[nl]=Services
Name[nn]=Tenester
Name[pa]=
Name[pl]=Usługi
Name[pt]=Serviços
Name[pt_BR]=Serviços
Name[ro]=Servicii
Name[ru]=Действия
Name[sk]=Služby
Name[sl]=Storitve
Name[sr]=Сервиси
Name[sr@ijekavian]=Сервиси
Name[sr@ijekavianlatin]=Servisi
Name[sr@latin]=Servisi
Name[sv]=Tjänster
Name[tr]=Servisler
Name[uk]=Служби
Name[vi]=Các dch v
Name[x-test]=xxServicesxx
Name[zh_CN]=
Name[zh_TW]=
Comment=Configure file manager services
Comment[ar]=اضبط خدمات مدير الملفّات
Comment[ast]=Configura los servicios del xestor de ficheros
Comment[az]=Fayl meneceri xidmətlərini tənzimləmək
Comment[ca]=Configura els serveis del gestor de fitxers
Comment[ca@valencia]=Configura els serveis del gestor de fitxers
Comment[cs]=Nastavení služeb správce souborů
Comment[da]=Indstil filhåndteringstjenester
Comment[de]=Dateiverwaltungs-Dienste einrichten
Comment[el]=Διαμόρφωση υπηρεσιών του διαχειριστή αρχείων
Comment[en_GB]=Configure file manager services
Comment[es]=Configurar los servicios del gestor de archivos
Comment[et]=Failihalduri teenuste seadistamine
Comment[eu]=Konfiguratu fitxategi-kudeatzailearen zerbitzuak
Comment[fi]=Tiedostonhallinnan palveluasetukset
Comment[fr]=Configuration des services du gestionnaire de fichiers
Comment[gl]=Configurar servizos de xestores de ficheiros.
Comment[hu]=A fájlkezelő szolgáltatásainak beállítása
Comment[ia]=Configura servicios del gerente de file
Comment[id]=Konfigurasikan layanan pengelola file
Comment[it]=Configura i servizi del gestore dei file
Comment[ja]=
Comment[ko]=
Comment[lt]=Konfigūruoti failų tvarkytuvės paslaugas
Comment[lv]=Konfigurēt datņu pārvaldnieka servisus
Comment[ml]= ി
Comment[nb]=Sett opp tjenester i filbehandleren
Comment[nl]=Bestandsbeheerderservices configureren
Comment[nn]=Set opp tenester i filhandsamaren
Comment[pa]= ਿ
Comment[pl]=Ustawienia usług zarządzania plikami
Comment[pt]=Configurar os serviços do gestor de ficheiros
Comment[pt_BR]=Configura os serviços do gerenciador de arquivos
Comment[ro]=Configurează serviciile gestionarului de fișiere
Comment[ru]=Настройка действий в диспетчере файлов
Comment[sk]=Nastavenie služieb správcu súborov
Comment[sl]=Nastavitve storitev upravljalnika datotek
Comment[sr]=Подешавање сервиса менаџера фајлова
Comment[sr@ijekavian]=Подешавање сервиса менаџера фајлова
Comment[sr@ijekavianlatin]=Podešavanje servisa menadžera fajlova
Comment[sr@latin]=Podešavanje servisa menadžera fajlova
Comment[sv]=Anpassa filhanterarens tjänster
Comment[tr]=Dosya yöneticisi servislerini yapılandır
Comment[uk]=Налаштувати служби менеджера файлів
Comment[vi]=Cu hình các dch v trình qun lí tp
Comment[x-test]=xxConfigure file manager servicesxx
Comment[zh_CN]=
Comment[zh_TW]=
X-KDE-Keywords=file manager
X-KDE-Keywords[ar]=مدير ملفّات ملفات الملفّات الملفات
X-KDE-Keywords[ast]=xestor de ficheros
X-KDE-Keywords[az]=fayl meneceri
X-KDE-Keywords[ca]=gestor de fitxers
X-KDE-Keywords[ca@valencia]=gestor de fitxers
X-KDE-Keywords[cs]=správce souborů
X-KDE-Keywords[da]=filhåndtering
X-KDE-Keywords[de]=Dateiverwaltung
X-KDE-Keywords[el]=διαχειριστής αρχείων
X-KDE-Keywords[en_GB]=file manager
X-KDE-Keywords[es]=gestor de archivos
X-KDE-Keywords[et]=failihaldur
X-KDE-Keywords[eu]=Fitxategi-kudeatzailea
X-KDE-Keywords[fi]=tiedostonhallinta
X-KDE-Keywords[fr]=gestionnaire de fichiers
X-KDE-Keywords[gl]=xestor de ficheiros
X-KDE-Keywords[he]=מנהל קבצים
X-KDE-Keywords[hu]=fájlkezelő
X-KDE-Keywords[ia]=gerente de file
X-KDE-Keywords[id]=pengelola file
X-KDE-Keywords[it]=gestore dei file
X-KDE-Keywords[ja]=
X-KDE-Keywords[ko]=
X-KDE-Keywords[lt]=failų tvarkytuvė
X-KDE-Keywords[lv]=datņu pārvaldnieks
X-KDE-Keywords[ml]=
X-KDE-Keywords[nb]=filbehandler
X-KDE-Keywords[nl]=bestandsbeheerder
X-KDE-Keywords[nn]=filhandsamar
X-KDE-Keywords[pa]=
X-KDE-Keywords[pl]=zarządzanie plikami
X-KDE-Keywords[pt]=gestor de ficheiros
X-KDE-Keywords[pt_BR]=gerenciador de arquivos
X-KDE-Keywords[ro]=gestionar de fișiere
X-KDE-Keywords[ru]=диспетчер файлов
X-KDE-Keywords[sk]=správca súborov
X-KDE-Keywords[sl]=upravljalnik datotek
X-KDE-Keywords[sr]=file manager,менаџер фајлова
X-KDE-Keywords[sr@ijekavian]=file manager,менаџер фајлова
X-KDE-Keywords[sr@ijekavianlatin]=file manager,menadžer fajlova
X-KDE-Keywords[sr@latin]=file manager,menadžer fajlova
X-KDE-Keywords[sv]=filhanterare
X-KDE-Keywords[tr]=dosya yöneticisi
X-KDE-Keywords[uk]=менеджер,керування,файл,файли
X-KDE-Keywords[vi]=file manager,trình qun lí tp
X-KDE-Keywords[x-test]=xxfile managerxx
X-KDE-Keywords[zh_CN]=
X-KDE-Keywords[zh_TW]=

View file

@ -1,32 +0,0 @@
/*
* SPDX-FileCopyrightText: 2009 Peter Penz <peter.penz19@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef KCMDOLPHINSERVICES_H
#define KCMDOLPHINSERVICES_H
#include <KCModule>
class ServicesSettingsPage;
/**
* @brief Allow to configure the Dolphin services.
*/
class DolphinServicesConfigModule : public KCModule
{
Q_OBJECT
public:
DolphinServicesConfigModule(QWidget* parent, const QVariantList& args);
~DolphinServicesConfigModule() override;
void save() override;
void defaults() override;
private:
ServicesSettingsPage *m_services;
};
#endif

View file

@ -84,5 +84,5 @@ set_package_properties(Gem:test-unit PROPERTIES
DESCRIPTION "Ruby gem 'test-unit' required for testing of servicemenu helpers.")
if (Gem:test-unit_FOUND)
add_test(NAME servicemenutest
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../settings/services/test/test_run.rb)
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../settings/contextmenu/test/test_run.rb)
endif()