This brings back the External Tools plugin that was removed with
commit e443c58df03e9fb8f26b67e86852f708d097517a for KDE 4.8.
Revival is motivated by the fact that we seem to add more and more
tools in context menus which not always makes sense (e.g. having
lots of hard-coded git tools in the Projects plugin). It makes
more sense to e.g.a heavily improved, enable launching git-cola as external tool,
which was also used for testing: git-cola -r %directoryalmost rewritten version of the External Tools plugin that was removed with commit e443c58df03e9fb8f26b67e86852f708d097517a for KDE 4.8.
{F6525501} {F6525506Revival is motivated by the fact that we seem to add more and more tools in context menus which not always makes sense (e.g. having lots of hard-coded git tools in the Projects plugin). It makes more sense to e.g. enable launching git-cola as external tool, which was also used for testing: git-cola -r %{directory}
The code is still old, and as such or rather low quality.nfig widget looks as follows: Drag & Drop is supported, There
are ugly casts from parent()->parent() to some magic widget type,inline renaming of Categories
some strange connects in the plugin handling etc.{F6579010}
All in all, this is just a work-in-progress state such that you
can play around with it, and that we can discuss where we want toTool configuration dialog opens on double click or edit:
go with this plugin.{F6578962}
Currently, the contents of the "Scripts:" multiline edit is
executed in a shell environment /bin/sh. While this is quite
flexible, we definitely also lack several features, namely:
- we cannot replace selected text (think of clang-format)
- we cannot use e.g. /bin/python or other interpreters
- the KTextEditor::Command integration is broken, since
the KTextEditor::Command registers itself on creation, which
is a point in time where we currently do not know the commands
yet. This needs refactoring to work in a different way.
- Saving and loading is done via KConfig. We may want to useThe Output Modes are as follows:
some json-based solution instead nowadays.{F6578965}
- There are no default external toolsThe modes "Insert in New Document" and "Display in Pane" are not yet implemented.
More features that come to my mind:
- Redirect output of external tool into editor
- Redirect output of external tool into a toolview / sidebar
- Make %project available in the macro expander, if the Projects
plugin is loaded
- launch external tool in a new embedded terminal
- assigning shortcuts works, but only in a two-step approach, i.e.Ideas
first create the tool- There are still no default external tools. What I have in mind is to add a button "Presets" or similar that lists as many presets as possible that we can think of. So by default, we'll have no tool at all in the list, then go tobut adding one from the shortcuts editor dialogpresets will be very straight forward.
- syntax highlighting- Make %project available in the "Scripts:" multiline editmacro expander, if the Projects plugin is loaded.
- currently, since we allow arbitrary scripts, we cannot check- Launch external tool in a new embedded terminal
whether a tool is really available and then hide or disable it.
Porting notes: https://community.kde.org/Frameworks/Porting_Notes