[PATCH] Configuring global shortcuts

Andreas Pakulat apaku at gmx.de
Sun Dec 9 18:21:40 GMT 2007


Hi,

currently the kcontrol module to configure keyboard shortcuts is in bad
shape (kdebase/workspace/kcontrol/keys). It would need porting to the
new global kded module.

I talked to Andreas Hartmetz a bit on IRC and his opinion is that
there's no need for it, except for a few special cases like kwin, plasma
and  some others that don't have a mainwindow-application themselves.
For all other applications that want to provide global actions they can
provide this via their normal shortcuts configuration.

I tend to agree and thus wrote a very simple new module that allows to
configure only global shortcuts. It replaces the current module.

The code needs a BC change in KShortcutsEditor, which is in the first
patch. It adds a new method to clear the list of actions the editor
currently shows. 

The kcm itself, simply asks the kded module for all global shortcuts and
creates a combobox with all components. Upon changing the component the
shortcut editor gets the new list of actions for that component. The
second patch can be applied to kdebase/workspace/kcontrol/keys to build
the new kcm.

Now to the problems (apart from the new method in the editor widget):

a) 2 new strings for the labels in the dialog. If anybody is aware of
two existing strings in kdebase that I can use instead that would be
good. Else I'm going to send a mail to the i18n people to request an
exception.

b) For some reason I don't understand yet the global shortcuts get
disabled completely. That is after running the kcm the first time and
changing something Alt+Tab and others don't work anymore. However they
work again when the kcm runs again. Any hint why that might happen?

c) Cancel only works when the kcm is deleted when cancel is hit. Else
the changes will still go into the kconfig file. The reason is that
global shortcuts are written out immediately by design and unfortunately
KCModule has no hook to know when its cancelled. Adding a virtual cancel
in KCModule is not an option so far as its BIC.

d) Loosing keyboard schemes for 4.0. It should be possible to add this
again, although Andreas said that when he talked to Ellen Reitmayer she
said they don't make too much sense anyway.

So what do you think, may I commit this once b) is fixed? 

Andreas

PS: A screenshot can be seen at:
http://www.apaku.de/vardata/keys_kcm.png

PPS: I wasn't sure wether I should nuke the old code or not, so I left
it in for now.

-- 
Your ignorance cramps my conversation.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kshortcutseditor_add_clear.diff
Type: text/x-diff
Size: 1081 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071209/c576452b/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kcmkeys.diff
Type: text/x-diff
Size: 9544 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071209/c576452b/attachment-0001.diff>


More information about the kde-core-devel mailing list