Diffusion Kate e8496c605592

Add file related actions to Tabbar context menu and File menu: Rename, Delete…

Authored by gregormi on Dec 2 2018, 12:30 PM.

Description

Add file related actions to Tabbar context menu and File menu: Rename, Delete, Compare (new), and some more

Summary:
Add some actions to Tabbar context menu and File menu

New items in Tabbar context menu:

  • 'Rename file'
  • 'Delete file'
  • 'Properties'
  • 'Compare'

'Compare' does the following: compare two files with an external diff tool. It works like this: right click on a tab which is NOT active and select the appropriate menu item (see screenshot). Then, the external tool opens and compares the active document with the one which was clicked on. Currently, three diff tools are supported: kdiff3, kompare and meld.

New items in File main menu:

  • 'Rename file'
  • 'Delete file'
  • 'Compare'
  • 'Copy File Path'
  • 'Open Containing Folder'
  • 'Properties'

Screenshots:

Tab context menu:

Tab context menu when no file is associated:

Tab context menu with the compare feature:

Diff tools not found:

Actions are also available in the main File menu:

NOTE: Some code of kfileactions.cpp was copied and adapted from katefiletree.cpp. TODO: reuse code there. Probably, this means kfileactions.h must be moved to KTextEditor.

TODO: in a later change the 'Open with...' menu item which is currently available in the Projects and FileTree plugin could also be extracted and be added to the Tabbar context menu and File menu (Gwenview has it, too).

Reviewers: Kate, VDG, ngraham, cullmann

Reviewed By: Kate, VDG, ngraham, cullmann

Subscribers: cullmann, anthonyfieroni, dhaumann, mmustac, ngraham, kwrite-devel

Tags: Kate

Differential Revision: https://phabricator.kde.org/D16830