debugger shortcuts

Vladimir Prus ghost at cs.msu.su
Fri Jul 1 15:29:06 UTC 2005


Andras Mantia wrote:

 >> The problem exists *now* -- if two plugins try
>> to use the same keyboard shortcut, it's not clear what happens. So,
>> katerpart tooks some keys, and we need to invent other shortcuts for
>> the debugger in hope that there won't be clashes with some other
>> plugin.
> 
> Right, and this is not a KDevelop specific problem, but it happens for
> every app using KParts, including Konqueror.
> 
> Here is an example how to disable/change the shortcut:
>   KAction *a =
> m_part->actionCollection()->action("the_name_of_the_action");
>   if (a)
>     a->setShortcut(KShortCut());
> 
> As you see it depends on the name of the action which is in the xmlgui
> file for the part.
> 
> Other solution is to iterate over all the part's actions that are in
> m_part->actionCollection(), check the shortcuts, and it the part is
> using a shortcut that you need as well, disable it.

That's a reasonable approach!

> But I find this technique useful in the main application (here the
> KDevelop shell), where you want to have global shortcuts not
> conflicting with any other plugin shortcut, but if you do the same in a
> plugin, it will be a little confusing. Not talking about the fact that
> when the plugin is loaded it must iterate over all existing plugin's
> actioncollection and should do the same for every later loaded plugin.
> With the KDevelop framework I'm not sure that you can get a signal when
> a plugin is loaded.

I  believe that this "disabling shortcut" business should be done by main
application, otherwise we'd get chaos.

Say, what if each profile allows to specify for each pluging its "preferred
shortcuts". KDevelop would then check if any other plugins use that
shortcut, and if so, disable them.

- Volodya








More information about the KDevelop-devel mailing list