class KEditToolBar


Module kdeui
Namespace
Class KEditToolBar
Inherits KDialog
A dialog used to customize or configure toolbars.

This dialog only works if your application uses the XML UI framework for creating menus and toolbars. It depends on the XML files to describe the toolbar layouts and it requires the actions to determine which buttons are active.

Typically you do not need to use it as KXmlGuiWindow.setupGUI takes care of it.

If you use plugListAction you need to overload saveNewToolbarConfig() to plug actions again

void MyClass.saveNewToolbarConfig()
{
KXmlGuiWindow.saveNewToolbarConfig();
plugActionList( "list1", list1Actions );
plugActionList( "list2", list2Actions );
}

If for some reason the default behaviour does not suit you, you would include the KStandardAction.configureToolbars() standard action in your application. In your slot to this action, you would have something like so:

KEditToolBar dlg(actionCollection());
if (dlg.exec())
{
createGUI();
}

That code snippet also takes care of redrawing the menu and toolbars if you have made any changes.

If you are using KMainWindow's settings methods (either save/apply manually or autoSaveSettings), you should write something like:

void MyClass.slotConfigureToolBars()
{
saveMainWindowSettings( KGlobal.config(), "MainWindow" );
KEditToolBar dlg(actionCollection());
connect(&dlg,SIGNAL(newToolBarConfig()),this,SLOT(slotNewToolBarConfig()));
dlg.exec();
}

void MyClass.slotNewToolBarConfig() // This is called when OK, Apply or Defaults is clicked { createGUI(); ...if you use any action list, use plugActionList on each here... applyMainWindowSettings( KGlobal.config(), "MainWindow" ); }

Note that the procedure is a bit different for KParts applications. In this case, you need only pass along a pointer to your application's KXMLGUIFactory object. The editor will take care of finding all of the action collections and XML files. The editor aims to be semi-intelligent about where it assigns any modifications. In other words, it will not write out part specific changes to your shell's XML file.

An example would be:

saveMainWindowSettings( KGlobal.config(), "MainWindow" );
KEditToolBar dlg(factory());
connect(&dlg,SIGNAL(newToolBarConfig()),this,SLOT(slotNewToolBarConfig()));
dlg.exec();

void MyClass.slotNewToolBarConfig() // This is called when OK, Apply or Defaults is clicked { ...if you use any action list, use plugActionList on each here... // Do NOT call createGUI()! applyMainWindowSettings( KGlobal.config(), "MainWindow" ); }

Author Kurt Granroth



methods