Add a dbus function to show which effect is loaded

svn path=/trunk/KDE/kdebase/workspace/; revision=815896
icc-effect-5.14.5
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();
@ -1262,7 +1272,7 @@ EffectWindow* effectWindow( Scene::Window* w )
// EffectWindowGroupImpl
//****************************************
EffectWindowList EffectWindowGroupImpl::members() const
{
EffectWindowList ret;

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

@ -454,7 +454,7 @@ void Workspace::clientPopupActivated( QAction *action )
}
void Workspace::performWindowOperation( Client* c, Options::WindowOperation op )
void Workspace::performWindowOperation( Client* c, Options::WindowOperation op )
{
if ( !c )
return;
@ -463,7 +463,7 @@ void Workspace::performWindowOperation( Client* c, Options::WindowOperation op )
QCursor::setPos( c->geometry().center() );
if (op == Options::ResizeOp || op == Options::UnrestrictedResizeOp )
QCursor::setPos( c->geometry().bottomRight());
switch ( op )
switch ( op )
{
case Options::MoveOp:
c->performMouseCommand( Options::MouseMove, cursorPos() );
@ -552,7 +552,7 @@ void Workspace::performWindowOperation( Client* c, Options::WindowOperation op )
bool Client::performMouseCommand( Options::MouseCommand command, const QPoint &globalPos, bool handled )
{
bool replay = false;
switch (command)
switch (command)
{
case Options::MouseRaise:
workspace()->raiseClient( this );
@ -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 )
@ -743,13 +751,13 @@ void Workspace::slotActivateAttentionWindow()
void Workspace::slotSwitchDesktopNext()
{
int d = currentDesktop() + 1;
if ( d > numberOfDesktops() )
if ( d > numberOfDesktops() )
{
if ( options->rollOverDesktops )
if ( options->rollOverDesktops )
{
d = 1;
}
else
else
{
return;
}
@ -760,7 +768,7 @@ void Workspace::slotSwitchDesktopNext()
void Workspace::slotSwitchDesktopPrevious()
{
int d = currentDesktop() - 1;
if ( d <= 0 )
if ( d <= 0 )
{
if ( options->rollOverDesktops )
d = numberOfDesktops();
@ -979,7 +987,7 @@ void Workspace::slotWindowToNextDesktop()
{
windowToNextDesktop( active_popup_client ? active_popup_client : active_client );
}
void Workspace::windowToNextDesktop( Client* c )
{
int d = currentDesktop() + 1;
@ -1001,7 +1009,7 @@ void Workspace::slotWindowToPreviousDesktop()
{
windowToPreviousDesktop( active_popup_client ? active_popup_client : active_client );
}
void Workspace::windowToPreviousDesktop( Client* c )
{
int d = currentDesktop() - 1;
@ -1096,7 +1104,7 @@ void Workspace::slotSendToDesktop( QAction *action )
int desk = action->data().toInt();
if ( !active_popup_client )
return;
if ( desk == 0 )
if ( desk == 0 )
{ // the 'on_all_desktops' menu entry
active_popup_client->setOnAllDesktops( !active_popup_client->isOnAllDesktops());
return;
@ -1255,7 +1263,7 @@ bool Workspace::shortcutAvailable( const KShortcut& cut, Client* ignore ) const
++it )
{
if( (*it) != ignore && (*it)->shortcut() == cut )
return false;
return false;
}
return true;
}

View File

@ -66,7 +66,7 @@ class Workspace : public QObject, public KDecorationDefines
virtual ~Workspace();
static Workspace * self() { return _self; }
bool workspaceEvent( XEvent * );
bool workspaceEvent( QEvent * );
@ -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.
@ -560,7 +563,7 @@ class Workspace : public QObject, public KDecorationDefines
void closeActivePopup();
void updateClientArea( bool force );
void finishCompositing();
bool windowRepaintsPending() const;