┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphincontextmenu.cpp
AgeCommit message (Collapse)Author
2020-12-15Merge branch 'release/20.12'Elvis Angelaccio
2020-12-15DolphinContextMenu: drop wrong assertElvis Angelaccio
`m_context` can also be `SearchContext` or `TimelineContext`, so this assert has been wrong since 8b0c12a59ccb23f.
2020-12-07ContextMenu: Allow plugins submenus to react to Shift modifiersMéven Car
In 9e4642d435085f27134ed6c8431734dcacf65834 support was added for the NewFileMenu. This adds support for the Plugins submenu provided they relay their parentWidget to their own menus. BUG: 425997
2020-11-30Merge branch 'release/20.12'Nate Graham
2020-11-30Re-allow to paste files via context menuMéven Car
BUG: 429762
2020-11-29Utilize KFileItemActions::addActionsTo method from KIOAlexander Lohnau
2020-11-23Fix delete action switching via 'Shift' when sub-context-menu is openDerek Christ
Switching the 'Move to Trash' action to 'Delete' using the shift key does not work when the mouse hovers a submenu. This fix resolves the issue by using an event filter instead of the key event functions. BUG: 425997
2020-11-23Move repetitive contextmenu related logic in one placeAlexander Lohnau
This makes a bit easier to handle the stuff. Also we don't need the `addVersionControlPluginActions` utility method and we can put it in the new utility method instead.
2020-11-21Add 'Open Terminal Here' action from dolphin to menuAlexander Lohnau
2020-11-17Separate Delete/Move To Trash menu items in context menuNate Graham
Right now these actions are in a visual group with "Rename" and "Add to Places" which is silly as those actions have no logical connection whatsoever to deletion. This commits moves those items into the section above, putting them in a more logical place and leaving the Delete/Move To Trash item in its own section. BUG: 429256 FIXED-IN: 21.04
2020-11-14Context Menu: Only add paste action to foldersMéven Car
Either the viewport, or the selected folder is used as destination. The paste action is only added when enabled.
2020-10-23Compile without foreachAlexander Lohnau
2020-10-23If include is define in .h remove it if it's defined in .cpp too (scripted)Laurent Montel
2020-10-12Show "Open With" menu items even for empty dirsNate Graham
We found some legitimate use cases for this after all! :) This reverts 14f0cd52f61de7539e2d9c751966594708ed0281 BUG: 427573 FIXED-IN: 5.12
2020-08-26Text style fixesNikita Churaev
2020-08-25Output of licensedigger + manual cleanup afterwards.Elvis Angelaccio
Unfortunately licensedigger does not strip the trailing * characters. While at it, use a common style for all source files.
2020-06-29## SummaryYann Holme-Nielsen
* Adds a "Copy location" item, after the "Copy" Context item and Edit Menu, which will attempt to copy the path of the fist item into clipboard. ## Reasoning Most File Managers have this option through one or another way. Also using the default Copy option often results in different behaviour depending on the target software, Konsole will take the path. Other Programs will use the URI. Which ultimately could lead to non optimal User Experience. ## Notes * Should the target file **not** be on a local hard drive, this fallback to using the remote URL, feedback is wanted on that matter. FEATURE: 407004
2020-03-15Add Duplicate featureNathaniel Graham
Summary: Adds a Duplicate feature to Dolphin, showing up as a menu item in the File menu that appears when one or more items are selected and the directory is writable. Duplicated items receive the names of the original files with " copy" appended before the file extension, if any. Test Plan: {F5201386} {F5201393} Test cases: - Try to duplicate when nothing is selected: **PASS**: menu item is grayed out - Try to duplicate anything on a read-only local volume: **PASS**: menu item is grayed out - Try to duplicate anything on a read-only samba share: **PASS**: menu item is grayed out - Duplicate single local file on R/W volume: **PASS**: item is duplicated and named correctly - Duplicate multiple local files on R/W volume: **PASS**: 3 items are duplicated, named correctly, and selected - Duplicate single local directory on R/W volume: **PASS**: item is duplicated and named correctly, but a rename operation is not initiated - Duplicate multiple local directories on R/W volume: **PASS**: 3 items are duplicated, named correctly, and selected - Duplicate single file on R/W samba share: **PASS**: item is duplicated and correctly - Duplicate multiple files on R/W samba share: **PASS**: 3 items are duplicated, named correctly, and selected - Duplicate single directory on R/W samba share: **PASS**: item is duplicated and named correctly - Duplicate multiple directory on R/W samba share: **PASS**: 3 items are duplicated, named correctly, and selected - Try to undo a successful duplication: **PASS**: operation is undone This is my first attempt at a big change like this and I'm sure it's full of issues. I will accept any and all suggestions for improvement. :) Reviewers: #dolphin, #kde_applications, elvisangelaccio, dfaure, broulik, davidedmundson Subscribers: kfm-devel, meven, markg, fazevedo, cfeck, #dolphin Tags: #dolphin Differential Revision: https://phabricator.kde.org/D8208
2020-02-14Restore former position of "Create New" menu item in viewport context menuNate Graham
Summary: I've seem various complaints from users about the fact that the {nav Create New...} menu item in the viewport context menu is now below {nav Open With} item. All the other changes to menus seem to have been well-received but this one has garnered criticism. Looking through D23757 and D11884, I can't actually see that this was intentional, so it might even be a bug. Either way, this patch restores the old position of the {nav Create New} menu items at the top of the Viewport context menu. BUG: 417640 FIXED-IN: 20.04.0 Test Plan: {F8093605} Reviewers: #vdg, #dolphin, elvisangelaccio, ndavis Reviewed By: #vdg, ndavis Subscribers: asturmlechner, markuss, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D27267
2020-02-12Swap "Open in New Window" and "Open in New Tab" in context menusIlya Bizyaev
Summary: Since Dolphin's default behaviour became opening in new tabs rather than in new windows (a very positive change, in my opinion), I always find myself accidentally opening folders in new windows from the context menu. This is because in most browsers with tab workflow (e.g. Firefox, Chromium, Falkon) the top context menu action is opening in a new tab, and my muscle memory plays a bad trick :) I'm aware of middle-clicking, but I find it inconvenient with my touchpad. I suspect I'm probably not alone in that, so I think it makes sense to swap these actions in Dolphin to match widely used apps. Test Plan: Open Dolphin, right click folders in the main view and in the Places panel, ensure the actions are indeed swapped Reviewers: #vdg, ndavis, #dolphin, ngraham Reviewed By: #vdg, ndavis, #dolphin, ngraham Subscribers: ngraham, ndavis, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D27318
2019-12-23[DolphinContextMenu] Use contains check for scheme againKai Uwe Broulik
Regression introduced in 8b0c12a59ccb23fdb6393f640693d21afaeb02a1 There's "filenamesearch" and "baloosearch". Differential Revision: https://phabricator.kde.org/D26169
2019-12-06Make it compile against last kf5 version without deprecated methodsLaurent Montel
2019-12-02Refactoring to reduce size of openItemContextMenu and add the ContextType ↵Méven Car
TimelineOrSearchContext Reviewers: #dolphin, elvisangelaccio Reviewed By: #dolphin, elvisangelaccio Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D25615
2019-12-02GIT_SILENT remove unused includeDavid Faure
2019-11-23GIT_SILENT remove unused includeDavid Faure
2019-09-15Clean up hamburger menu and viewport and single-folder context menusNate Graham
Summary: Dolphin's hamburger and context menus have grown organically over time, becoming a bit messy and somewhat visually overwhelming. This makes them harder to parse and more intimidating to use. This patch cleans up the hamburger menu and viewport and single-folder context menus to group items more logically, and remove items that aren't actually relevant to the context. The hamburger menu part of the patch is fairly significant, and draws from the principle of only showing actions with a global scope that are not already accessible from another visible method (e.g. via the default toolbar). In the end, it manages to be shorter than the current hamburger menu with expose actions that are more relevant. A visible method to display context-specific actions should be explored separately (see https://bugs.kde.org/show_bug.cgi?id=411500). Depends on D23945 Test Plan: Before, hamburger menu: {F7334178} After, hamburger menu: {F7350958} Before, viewport: {F7324802} After, viewport: {F7330109} Before, one folder selected: {F7324798} After, one folder selected: {F7341163} No change for the context menus shown when selecting a single item, multiple items, or multiple folders Reviewers: #vdg, #dolphin, meven, elvisangelaccio, GB_2 Reviewed By: #vdg, #dolphin, meven, elvisangelaccio, GB_2 Subscribers: GB_2, mmustac, elvisangelaccio, meven, ndavis, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D23757
2019-09-08GIT_SILENT: minor qstring optimizationLaurent Montel
2019-09-04Unbreak context menu showing when right clicking on an empty areaLuca Beltrame
In D22149, a request was made to remove a variable assignment ("action", on line 389 in src/dolphincontextmenu.cpp. However the change went too far, and it actually removed the exec() call, not just the assignment which should have stayed. This resulted in the context menu not being shown at all. Adding back exec(m_pos) at least allows for the context menu to show. CCMAIL: [email protected]
2019-09-01Add "Add to Places" action to file menuNate Graham
Summary: It's recommended that actions available in context menus be available in the main menu as well for discoverability's sake. This patch does so for the "Add to Places" action. The action is moved over to the main window, and accessed in the context menu via the actionCollection it lives in. BUG: 390757 FIXED-IN: 19.08.0 Test Plan: - Action still works - Action still appears in context menu when relevant - Action in the File menu only becomes enabled when only a single directory is selected or nothing is selected {F7143876} {F7143877} {F7143878} {F7143879} Reviewers: #dolphin, elvisangelaccio Reviewed By: #dolphin, elvisangelaccio Subscribers: elvisangelaccio, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D22149
2019-06-07[DolphinContextMenu] Restore check for whether place already existsKai Uwe Broulik
Now that we have a places singleton it adds no real overhead. Differential Revision: https://phabricator.kde.org/D21600
2019-04-09Don't show "Open With" menu items for empty directoriesNate Graham
Summary: Any app that registers itself as able to open directories generally can't do anything useful with an empty directory. So, don't show the {nav Open With} menu items for them. Test Plan: Before: {F6759793} After: {F6759794} The {nav Open With} items still appear for non-empty directories. Reviewers: #dolphin, elvisangelaccio Reviewed By: #dolphin, elvisangelaccio Subscribers: trmdi, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D20396
2018-12-10Add an icon for "restore" actionShubham Jangra
Summary: Before: {F6469103} After: {F6469104} Test Plan: 1. Go to Trash 2. Right click any item. Reviewers: ngraham Reviewed By: ngraham Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D17490
2018-12-10Revert backShubham Jangra
2018-12-10Add an icon for "restore" actionShubham Jangra
Summary: Before: {F6469103} After: {F6469104} Test Plan: 1. Go to Trash 2. Right click any item. Reviewers: ngraham Reviewed By: ngraham Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D17490
2018-12-06[context menu] Restore separator above 'Properties' that went missingNate Graham
2018-11-19Show the Delete context menu entry even when disabledThomas Surrel
Summary: This is consistent with the HIG, and the 'Rename' entry in the context menu already behaves like that. Test Plan: Right click on /home. The context menu should contained the 'Delete' entry, but it should be disabled. Reviewers: #dolphin, #vdg, ngraham Reviewed By: #dolphin, #vdg, ngraham Subscribers: ngraham, romangg, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D17012
2018-09-05[DolphinContextMenu] Use the view's already existing root KFileItemKai Uwe Broulik
Saves creating a new KFileItem from scratch which stats the file. Only when the root item isn't available (as can happen when you're currently looking at an non-existing directory) will it create a new KFileItem Differential Revision: https://phabricator.kde.org/D15266
2018-07-18Fixes small memory leak in DolphinContextMenuDavid Hallas
Summary: When DolphinContextMenu::baseFileItem is called a KFileItem is allocated and stored in DolphinContextMenu::m_baseFileItem, which is of type KFileItem*, but the destructor failed to delete this. Test Plan: This leak was found using Address Sanitizer Reviewers: broulik, elvisangelaccio Reviewed By: broulik, elvisangelaccio Subscribers: ngraham, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D14178
2018-06-02Add 'Sort By' and 'View Mode' into Dolphin file context menusNerdopolis Turfwalker
Summary: This adds the 'Sort By' and 'View Mode' options into the context menu of Dolphin within the file browser. I keep looking for these option (especially sort by) in the Context Menu, and keep forgetting to go to the menu. It also makes the order of "View Mode" and "Sort By" options consistent in the control menu Test Plan: Made sure that the options appeared when right clicking on an empty space. Reviewers: #dolphin, ngraham, elvisangelaccio Reviewed By: #dolphin, ngraham, elvisangelaccio Subscribers: question, markg, elvisangelaccio, mmustac, rkflx, ngraham, kfm-devel, #dolphin Tags: #dolphin Differential Revision: https://phabricator.kde.org/D12911
2018-05-20Bring back 'New Window' action in viewport context menuElvis Angelaccio
This fixes a regression introduced by ec12391a1b. We don't use anymore the custom `new_window` action, but we use the standard `file_new` action instead.
2018-05-14Re-add "Open With" items to context menu for files in search viewNathaniel Graham
2018-04-22Move "Open" actions to the top of the context menu for filesNathaniel Graham
Summary: This patch moves the "Open", "Open With", and "Open in" items to the top of the context menu to reap the following benefits: - Move the "Open" and "Open With" items closer to the top since they're commonly used items, and right now they're buried in the middle of the menu - Group related functionality - Consistency with other common platforms (macOS Finder and Windows Explorer both have these items at the top of the context menu) For folders, the "Open With" entries are moved higher, but not all the way to the top, since the "open in New tab/folder" entries are more useful. Test Plan: Tested all menu items in the context menu for files, folders, and links; all still work. Context menu for single file: {F5806809} Context menu for multiple files: {F5806810} Context menu for single folder: {F5806811} Context menu for multiple folders: {F5806812} Context menu for symlink to folder: {F5806815} Reviewers: #dolphin, #vdg, elvisangelaccio, abetts Reviewed By: #dolphin, #vdg, elvisangelaccio, abetts Subscribers: markg, abetts, elvisangelaccio Differential Revision: https://phabricator.kde.org/D11884
2018-03-22Merge branch 'Applications/18.04'Nathaniel Graham
2018-03-22Fix missing entries in context menu for linksNathaniel Graham
Summary: https://cgit.kde.org/dolphin.git/commit/?id=86f4fcb8cd574f6d886627fc5e01c9edfc84e977 introduced a regression: the context menu for links no longer shows various items that were gated behind being a directory. However, a link can be both a link and a directory, from KIO's perspective. This patch resolves the issue. Test Plan: - Context menus for files, folders, and file links are unchanged. - The missing context menu items for folder links have returned: {F5761809} I should have tested that patch better, and for that I apologize and offer to fix this regression here. I will endeavor to up my reviewing game. Reviewers: rominf, michaelh, #dolphin, rkflx Reviewed By: rominf, rkflx Subscribers: rkflx Differential Revision: https://phabricator.kde.org/D11562
2018-03-21[DolphinContextMenu] Fix excluding ourself from Open With menuKai Uwe Broulik
The desktop file name changed to org.kde.dolphin a long time ago. To avoid this breaking again, just use qApp->desktopFileName() BUG: 391997 Differential Revision: https://phabricator.kde.org/D11540
2018-03-18Add "Show Target" into symlink context menu and file menuRoman Inflianskas
Summary: Add "Show Target" into symlink context menu and file menu FEATURE: 215069 Reviewers: ngraham, elvisangelaccio Reviewed By: ngraham, elvisangelaccio Subscribers: rkflx, ngraham, elvisangelaccio, markg, #dolphin Differential Revision: https://phabricator.kde.org/D10990
2018-03-14Add "Open symlink destination folder" into symlink's context menuRoman Inflianskas
Summary: This is not complete. I'm wondering about "Open symlink destination folder in new tab/window". Feature wants also "Copy symlink destination". I dislike this, because then it's good to have "Cut symlink destination" and that's too much. FEATURE: 215069 Reviewers: #dolphin, ngraham Reviewed By: #dolphin, ngraham Subscribers: rkflx, ngraham, elvisangelaccio, markg, #dolphin Differential Revision: https://phabricator.kde.org/D10990
2018-03-11Add Trash (empty, isEmpty, emptinessChanged)Roman Inflianskas
Summary: Add `Trash` class to handle all trash operations. Reviewers: elvisangelaccio, markg, ngraham Reviewed By: elvisangelaccio, markg, ngraham Subscribers: ngraham, markg, rkflx, elvisangelaccio, #dolphin Differential Revision: https://phabricator.kde.org/D11012
2018-03-10Fix some compile warningsRoman Inflianskas
Reviewers: markg, elvisangelaccio Reviewed By: markg, elvisangelaccio Subscribers: chehrlic, rkflx, elvisangelaccio, #dolphin Differential Revision: https://phabricator.kde.org/D10995
2018-03-05Revert "Fix some compile warnings"Elvis Angelaccio
This reverts commit 533f050855a50212bba7be57a1590f9ce743e26d. D10995 has not been approved.