Show notification when compositing is suspended via dbus.

svn path=/trunk/KDE/kdebase/workspace/; revision=948322
This commit is contained in:
Martin Gräßlin 2009-04-02 19:14:48 +00:00
parent 6b7e972d87
commit 9174c43eb0
2 changed files with 22 additions and 3 deletions

View file

@ -275,7 +275,27 @@ void Workspace::slotToggleCompositing()
{
suspendCompositing( !compositingSuspended );
}
// for the dbus call
void Workspace::toggleCompositing()
{
slotToggleCompositing();
if( compositingSuspended )
{
// when disabled show a shortcut how the user can get back compositing
QString shortcut, message;
if( KAction* action = qobject_cast<KAction*>( keys->action("Suspend Compositing")))
shortcut = action->globalShortcut().primary().toString(QKeySequence::NativeText);
if( !shortcut.isEmpty() && options->useCompositing )
{
// display notification only if there is the shortcut
message = i18n( "Compositing has been suspended by another application.<br/>"
"You can resume using the '%1' shortcut.", shortcut );
Notify::raise( Notify::CompositingSlow, message );
}
}
}
void Workspace::suspendCompositing()
{
suspendCompositing( true );

View file

@ -328,8 +328,7 @@ class Workspace : public QObject, public KDecorationDefines
// KDE4 remove me - And it's also in the DCOP interface :(
void showWindowMenuAt( unsigned long id, int x, int y );
void toggleCompositing()
{ slotToggleCompositing(); }
void toggleCompositing();
void loadEffect( const QString& name );
void toggleEffect( const QString& name );
void reconfigureEffect( const QString& name );