<table><tr><td style="">dhaumann edited the summary of this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-khn2f63rnotnbf4/">(Show Details)</a><br />dhaumann edited the test plan for this revision. <a href="https://phabricator.kde.org/transactions/detail/PHID-XACT-DREV-fqvd33crau7crdg/">(Show Details)</a>
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D17971">View Revision</a></tr></table><br /><div><strong>CHANGES TO REVISION SUMMARY</strong><div><div style="white-space: pre-wrap; color: #74777D;">This brings back <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">the External Tools plugin that was removed with<br />
commit e443c58df03e9fb8f26b67e86852f708d097517a for KDE 4.8.<br />
<br />
Revival is motivated by the fact that we seem to add more and more<br />
tools in context menus which not always makes sense (e.g. having<br />
lots of hard-coded git tools in the Projects plugin). It makes<br />
more sense to e.g.</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">a heavily improved,</span> <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">enable launching git-cola as external tool,<br />
which was also used for testing: git-cola -r %directory</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">almost rewritten version of the External Tools plugin that was removed with commit e443c58df03e9fb8f26b67e86852f708d097517a for KDE 4.8.</span><br />
<br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">{F6525501} {F6525506</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">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. enable launching git-cola as external tool, which was also used for testing: git-cola -r %{directory</span>}<br />
<br />
The co<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">de is still old, and as such or rather low quality.</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">nfig widget looks as follows: Drag & Drop is supported,</span> <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">There<br />
are ugly casts from parent()->parent() to some magic widget type,</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">inline renaming of Categories</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">some strange connects in the plugin handling etc.</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">{F6579010}</span><br />
<br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">All in all, this is just a work-in-progress state such that you<br />
can play around with it, and that we can discuss where we want to</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">Tool configuration dialog opens on double click or edit:</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">go with this plugin.</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">{F6578962}</span><br />
<br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">Currently, the contents of the "Scripts:" multiline edit is<br />
executed in a shell environment /bin/sh. While this is quite<br />
flexible, we definitely also lack several features, namely:<br />
- we cannot replace selected text (think of clang-format)<br />
- we cannot use e.g. /bin/python or other interpreters<br />
- the KTextEditor::Command integration is broken, since<br />
the KTextEditor::Command registers itself on creation, which<br />
is a point in time where we currently do not know the commands<br />
yet. This needs refactoring to work in a different way.<br />
- Saving and loading is done via KConfig. We may want to use</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">The Output Modes are as follows:</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);"> some json-based solution instead nowadays.</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">{F6578965}</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">- There are no default external tools</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">The modes "Insert in New Document" and "Display in Pane" are not yet implemented</span>.<br />
<br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">More features that come to my mind:<br />
- Redirect output of external tool into editor<br />
- Redirect output of external tool into a toolview / sidebar<br />
- Make %project available in the macro expander, if the Projects<br />
plugin is loaded<br />
- launch external tool in a new embedded terminal<br />
- assigning shortcuts works, but only in a two-step approach, i.e.</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">Ideas</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);"> first create the tool</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">- 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</span>, <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">then go to</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">but adding one from</span> the <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">shortcuts editor dialog</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">presets will be very straight forward</span>.<br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">- syntax highlighting</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">- Make %project available</span> in the <span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">"Scripts:" multiline edit</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">macro expander, if the Projects plugin is loaded.</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);">- currently, since we allow arbitrary scripts, we cannot check</span><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">- Launch external tool in a new embedded terminal</span><br />
<span style="padding: 0 2px; color: #333333; background: rgba(251, 175, 175, .7);"> whether a tool is really available and then hide or disable it.<br />
<br />
Porting notes: https://community.kde.org/Frameworks/Porting_Notes</span></div></div></div><br /><div><strong>CHANGES TO TEST PLAN</strong><div><div style="white-space: pre-wrap; color: #74777D;"><span style="padding: 0 2px; color: #333333; background: rgba(151, 234, 151, .6);">Added small unit test for the KateToolRunner class to make sure running a child process works.</span></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R40 Kate</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D17971">https://phabricator.kde.org/D17971</a></div></div><br /><div><strong>To: </strong>dhaumann, cullmann, gregormi<br /><strong>Cc: </strong>brauch, pino, ngraham, kwrite-devel, hase, michaelh, demsking, cullmann, sars, dhaumann<br /></div>