KDEUI
kxmlguifactory.cpp
Go to the documentation of this file.
92 void applyShortcutScheme(KXMLGUIClient *client, const QList<QAction*>& actions, const QDomDocument& scheme);
93 void refreshActionProperties(KXMLGUIClient *client, const QList<QAction*>& actions, const QDomDocument& doc);
117QString KXMLGUIFactory::readConfigFile( const QString &filename, const KComponentData &_componentData )
125 KComponentData componentData = _componentData.isValid() ? _componentData : KGlobal::mainComponent();
145 KComponentData componentData = _componentData.isValid() ? _componentData : KGlobal::mainComponent();
305 kWarning() << "The following actions are not plugged into the gui (shortcuts will not work): " << unaddedActions;
348void KXMLGUIFactoryPrivate::refreshActionProperties(KXMLGUIClient *client, const QList<QAction*>& actions, const QDomDocument& doc)
373 //kDebug() << kaction->objectName() << "default=" << defaultShortcut.toString() << "active=" << activeShortcut.toString();
380 kError(240) << "Shortcut for KAction " << kaction->objectName() << kaction->text() << "set with QShortcut::setShortcut()! See KAction documentation.";
612void KXMLGUIFactoryPrivate::configureAction( QAction *action, const QDomNamedNodeMap &attributes,
652 } else if ( propertyType == QVariant::UserType && action->property( attrName.toLatin1() ).userType() == qMetaTypeId<KShortcut>() ) {
653 // Setting the shortcut by property also sets the default shortcut (which is incorrect), so we have to do it directly
699void KXMLGUIFactoryPrivate::applyShortcutScheme(KXMLGUIClient *client, const QList<QAction*> &actions, const QDomDocument& scheme)
746 kDebug(260) << "Applying shortcut scheme for XMLGUI client" << client->componentData().componentName();
758 letterCutsOk ? KShortcutsEditor::LetterShortcutsAllowed : KShortcutsEditor::LetterShortcutsDisallowed,
783QDomElement KXMLGUIFactory::findActionByName( QDomElement& elem, const QString& sName, bool create )
QList< QAction * > actions() const
Returns the list of KActions which belong to this action collection.
Definition: kactioncollection.cpp:186
@ ActiveShortcut
The shortcut will immediately become active but may be reset to "default".
Definition: kaction.h:235
@ DefaultShortcut
The shortcut is a default shortcut - it becomes active when somebody decides to reset shortcuts to de...
Definition: kaction.h:238
bool isValid() const
QString componentName() const
void writeEntry(const char *key, const char *value, WriteConfigFlags pFlags=Normal)
QString readEntry(const char *key, const char *aDefault=0) const
bool isEmpty() const
Returns whether this shortcut contains any nonempty key sequences.
Definition: kshortcut.cpp:144
Dialog for configuration of KActionCollection and KGlobalAccel.
Definition: kshortcutsdialog.h:70
bool configure(bool saveSettings=true)
Run the dialog and call writeSettings() on the action collections that were added if bSaveSettings is...
Definition: kshortcutsdialog.cpp:166
void addCollection(KActionCollection *, const QString &title=QString())
Add all actions of the collection to the ones displayed and configured by the dialog.
Definition: kshortcutsdialog.cpp:153
@ LetterShortcutsDisallowed
Shortcuts without a modifier are not allowed, so 'A' would not be valid, whereas 'Ctrl+A' would be.
Definition: kshortcutseditor.h:84
static QString locate(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
static QString locateLocal(const char *type, const QString &filename, bool createDir, const KComponentData &cData=KGlobal::mainComponent())
Implements the creation of the GUI (menubar, menus and toolbars) as requested by the GUI factory.
Definition: kxmlguibuilder.h:42
A KXMLGUIClient can be used with KXMLGUIFactory to create a GUI from actions and an XML document,...
Definition: kxmlguiclient.h:47
void reloadXML()
Forces this client to re-read its XML resource file.
Definition: kxmlguiclient.cpp:174
virtual KActionCollection * actionCollection() const
Retrieves the entire action collection for the GUI client.
Definition: kxmlguiclient.cpp:128
virtual KComponentData componentData() const
Definition: kxmlguiclient.cpp:144
QList< KXMLGUIClient * > childClients()
Retrieves a list of all child clients.
Definition: kxmlguiclient.cpp:635
KXMLGUIFactory * factory() const
Retrieves a pointer to the KXMLGUIFactory this client is associated with (will return 0 if the client...
Definition: kxmlguiclient.cpp:602
void setXMLGUIBuildDocument(const QDomDocument &doc)
Definition: kxmlguiclient.cpp:587
void setFactory(KXMLGUIFactory *factory)
This method is called by the KXMLGUIFactory as soon as the client is added to the KXMLGUIFactory's GU...
Definition: kxmlguiclient.cpp:597
KXMLGUIBuilder * clientBuilder() const
Retrieves the client's GUI builder or 0 if no client specific builder has been assigned via setClient...
Definition: kxmlguiclient.cpp:647
QDomDocument xmlguiBuildDocument() const
Definition: kxmlguiclient.cpp:592
KXMLGUIFactory(KXMLGUIBuilder *builder, QObject *parent=0)
Constructs a KXMLGUIFactory.
Definition: kxmlguifactory.cpp:190
static QString readConfigFile(const QString &filename, const KComponentData &componentData=KComponentData())
Definition: kxmlguifactory.cpp:117
void plugActionList(KXMLGUIClient *client, const QString &name, const QList< QAction * > &actionList)
Definition: kxmlguifactory.cpp:564
QList< QWidget * > containers(const QString &tagName)
Definition: kxmlguifactory.cpp:491
QList< KXMLGUIClient * > clients() const
Returns a list of all clients currently added to this factory.
Definition: kxmlguifactory.cpp:469
void removeClient(KXMLGUIClient *client)
Removes the GUI described by the client, by unplugging all provided actions and removing all owned co...
Definition: kxmlguifactory.cpp:411
void addClient(KXMLGUIClient *client)
Creates the GUI described by the QDomDocument of the client, using the client's actions,...
Definition: kxmlguifactory.cpp:210
static QDomElement actionPropertiesElement(QDomDocument &doc)
Definition: kxmlguifactory.cpp:769
int configureShortcuts(bool bAllowLetterShortcuts=true, bool bSaveSettings=true)
Show a standard configure shortcut for every action in this factory.
Definition: kxmlguifactory.cpp:755
void reset()
Use this method to free all memory allocated by the KXMLGUIFactory.
Definition: kxmlguifactory.cpp:496
void unplugActionList(KXMLGUIClient *client, const QString &name)
Definition: kxmlguifactory.cpp:583
void clientRemoved(KXMLGUIClient *client)
void clientAdded(KXMLGUIClient *client)
static QDomElement findActionByName(QDomElement &elem, const QString &sName, bool create)
Definition: kxmlguifactory.cpp:783
void makingChanges(bool)
Emitted when the factory is currently making changes to the GUI, i.e.
void refreshActionProperties()
Use this method to reset and reread action properties (shortcuts, etc.) for all actions.
Definition: kxmlguifactory.cpp:311
static bool saveConfigFile(const QDomDocument &doc, const QString &filename, const KComponentData &componentData=KComponentData())
Definition: kxmlguifactory.cpp:142
QWidget * container(const QString &containerName, KXMLGUIClient *client, bool useTagName=false)
Use this method to get access to a container widget with the name specified with containerName and wh...
Definition: kxmlguifactory.cpp:474
void changeShortcutScheme(const QString &scheme)
Definition: kxmlguifactory.cpp:397
void resetContainer(const QString &containerName, bool useTagName=false)
Use this method to free all memory allocated by the KXMLGUIFactory for a specific container,...
Definition: kxmlguifactory.cpp:503
#define kDebug
#define kWarning
Defines platform-independent classes for keyboard shortcut handling.
static void removeDOMComments(QDomNode &node)
Removes all QDomComment objects from the specified node and all its children.
Definition: kxmlguifactory.cpp:170
static QDomElement findActionPropertiesElement(const QDomDocument &doc)
Definition: kxmlguifactory.cpp:334
const QString & staticQString(const char *str)
const KComponentData & mainComponent()
KSharedConfigPtr config()
const char * name(StandardAction id)
This will return the internal name of a given standard action.
Definition: kstandardaction.cpp:223
const KShortcut & shortcut(StandardShortcut id)
Returns the keybinding for accel.
Definition: kstandardshortcut.cpp:285
Definition: kxmlguifactory.h:41
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.