make the different activity for each desktop option actually work, by

using dbus calls on plasma (the option will still be disabled if
plasma-desktop isn't running)

svn path=/trunk/KDE/kdebase/workspace/; revision=1029999
This commit is contained in:
Marco Martin 2009-10-01 11:14:52 +00:00
parent 6f2ef45a48
commit 5c73896b33
2 changed files with 16 additions and 5 deletions

View file

@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QDBusMessage>
#include <QDBusConnection>
#include <QDBusInterface>
#include <KAboutApplicationDialog>
#include <KActionCollection>
@ -285,6 +286,16 @@ void KWinDesktopConfig::load()
slotEffectSelectionChanged( m_ui->effectComboBox->currentIndex() );
// TODO: plasma stuff
QDBusInterface interface( "org.kde.plasma-desktop", "/App" );
if( interface.isValid() )
{
bool perVirtualDesktopViews = interface.call( "perVirtualDesktopViews" ).arguments().first().toBool();
m_ui->activityCheckBox->setEnabled( true );
m_ui->activityCheckBox->setChecked( perVirtualDesktopViews );
}
else
m_ui->activityCheckBox->setEnabled( false );
emit changed(false);
}
@ -350,8 +361,11 @@ void KWinDesktopConfig::save()
m_config->sync();
// Send signal to all kwin instances
QDBusMessage message = QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
QDBusConnection::sessionBus().send(message);
QDBusMessage message = QDBusMessage::createSignal( "/KWin", "org.kde.KWin", "reloadConfig" );
QDBusConnection::sessionBus().send( message );
QDBusInterface interface( "org.kde.plasma-desktop", "/App" );
interface.call( "setPerVirtualDesktopViews", ( m_ui->activityCheckBox->isChecked() ) );
emit changed(false);
}

View file

@ -84,9 +84,6 @@
</item>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="activityCheckBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Different activity for each desktop</string>
</property>