org.kde.koala
public class KEditToolbar extends KDialogBase
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 { ...if you use any action list, use plugActionList on each here... createGUI(); 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" ); }See KEditToolbarSignals for signals emitted by KEditToolbar
Version: $Id: KEditToolbar.java 473384 2005-10-23 14:17:09Z rdale $
UNKNOWN: A dialog used to customize or configure toolbars.
Constructor Summary | |
---|---|
protected | KEditToolbar(Class dummy) |
KEditToolbar(KActionCollection collection, String xmlfile, boolean global, QWidget parent, String name)
Constructor for apps that do not use components.
| |
KEditToolbar(KActionCollection collection, String xmlfile, boolean global, QWidget parent) | |
KEditToolbar(KActionCollection collection, String xmlfile, boolean global) | |
KEditToolbar(KActionCollection collection, String xmlfile) | |
KEditToolbar(KActionCollection collection) | |
KEditToolbar(String defaultToolbar, KActionCollection collection, String xmlfile, boolean global, QWidget parent, String name) | |
KEditToolbar(String defaultToolbar, KActionCollection collection, String xmlfile, boolean global, QWidget parent) | |
KEditToolbar(String defaultToolbar, KActionCollection collection, String xmlfile, boolean global) | |
KEditToolbar(String defaultToolbar, KActionCollection collection, String xmlfile) | |
KEditToolbar(String defaultToolbar, KActionCollection collection) | |
KEditToolbar(KXMLGUIFactory factory, QWidget parent, String name)
Constructor for KParts based apps.
| |
KEditToolbar(KXMLGUIFactory factory, QWidget parent) | |
KEditToolbar(KXMLGUIFactory factory) | |
KEditToolbar(String defaultToolbar, KXMLGUIFactory factory, QWidget parent, String name) Constructor for KParts based apps, which has an extra argument
specifying the toolbar to be shown. | |
KEditToolbar(String defaultToolbar, KXMLGUIFactory factory, QWidget parent) | |
KEditToolbar(String defaultToolbar, KXMLGUIFactory factory) |
Method Summary | |
---|---|
protected void | acceptOK(boolean b) should OK really save? |
String | className() |
void | dispose() Delete the wrapped C++ instance ahead of finalize() |
protected void | finalize() Deletes the wrapped C++ instance |
boolean | isDisposed() Has the wrapped C++ instance been deleted? |
QMetaObject | metaObject() |
static void | setDefaultToolbar(String toolbarName) Sets the default toolbar, which will be auto-selected when the constructor without the
defaultToolbar argument is used. |
protected void | slotApply()
idem |
protected void | slotDefault()
Set toolbars to default value |
protected void | slotOk()
Overridden in order to save any changes made to the toolbars |
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: collection The collection of actions to work on. xmlfile The application's local resource file. global If true
, then the global resource file will also
be parsed. parent The parent of the dialog. name An internal name.
UNKNOWN: Constructor for apps that do not use components.
KEditToolbar edit(factory()); if ( edit.exec() ) ...
Parameters: factory Your application's factory object parent The usual parent for the dialog. name An internal name. Some people seem tempted to use this also in non-KParts apps, using KMainWindow.guiFactory(). This works, but only _if_ setting conserveMemory to false when calling KMainWindow.createGUI()! If not, use the other KEditToolbar constructor.
UNKNOWN: Constructor for KParts based apps.
Parameters: defaultToolbar The toolbar with this name will appear for editing. factory Your application's factory object parent The usual parent for the dialog. name An internal name.
UNKNOWN: Constructor for KParts based apps, which has an extra argument specifying the toolbar to be shown.
UNKNOWN: should OK really save?
Parameters: toolbarName the name of the toolbar
UNKNOWN: Sets the default toolbar, which will be auto-selected when the constructor without the defaultToolbar argument is used.
UNKNOWN: idem
UNKNOWN: Set toolbars to default value
UNKNOWN: Overridden in order to save any changes made to the toolbars