Plugins actions in the configure shortcut dialog

Olivier Goffart ogoffart at tiscalinet.be
Mon Feb 23 14:09:37 GMT 2004


Hello.

I tried rellinks, a nice konqueror plugin  (kdenonbeta/rellinks).  I hit a 
no-new problem when i wanted to change shortcuts,  they are not configurable.
The problem is that plugin entry does not appears in the konqueror configure 
shortcut dialog.

I see 3 solutions:

1) Workaround the problem in the plugin.
That consist in adding a "configure shortcut" action dirrectly in the plugin 
menu.
I already did that for rellinks in my own tree, but i'm not commiting because 
i think it's not the proper solution.

2) Workaround the problem in the application.
I already did that for Kopete, i and think kdevelop do that too:

void KopeteChatWindow::slotConfKeys()
{
  KKeyDialog dlg( false, this );
  dlg.insert( actionCollection() );
  if( m_activeView )
  {
     dlg.insert(m_activeView->msgManager()->actionCollection() , i18n("Plugin 
Actions") );
    QPtrListIterator<KXMLGUIClient>      
                                       it( *m_activeView->msgManager()->childClients() );
    KXMLGUIClient *c = 0;
    while( (c = it.current()) != 0 ) 
    {
      dlg.insert( c->actionCollection() /*, i18n("Plugin Actions")*/ );
      ++it;
    }
    if( m_activeView->part() )
      dlg.insert( m_activeView->part()->actionCollection(), 
            m_activeView->part()->name() );
  }
  dlg.configure();
}

3) Fix that in kdelibs.
by adding a standard method that automaticaly add every actions of a 
KXMLGUIFactory
So i was thinking to a KKeyDialog::configure(KXMLGUIFactory * ..........)
or, like i did in the attached patch:  KXMLGUIFactory::configureShortcuts

I tested the attached patch with Kopete and Konqueror, and it seems working 
fine.  The only small problem is that every plugin does not have an hinstance 
with a name, but that could be easily fixed.

comments?
ok to commit this patch?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xmlguifactory.diff
Type: text/x-diff
Size: 2437 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040223/4ec28511/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040223/4ec28511/attachment.sig>


More information about the kde-core-devel mailing list