Kross
ui/plugin.cpp
Go to the documentation of this file.
74 ScriptingPlugin::ScriptingPlugin(const QString& collectionName, const QString& userActionsFile, const QString& referenceActionsDir, QObject* parent)
88 Kross::ActionCollection* collection=Kross::Manager::self().actionCollection()->collection(d->collectionName);
109 void ScriptingPlugin::addObject(QObject* object, const QString& name, ChildrenInterface::Options options)
117 Kross::ActionCollection* collection=Kross::Manager::self().actionCollection()->collection(d->collectionName);
119 collection=new Kross::ActionCollection(d->collectionName, Kross::Manager::self().actionCollection());
122 QStringList allActionFiles = KGlobal::dirs()->findAllResources("appdata", "scripts/"+d->referenceActionsDir+"/*.rc");
127 else if (QFile::exists(d->userActionsFile)) //in case d->userActionsFile isn't in the standard local dir
209 Kross::ActionCollection* collection=Kross::Manager::self().actionCollection()->collection(d->collectionName);
210 bool collectionEmpty = !collection||(collection->actions().empty()&&collection->collections().empty());
224 "Collection name attribute represents the name of the menu, e.g., to use menu \"File\" use \"file\" or \"Help\" use \"help\". You can add new menus."
226 "If you type a relative script file beware the this script is located in $KDEHOME/share/apps/applicationname/"
virtual void setDOMDocument(const QDomDocument &document, bool merge=false)
Re-implement in order to load additional kross scripting rc files.
Definition: ui/plugin.cpp:97
ActionCollection * parentCollection() const
Definition: actioncollection.cpp:98
QString directory(const DirectoryOptions &options=IgnoreTrailingSlash) const
void addObject(QObject *object, const QString &name=QString(), Options options=NoOption)
Add a QObject to the list of children.
Definition: childreninterface.h:80
QList< Action * > actions() const
Definition: actioncollection.cpp:163
QStringList findDirs(const char *type, const QString &reldir) const
bool isEnabled() const
Return the enable this ActionCollection has.
Definition: actioncollection.cpp:95
KStandardDirs * dirs()
virtual void slotResetScriptActions()
Deletes the user rc file, which has the effect of falling back to the default script actions (if any)...
Definition: ui/plugin.cpp:261
virtual void setDOMDocument(const QDomDocument &document, bool merge=false)
void addObject(QObject *object, const QString &name, ChildrenInterface::Options options)
Add a QObject to the list of children.
Definition: ui/plugin.cpp:109
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
void setParentCollection(ActionCollection *parent)
Set the parent to parent. NOTE: Do not use setParent().
Definition: actioncollection.cpp:103
ActionCollection * collection(const QString &name) const
Definition: actioncollection.cpp:128
Options
Additional options that could be defined for a QObject instance.
Definition: childreninterface.h:45
ActionCollection * actionCollection() const
Definition: manager.cpp:285
QStringList collections() const
Definition: actioncollection.cpp:133
bool readXml(const QDomElement &element, const QDir &directory=QDir())
Load child Action and ActionCollection instances this collection has from the element ...
Definition: actioncollection.cpp:271
No additional options. This is the default.
Definition: childreninterface.h:46
static QString locateLocal(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
bool isEnabled() const
Return true if this Action is enabled else false is returned.
Definition: action.cpp:306
The class Object does provide us scripting objects like class instances to the C++ world...
Definition: object.h:69
The Action class is an abstract container to deal with scripts like a single standalone script file...
Definition: action.h:94
virtual void slotEditScriptActions()
This slot will open/create a scriptactions.rc file at $KDEHOME/share/apps/application/scripts/ which ...
Definition: ui/plugin.cpp:248
QStringList findAllResources(const char *type, const QString &filter=QString(), SearchOptions options=NoSearchOptions) const
The ActionCollection class manages collections of Action instances.
Definition: actioncollection.h:45
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:54 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:54 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.