┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphincontextmenu.cpp
AgeCommit message (Collapse)Author
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.
2018-03-04Remove unused #includeRoman Inflianskas
Summary: I used CLion inspection to hunt all unused #include Reviewers: #dolphin, elvisangelaccio, markg Reviewed By: #dolphin, elvisangelaccio, markg Subscribers: bcooksley, markg, elvisangelaccio, #dolphin Differential Revision: https://phabricator.kde.org/D10985
2018-03-04Fix some compile warningsRoman Inflianskas
Reviewers: #dolphin, markg Reviewed By: markg Subscribers: elvisangelaccio, #dolphin Differential Revision: https://phabricator.kde.org/D10995
2017-12-14Use Kio::KPlacesModel as source model for PlacesItemModelRenato Araujo Oliveira Filho
Summary: Use Kio::KPlacesModel as source model for PlacesItemModel avoiding duplicated code. Depends on D8862 Depends on D8332 Depends on D8434 Depends on D8348 Depends on D8630 Test Plan: Unit test created Reviewers: elvisangelaccio, emmanuelp, mlaurent, mwolff Reviewed By: elvisangelaccio, mlaurent, mwolff Subscribers: mwolff, mlaurent, anthonyfieroni, nicolasfella, ngraham, #dolphin Differential Revision: https://phabricator.kde.org/D8855
2017-11-21Modernize: Use nullptr everywhereKevin Funk
2017-11-03Use nullptr + add explicit keywordMontel Laurent
Test Plan: compile Reviewers: #dolphin, broulik Reviewed By: broulik Subscribers: #dolphin Differential Revision: https://phabricator.kde.org/D8637
2017-11-01Make Saved Search feature discoverableNathaniel Graham
Summary: FEATURE: 269332 Make Dolphin's Saved Search feature discoverable by adding a button inside the search field. The button only becomes enabled when there is a valid search term. When pushed, it saves the search to the Places panel, providing a visible-by-default way to do this to complement the existing implementation that is only visible in the context menu. Also harmonized the label text so that it's consistent no matter how you create a saved search (button or context menu) Test Plan: Tested in KDE Neon. Works great: {F5449508} Reviewers: #dolphin, broulik, dfaure, markg, emateli, elvisangelaccio Reviewed By: #dolphin, markg, emateli, elvisangelaccio Subscribers: anthonyfieroni, markg, emateli, elvisangelaccio, cfeck, #dolphin Tags: #dolphin Differential Revision: https://phabricator.kde.org/D8454
2017-09-07Fix DolphinRemoveAction Shift toggling on WaylandElvis Angelaccio
QGuiApplication::queryKeyboardModifiers() does not work on Wayland [1]. We don't need it in the first place, since we already know (thanks to the key events) whether Shift has been pressed or released. So we can just pass this information to DolphinRemoveAction::update(). BUG: 354301 [1]: https://bugreports.qt.io/browse/QTBUG-62786 Differential Revision: https://phabricator.kde.org/D7519
2017-08-09Port to KStandardAction::RenameFileElvis Angelaccio
It was introduced in kconfig(widgets) 5.25. Using the standard action results in less code and no need to hardcode the F2 shortcut. Differential Revision: https://phabricator.kde.org/D6777
2017-07-27Port to KStandardAction::MoveToTrashElvis Angelaccio
It was introduced in kconfig(widgets) 5.25. Using the standard action results in less code and no need to hardcode the Del shortcut. Test Plan: - Change shortcut in System Settings -> Shortcuts -> Standard Shortcuts - Make sure the new shortcut is used by dolphin. Differential Revision: https://phabricator.kde.org/D6778
2017-06-06Drop unnecessary methodElvis Angelaccio
2017-03-13Port to KStandardAction::DeleteFileElvis Angelaccio
Summary: It was introduced in kconfig 5.25 and it properly handles the shift+del shortcut (together with kxmlgui >= 5.30). This allows us to drop the custom delete shortcut as well as the shift+del workaround in DolphinMainWindow. Test Plan: Shift+Del still deletes files, without the 'ambiguous shortcut' warning dialog. Reviewers: emmanuelp Differential Revision: https://phabricator.kde.org/D5010
2017-02-05Drop another obsolete version checkElvis Angelaccio
We now require Frameworks >= 5.30
2017-01-18Port away from deprecated KIO::Job::ui()Elvis Angelaccio
It's equivalent to KJob::uiDelegate() from kcoreaddons.
2017-01-03Explicitly pass iconNameForUrl when creating new places entryKai Uwe Broulik
Once KIO::iconNameForUrl returns special icons for standard paths (e.g. Video folder) this will ensure when adding such a folder to places it will automatically get the proper icon. Since KIO already depends on KBookmarks it can't depend the other way round, otherwise this would have been fixed in KBookmarks directly. Differential Revision: https://phabricator.kde.org/D3896
2016-10-02Popupmenu: use KIO 5.27's new addPluginActionsTo methodDavid Faure
REVIEW: 129085
2016-09-10Don't load twice kfileitemaction plugins with json metadataElvis Angelaccio
2016-09-10Fix logic for loading kfileitemaction pluginsElvis Angelaccio
Since dolphin is now loading also plugins with json metadata, it is wrong to return here, as those plugins could be missed.