| Summary: | Align action should be an editor only action instead of a global action | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-ktexteditor | Reporter: | Gert Wollny <gw.fossdev> |
| Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | RESOLVED NOT A BUG | ||
| Severity: | wishlist | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Gentoo Packages | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
Patch to make align action an edit only action
Make tools_align an edit action |
||
|
Description
Gert Wollny
2010-07-10 00:46:00 UTC
this is probably true for many more actions, and we should investigate all actions and make sure that they are a) assigned to the editor views widgets b) have the correct shorcutContext set (WidgetWithChildrenShortcut or similar) For some few actions this is indeed true. Do you know a way to achieve this? QAction::setShortcutContext(Qt::WidgetWithChildrenShortcut) does not work, probably because of KActionCollection along with XMLGUI doing some magic... Well, somehow my patch seems to do the trick (although I only tested above scenario before submitting it). I moved the add action code from setupActions() to setupEditActions() and it was important to add the line "m_editActions << a;" after the action is added and connected. However, I'm really not an expert here, because so far I neither programmed with QT nor with KDE. I just followed the general layout of the code and deducted that this change might work. As far as I can see the reason for this is that the edit-actions are enabled/disabled when the view gets/looses focus. Hence they're not available if the focus is elsewhere in the hosting app. And yes, apparently either the ambiguity-check is wrong or its xmlgui thats wrong in adding all actions from an xmlgui client to the xmlgui host object (which means they're "global" actions. The xmlgui thing should be raised with David Faure to see what his opinion is on this. Created attachment 108796 [details]
Make tools_align an edit action
Coming back to this bug I just thought I might update the patch, since binding TAB to tools_align still is considered to be a global action (which it should not be). The attached patch is an update to the older patch to version 5.37.0.
The consideration for this patch is that "tools_align" is an edit action (i.e. it changes the text), hence it should be treated as such, which means it should not be added if the loaded file is in read-only mode, and it should only be enabled when the text editor widget has the focus. One desired side effect is that it makes it possible to move around other widgets with TAB also when tools_align is bound to the TAB key. (Obviously it is not possible to use TAB to move away from the editor widget in this case ).
Thanks for considering to apply this patch,
Gert
Dear user, this wish list item is now closed, as it wasn't touched in the last year and no contributor stepped up to implement it. The Kate/KTextEditor team is small and we can just try to keep up with fixing bugs. Therefore wishes that show no activity for a years or more will be closed from now on to keep at least a bit overview about 'current' wishs of the users. If you want your feature to be implemented, please step up to provide some patch for it. If you think it is really needed, you can reopen your request, but keep in mind, if no new good arguments are made and no people get attracted to help out to implement it, it will expire in a year again. We have a nice website https://kate-editor.org that provides all the information needed to contribute, please make use of it. Patches can be handed in via https://phabricator.kde.org/differential/ Greetings Christoph Cullmann |