Add a dbus function to show which effect is loaded

svn path=/trunk/KDE/kdebase/workspace/; revision=815896
This commit is contained in:
Laurent Montel 2008-06-02 19:52:02 +00:00
parent 10af64fc67
commit 54ede72bf1
5 changed files with 39 additions and 14 deletions

View file

@ -711,6 +711,16 @@ void EffectsHandlerImpl::toggleEffect( const QString& name )
loadEffect( name );
}
QStringList EffectsHandlerImpl::loadedModules() const
{
QStringList listModules;
for(QVector< EffectPair >::const_iterator it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it)
{
listModules <<(*it).first;
}
return listModules;
}
bool EffectsHandlerImpl::loadEffect( const QString& name )
{
Workspace::self()->addRepaintFull();

View file

@ -141,6 +141,7 @@ class EffectsHandlerImpl : public EffectsHandler
void unloadEffect( const QString& name );
void reloadEffect( const QString& name );
bool isEffectLoaded( const QString& name );
QStringList loadedModules() const;
QList<EffectWindow*> elevatedWindows() const;

View file

@ -47,6 +47,9 @@
<method name="reloadEffect">
<arg name="name" type="s" direction="in"/>
</method>
<method name="loadedModules">
<arg type="as" direction="out"/>
</method>
<method name="decorationSupportedColors">
<arg type="ai" direction="out"/>
<annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="QList&lt;int>"/>

View file

@ -734,6 +734,14 @@ void Workspace::reloadEffect( const QString& name )
static_cast<EffectsHandlerImpl*>(effects)->reloadEffect( name );
}
QStringList Workspace::loadedModules() const
{
QStringList listModulesLoaded;
if ( effects )
listModulesLoaded = static_cast<EffectsHandlerImpl*>(effects)->loadedModules();
return listModulesLoaded;
}
void Workspace::slotActivateAttentionWindow()
{
if( attention_chain.count() > 0 )

View file

@ -213,6 +213,9 @@ class Workspace : public QObject, public KDecorationDefines
void unloadEffect( const QString& name );
QStringList loadedModules() const;
/**
* Shows the menu operations menu for the client and makes it active if
* it's not already.