class KEditToolbar

A dialog used to customize or configure toolbars. More...

Definition#include <kedittoolbar.h>
InheritsKDialogBase
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Slots


Detailed Description

This is 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.

Note that the procedure is a bit different for KParts applications. In this case, you need to pass along an action collection with @bf all actions -- shell and part combined. You also must pass along the name of your shell's xml file and your current part's xml file. The dialog 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:


 QActionCollection collection;
 collection = *actionCollection() + *m_part->actionCollection();
 KEditToolbar dlg(&collection, xmlFile(), m_part->xmlFile());
 if (dlg.exec())
 ...

 KEditToolbar (QActionCollection *collection, const QString& xmlfile = QString::null, bool global = true)

Constructor for apps that do not use components. This is the only entry point to this class. You @bf must pass along your collection of actions (some of which appear in your toolbars). The other two parameters are optional.

The second parameter, xmlfile, is the name (absolute or relative) of your application's UI resource file. If it is left blank, then the resource file: share/apps/appname/appnameui.rc is used. This is the same resource file that is used by the default createGUI function in KTMainWindow so you're usually pretty safe in leaving it blank.

The third parameter, global, controls whether or not the global resource file is used. If this is true, then you may edit all of the actions in your toolbars -- global ones and local one. If it is false, then you may edit only your application's entries. The only time you should set this to false is if your application does not use the global resource file at all (very rare)

Parameters:
collectionThe collection of actions to work on
xmlfileThe application's local resource file
globalIf true, then the global resource file will also be parsed

 KEditToolbar (QActionCollection *collection, const QString& shellxml, const QString& partxml)

Constructor for KParts based apps. You must pass along all of the parameters.

The first parameter, collection, is your collection of all of the actions that appear in your application. This is 'actionCollection() + m_part->actionCollection()' in many apps

The second parameter, shellxml, is the name of your shell (or MainWindow) XML resource file. It may be relative or absolute. Relative is best.

The last parameter, partxml, is the name of your currently active part's XML resource file. It may be relative or absolute. Relative is best.

Parameters:
collectionThe collection of actions to work on
xmlfileThe shell XML resource file
partxmlThe active part's XML resource file

void  slotOk ()

[protected virtual slot]

Overridden in order to save any changes made to the toolbars

Reimplemented from KDialogBase