┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphincontextmenu.h
AgeCommit message (Collapse)Author
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
2023-09-06Add open containing folder options for files in recentlyused:/Méven Car
2023-02-05Add clang-format and format code as in FrameworksSerg Podtynnyi
2022-12-26Not use forward and includesLaurent Montel
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.
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-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
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-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.
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
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-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
2017-11-20Modernize: Use override where possibleKevin Funk
Also use override instead of Q_DECL_OVERRIDE
2017-06-06Drop unnecessary methodElvis Angelaccio
2016-10-02Popupmenu: use KIO 5.27's new addPluginActionsTo methodDavid Faure
REVIEW: 129085
2015-02-04Port KonqCopyToMenu to KFileCopyToMenuEmmanuel Pescosta
2014-11-03Q_DECL_OVERRIDELukáš Tinkl
2014-10-21port Dolphin from KUrl to QUrlLukáš Tinkl
REVIEW: 120688
2014-10-18Fix includesMontel Laurent
2014-10-10Clean includes + port to QMenuMontel Laurent
2014-09-09Add "Open Path" context menu actionKai Uwe Broulik
This adds a third option to the "in new tab" and "in new window" which opens the parent folder in the same view BUG: 298704 FIXED-IN: 4.15 REVIEW: 110133
2013-08-28Replaced all KNewFileMenu usages in DolphinPart by DolphinNewFileMenu.Emmanuel Pescosta
Removed all signal-slot-connections related to DolphinNewFileMenu->errorMessage(QString) in DolphinMainWindow and DolphinContextMenu and replaced it by a better solution. Now we make use of the already existing DolphinNewFileMenuObserver singleton class to achieve a better error handling, because every newly created DolphinContextMenu instance registers himself by DolphinNewFileMenuObserver and we use this to connect the errorMessage(QString) signal of every DolphinContextMenu instance to the errorMessage(QString) signal of the DolphinNewFileMenuObserver singleton class. So we need only one connection from DolphinNewFileMenuObserver to DolphinMainWindow (or to DolphinPart) to collect all error messages thrown by every DolphinNewFileMenu instance. REVIEW: 112178
2013-08-16Cut the ropes between DolphinMainWindow and DolphinNewFileMenu. Error ↵Emmanuel Pescosta
handling is now done via signals. REVIEW: 111989
2013-06-24Do not show "Move To Trash" action in context menu for remote URLs.Dawit Alemayehu
BUG: 261762 REVIEW: 111206 FIXED-IN: 4.11
2013-05-14- Factored out the Delete/Move To Trash action into own class.Dawit Alemayehu
- Updated both the Dolphin KPart and context menu to use the new DolphinRemoveAction class to manage "Delete/Move to Trash" actions. See also https://git.reviewboard.kde.org/r/107509/. REVIEW: 108802
2013-05-05Reimplement handling of Shift while showing menu without KModifierKeyInfoDavid Faure
Finding out whether shift is pressed initially can be done with qApp->keyboardModifiers(), and finding out that the user is pressing or release shift can be done with keyPressEvent/keyReleaseEvent. This required to inherit from KMenu rather than having the KMenu as a member. KModifierKeyInfo is only implemented on X11, so this makes the code more portable. If similar solutions can be found for other users of KModifierKeyInfo, it will be deprecated in KF5. REVIEW: 110303
2012-06-02Provide a default name when adding a search query to the places panelPeter Penz
BUG: 300430 FIXED-IN: 4.9.0
2012-05-11Allow moving items to trash also for non-local filesPeter Penz
See bug 188032 for an ongoing discussion. In case if this behavior is really not wanted by users (the feedback on bugs.kde.org will show), the review-request https://git.reviewboard.kde.org/r/104915/ should be merged too (after adjusting some parts of the code).
2012-01-14Fix issue when deleting items with the context menuPeter Penz
Thanks to Jekyll Wu for the analyses of the issue! BUG: 290307 BUG: 269096 BUG: 290954 BUG: 264583 FIXED-IN: 4.8.0
2011-10-08Context menu cleanupsPeter Penz
- Open the context menu on the mouse-press event, not on the mouse-release event. - Provide an explicit position-information and don't use QCursor::pos(). This fixes the issue that opening a context-menu by the keyboard opens below the cursor. - Provide different signals in the KItemListController for the different context-menu types (item vs. view vs. header). - Implement turning on/off roles by the header-context-menu.
2011-03-27DolphinContextMenu: Show "Show menubar" entry if necessaryPeter Penz
If the user has hidden the menubar and the toolbar there is no way to get back the menu (at least not without knowing the Ctrl+M shortcut). Show an entry in the context-menu to bring back the menubar.
2011-03-26Provide toolbar-menu when the menubar is hiddenPeter Penz
Use a similar default UI like in Rekonq and other browsers: Hide the menubar and add access to all actions by a button in the toolbar. Of course it is still possible to show the menubar so that the same UI is given like before.
2011-02-04Update e-mail address from [email protected] to [email protected]Peter Penz
2011-02-04Use capitalized KDE includesPeter Penz
2010-10-25- Add support for file item actions (see http://reviewboard.kde.org/r/5659/)Peter Penz
- Internal cleanups of DolphinContextMenu code svn path=/trunk/KDE/kdebase/apps/; revision=1189651
2010-09-22If the context-menu is opened for a file shown as search result, offer the ↵Peter Penz
actions "Open Parent Folder in New Window" and "Open Parent Folder in New Tab" svn path=/trunk/KDE/kdebase/apps/; revision=1178362
2010-09-21Use K_GLOBAL_STATIC for the previously committed workaround to bypass a ↵Peter Penz
X11-issue in combination with KModifierKeyInfo. Thanks to David Faure for the hint. svn path=/trunk/KDE/kdebase/apps/; revision=1177902
2010-09-20Workaround for a X11-issue in combination with KModifierKeyInfo: When ↵Peter Penz
constructing KModifierKeyInfo in the constructor of the context menu, the user interface might freeze. Thanks to Mark Gaiser for clarifying this with the KModifierKeyInfo maintainer and testing the workaround! CCMAIL: [email protected] svn path=/trunk/KDE/kdebase/apps/; revision=1177658
2010-09-17- Fix issue, that the 'Move To Trash'-action or 'Delete'-action from the ↵Peter Penz
File menu get invisible - Use KFileItemListProperties to check whether all selected URLs are local - Coding style cleanups CCMAIL: [email protected] svn path=/trunk/KDE/kdebase/apps/; revision=1176534
2010-09-17There is no need to burden DolphinMainWindow with internals of the context-menu.Peter Penz
CCMAIL: [email protected] svn path=/trunk/KDE/kdebase/apps/; revision=1176513
2010-09-17When you view the context menu of a file/folder and shift is pressed (and ↵Mark Gaiser
the delete action line is not enabled in the settings) then the "Move to trash (del)" action gets replaced by the "Delete (shift del)" action and replaced back to "Move to trash (del)" when you release shift. BUG: 194275 svn path=/trunk/KDE/kdebase/apps/; revision=1176493
2010-08-27Context-menu cleanups:Peter Penz
- KNewMenu has been deprecated by KNewFileMenu. Reflect this in the names of related Dolphin classes. - Provide context-sensitive actions also when a context-menu is opened on the viewport BUG: 191938 FIXED-IN: 4.6.0 svn path=/trunk/KDE/kdebase/apps/; revision=1168586
2009-12-23SVN_SILENT: renamed addRevisionControlActions() to addVersionControlActions()Peter Penz
svn path=/trunk/KDE/kdebase/apps/; revision=1065347
2009-11-12BUG: 191309Harsh Chouraria J
Don't show 'Add to Places' context-menu action for urls already in places. svn path=/trunk/KDE/kdebase/apps/; revision=1048149
2009-07-23also provide revision control actions for the viewport-context-menuPeter Penz
svn path=/trunk/KDE/kdebase/apps/; revision=1001385
2009-04-01KonqFileItemCapabilities -> KFileItemListPropertiesDavid Faure
svn path=/trunk/KDE/kdebase/apps/; revision=948007
2009-02-11- allow the view implementations to attach custom actions to the context menuPeter Penz
- let the "details view" show the "[x] Expandable Folders" action in the context menu CCMAIL: [email protected] svn path=/trunk/KDE/kdebase/apps/; revision=924867
2008-06-02Use KonqMenuActions to add the "open with" actions to the popupmenu, to ↵David Faure
avoid this independent reimplementation, which brought back bug 121728 ('&' in application name treated as accelerator) svn path=/trunk/KDE/kdebase/apps/; revision=815838
2008-06-02Fix the edit-menu action disabling/enabling bug in dolphinpart finally! ↵George Goldberg
Also, move FileItemCapabilities from dolphin to KonqFileItemCapabilities at dfaure's request (making it implicitly shared along the way). BUGS:161594 svn path=/trunk/KDE/kdebase/apps/; revision=815584