┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphincontextmenu.cpp
AgeCommit message (Collapse)Author
2026-01-20dolphinview: when creating a subfolder expand to it if in details modeMéven Car
So the new folder is in view.
2025-11-16dolphincontextmenu: Add hint that shift+middle-click opens the third appTomasz Kot
Checks if the second action in the submenu is actually an app and not a separator, and add hint "Shift + Middle Click".
2025-10-17dolphincontextmenu: Update "Empty Trash" enabled state dynamicallyPan Zhang
Initialize the action state based on current trash contents and keep it in sync with Trash::emptinessChanged to avoid incorrect disabling on startup. BUG: 501091
2025-10-17dolphincontextmenu: Update "Empty Trash" enabled state dynamicallyPan Zhang
Initialize the action state based on current trash contents and keep it in sync with Trash::emptinessChanged to avoid incorrect disabling on startup. BUG: 501091
2025-09-01DolphinContextMenu: Don't parent new file menu to the menuKai Uwe Broulik
It needs to outlive the menu for the file name input prompt to work. While at it, hook up the new rejected signals ot ensure the menu is properly cleaned up also when canceled. Amends commit 697d58e9
2025-08-16DolphinContextMenu: Show Configure Trash instead of PropertiesKai Uwe Broulik
The Properties window is mostly useless in Trash. This also makes it consistent with the Places panel. BUG: 497349
2025-06-09Add a SetFolderIcon ItemAction pluginMéven Car
To allow to change folder icon from the context menu. CCBUG: 467221
2025-03-24DolphinContextMenu: Add properties entry last for trash entryKai Uwe Broulik
It's supposed to be consistent and always last.
2025-02-03implement shortcut action for file creationChristian Schwarz
BUG: 462899
2025-01-29Make "Empty trash" icons redNate Graham
This is a destructive action, and the HIG specifies that icons for destructive actions should be colored red. The current icons are black, inconsistent, and semantically incorrect. edit-delete is red in the Breeze icon theme, and also more semantically correct since the items in the trash will be deleted. Let's use this icon instead.
2025-01-07Improve trash context menu UINate Graham
Right now the "Delete" item is right next to "Restore", which means you can accidentally destroy the item you meant to restore! To prevent this, the menu is re-arranged slightly, and "Restore" is given a more visually clear icon and label. BUG: 498132 FIXED-IN: 25.04.0
2024-11-29Make "open path" and "open path in new tab" scroll to the selected itemAkseli Lahtinen
**Open Path** When user clicks on "Open Path" after searching for an item, user expects the view to show the item immediately. We wait for the KItemListSmoothScroller to be done with its animation before the scrollbar sizes are being changed. **Open Path in New Tab** When user selects "Open Path in New Tab", we open a new tab to the folder where the file is, then select and set the file current. We need to get the correct tab when opening one, so it has been added as a return value. BUG:495613
2024-10-31refactor: replace QString() with QStringLiteral() for better performanceZhangzhi Hu
2024-10-14Add context menu items to Trash view and itemsEren Karakas
Sort by and View mode are already available through hamburger menu; cut and copy are already available through shortcuts BUG: 493808 BUG: 476955
2024-09-19Ignore trailing slashes when comparing place URLsWolfgang Müller
There's two locations where place URLs are compared in Dolphin. One is in DolphinContextMenu::placeExists, which determines whether or not to show an "Add to Places" context menu entry. The other one is in DolphinViewContainer::caption, which provides the place name for use in the window title, if applicable. Neither of these functions correctly normalize the URL to account for trailing slashes. Whilst placeExists() does not even attempt it, caption() was changed in 681d8bb6c (Fix wrong window titles, 2019-09-15) to support this using a regular expression. However, caption() fails to escape the URL before incorporating it in the regular expression, leading to failed matches and errors like the following when browsing to directories that do not happen to make up a valid regular expression: QString(View)::contains(): called on an invalid QRegularExpression object (pattern is '\A(?:file:///home/foo/[Z-A]/?)\z') Instead of relying on complex and possibly brittle regular expressions, use KFilePlacesModel's closestItem() function to find the closest matching URL and then finally check whether the normalized URLs match exactly.
2024-08-19Fix middle-click not following the "Open archives as folder" settingJin Liu
Previous to this commit middle-clicking an archive would always open it in a new tab. This contradicts the recent change d27ee07de7558470ef7b497fbe3d3504ce7cad07 which made it so middle-click would open an item in the second application that is available to open a file. With this commit, middle-clicking will treat the archive like a folder only when GeneralSettings::browseThroughArchives is enabled or when there is no second application available. Otherwise middle-click will open the archive in the second available application.
2024-03-30Contextmenu: add a separator before vcs actionsMéven Car
2024-03-18DolphinContextMenu: Add hint that secondary app will be opened by middle clickKai Uwe Broulik
Displays it in the menu like a keyboard shortcut. Otherwise nobody will ever find this feature.
2023-11-08Adapt to KConfigGroup name officially being a QString typeFriedrich W. H. Kossebau
GIT_SILENT
2023-09-10Merge remote-tracking branch 'origin/master' into kf6Méven Car
2023-09-10Replace qAsConst with std::as_constMéven Car
2023-09-09Add open in split view actionEric Armbruster
This action is shown only if a single folder is selected. The action opens the selected folder in the inactive split view (and opens the split view if necessary). FEATURE: 465500
2023-09-06DolphinContextMenu: Use targetUrl in addOpenParentFolderActionsMéven Car
Amends 3aa8cf00ee90b0414fa9b17f01eaade4507c4642
2023-09-06Add open containing folder options for files in recentlyused:/Méven Car
2023-08-29Fix a bunch of clazy warningsMéven Car
2023-08-28Clean obsolete ifdefs since dolphin requires KF 5.101+Méven Car
2023-08-23Merge branch 'master' into kf6Méven Car
2023-08-22Swap "Open Path in New Tab" and "Open Path in New Window"Ilya Bizyaev
Looks like I missed it back in https://invent.kde.org/system/dolphin/-/commit/402f7f3041d45d8c5969f3bc202fe9156891cd2e — so fixing now :)
2023-07-05Merge branch 'master' into kf6Nicolas Fella
2023-07-05Add explicit moc includes to sources for moc-covered headersFriedrich W. H. Kossebau
* speeds up incremental builds as changes to a header will not always need the full mocs_compilation.cpp for all the target's headers rebuild, while having a moc file sourced into a source file only adds minor extra costs, due to small own code and the used headers usually already covered by the source file, being for the same class/struct * seems to not slow down clean builds, due to empty mocs_compilation.cpp resulting in those quickly processed, while the minor extra cost of the sourced moc files does not outweigh that in summary. Measured times actually improved by some percent points. (ideally CMake would just skip empty mocs_compilation.cpp & its object file one day) * enables compiler to see all methods of a class in same compilation unit to do some sanity checks * potentially more inlining in general, due to more in the compilation unit * allows to keep using more forward declarations in the header, as with the moc code being sourced into the cpp file there definitions can be ensured and often are already for the needs of the normal class methods
2023-05-16Bring back the "Create New" menu in the menu barJakob Petsovits
This commit is the result of a three-way diff that combines my own initial patch with related changes from Felix Ernst's MR !545 and further suggestions by Méven Car. Fixes DolphinMainWindowTest::testNewFileMenuEnabled(). Tests are now passing again for my build. "Create New" was broken by commit c64059bd which switched to the new, non-deprecated KNewFileMenu constructor (kio commit 89bc6bad) that doesn't add itself to the passed KActionCollection parameter. After the switch, hamburger menu and context menu was still working as intended but the menu bar was missing the "Create New" menu. This commit adds the addAction("new_menu") call to the File menu setup that would have previously been called by the deprecated KNewFileMenu constructor. The corresponding test can now find the QObject for the menu's named action again, verifying its existence and enabled-ness like it did before. The DolphinNewFileMenu constructor's unused actionCollection parameter serves no use anymore except to confuse people. We replace it with a single QAction* parameter, createDirAction, which gets passed to setNewFolderShortcutAction(). 2 out of 3 constructor call sites have access to this action, while the remaining call site in dolphinmainwindow.cpp must wait until after it has been initialized by DolphinViewActionHandler. In this case, setNewFolderShortcutAction() is still called manually at a later time.
2023-05-12Remove deprecated, ifdef'd code for old KIO versionsJakob Petsovits
2023-05-08Merge branch 'master' into kf6Méven Car
2023-04-02Context menu: allow to show copy to/move to inactive split viewMéven Car
Prevent copying/moving to same folder as origin when copying/moving to inactive split view BUG: 356436
2023-03-04Port away from deprecated KNewFileMenu ctorNicolas Fella
2023-02-05Add clang-format and format code as in FrameworksSerg Podtynnyi
2022-09-26Remove unused includesLaurent Montel
2022-07-14Port from KNewFileMenu::setPopupFiles to KNewFileMenu::setWorkingDirectoryNicolas Fella
The former is deprecated
2022-05-02Re-add "Open Terminal Here" featureoioi 555
This is equivalent to the "Open Terminal Here" feature that existed until Version 20.12. If the user has selected folders, replace "Open Terminal" in the context menu with "Open Terminal Here". When more than 5 folders are selected, a modal window will ask the user if they are sure they want to open all 6 or more terminal windows. In Detail View, users can also select a file, which will open a terminal at the location of that file. BUG: 452637 FIXED-IN: 22.08
2022-04-02Refactor DolphinContextMenu so its actions are retrievableFelix Ernst
This mostly red MR should have no visible effect. It is part of my work towards !273. There are two calls necessary to open the DolphinContextMenu: One to construct it and one to execute/show it. Before this commit, the actual populating of the ContextMenu was done on execute. This meant that the actions of the ContextMenu couldn't be looked at or changed without first showing the Menu to the user. It also meant that the construction itself didn't actually do much constructing/populating at all which might seem a bit unintuitive. This commit changes this behaviour so the DolphinContextMenu is actually populated fully on construction. The executing/showing of the ContextMenu now does just that and nothing more. Previously, some actions in the context menu were actually not wired up to anything and instead the DolphinContextMenu or the DolphinMainWindow executed some code after the user had clicked such a dummy action from the ContextMenu. Now all the actions are properly constructed beforehand and no special handling is necessary when the ContextMenu hides itself. This commit removes the pos parameter from the DolphinContextMenu constructor. This parameter contained the position where the Menu would be shown later. This information isn't necessary to have on construction and was already part of the exec(pos) call in the first place. The variable m_pos that stored the value is removed. This commit also removes a "customActions" functionality that can supposedly be used to add further custom actions to the DolphinContextMenu but this functionality isn't ever used anywhere so its usefulness is questionable. It also wouldn't be difficult to re-add this functionality if it was ever required for something. This commit also addresses an old TODO in dolphinpart.cpp that asked for the calls for opening the DolphinContextMenu to actually contain the information for which items the DolphinContextMenu is supposed to be constructed. Before this, only the item that was directly clicked was transmitted and then DolphinContextMenu retrieved the currently selected set of items by itself. It makes more sense that DolphinContextMenu would be informed on construction which items it is supposed to show context actions for. Most of this is necessary so we are able to show the contextual actions anywhere else than in the ContextMenu in the future. I am targeting 22.08 with this MR because it makes no sense to merge a refactor for the upcoming release already.
2022-01-09Port back to KFilePlacesViewKai Uwe Broulik
This removes the custom-view engine version of the places panel and replaces it with the upstream `KFilePlacesView` from KIO.
2021-12-16Remove calls to no-op KNewFileMenu::setViewShowsHiddenFilesNicolas Fella
The implementation doesn't do anything
2021-12-01Port away from deprecated KFileItemActions::addOpenWithActionsTo methodAlexander Lohnau
Instead of the KServiceTypeTrader constraint, pass the desktop file name as part of the exclude list to the method call.
2021-11-02Remove duplicate include from .h/.cppLaurent Montel
2021-07-04Reuse KFileItemActions instance during lifetime of dolphinAlexander Lohnau
With https://invent.kde.org/frameworks/kio/-/merge_requests/411 the plugin instances can be reused during the lifetime of the KFileItemActions object. This improves performance and also allows the plugins to emit errors, even if they run async.
2021-07-04contextmenu: Listen to new error signal from KFileItemActionsAlexander Lohnau
Task: https://phabricator.kde.org/T12164
2021-07-03Remove unused includesNicolas Fella
2021-06-22Merge branch 'release/21.04' addendumFelix Ernst
This should have belonged to my previous merge 480b3067d25e4b49ea55285313a7c10e93f98ffd but somehow I managed to miss this one line. It was written by Derek Christ as part of dc3beae3ab2c55cd3501e17f93b51e93e876a177.
2021-06-22Merge branch 'release/21.04'Felix Ernst
2021-06-22Fix shift-action modifier in context menuDerek Christ
Before this patch, the shift-action modifier in context menus did not work when a sub-context menu is open, that does not have the main context menu as its parent. The new fix installs an event filter on QApplication whenever a new context menu is opened to make the context menu aware of shift-presses even when a sub-context menu is in focus. BUG: 425997 FIXED-IN: 21.04