class KEditToolBar |
|
|
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 would include the KStdAction.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(); } 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();
Author Kurt Granroth |
|
Constructor for apps that do not use components. This is the only entry point to this class. You must pass along your collection of actions (some of which appear in your toolbars). The other two parameters are optional.
collection - The collection of actions to work on. defaultToolBar - The toolbar with this name will appear for editing. Pass in QString() for the default behaviour, generallyd desired for apps that do not use components. parent - The parent of the dialog. |
|
Constructor for KParts based apps. The main parameter, factory(), is a pointer to the XML GUI factory object for your application. It contains a list of all of the GUI clients (along with the action collections and xml files) and the toolbar editor uses that. Use this like so: KEditToolBar edit(factory()); if ( edit.exec() ) ...
factory - Your application's factory object defaultToolBar - The toolbar with this name will appear for editing. Pass in QString() for default behavior. parent - The usual parent for the dialog. |
|
|
should OK really save? Internal
|
|
|
Signal emitted when 'apply' or 'ok' is clicked or toolbars were reset. Connect to it, to plug action lists and to call applyMainWindowSettings (see sample code in this class's documentation) |
|
|
Sets the default toolbar that will be selected when the dialog is shown. If not set, or QString() is passed in, the global default tool bar name will be used. toolBarName - the name of the tool bar See also setGlobalDefaultToolBar |
|
Sets the default toolbar which will be auto-selected for all KEditToolBar instances. Can be overridden on a per-dialog basis by calling setDefaultToolBar( const QString& ) on the dialog. - toolbarName the name of the tool bar |
|
The name (absolute or relative) of your application's UI resource file is assumed to be share/apps/appname/appnameui.rc though this can be overridden by calling this method. The global parameter controls whether or not the global resource file is used. If this is true, then you may |
|
|
idem |
|
Set toolbars to default value
|
|
Overridden in order to save any changes made to the toolbars |