From c9e72c77000c39a93b4a58acfe4c0ba554b005b1 Mon Sep 17 00:00:00 2001 From: "Daniel M. Duley" Date: Thu, 11 Nov 1999 01:27:37 +0000 Subject: [PATCH] Read a KConfig key in ClientFactory to select the style and save the key when choosing from the menu. This will have to change when I do plugins but makes kwin styles easier to use now. svn path=/trunk/kdebase/kwin/; revision=33483 --- workspace.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/workspace.cpp b/workspace.cpp index 480fe53cfa..0e294efb8c 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -1,3 +1,6 @@ +#include +#include + #include "workspace.h" #include "client.h" #include "stdclient.h" @@ -13,7 +16,6 @@ #include - static Client* clientFactory( Workspace *ws, WId w ) { // hack TODO hints @@ -36,7 +38,16 @@ static Client* clientFactory( Workspace *ws, WId w ) return c; } - return new StdClient( ws, w ); + KConfig *config = KGlobal::config(); + config->setGroup("style"); + // well, it will be soon ;-) + QString tmpStr = config->readEntry("Plugin", "standard"); + if(tmpStr == "standard") + return new StdClient( ws, w ); + else if(tmpStr == "system") + return new SystemClient( ws, w ); + else if(tmpStr == "be") + return new BeClient( ws, w ); } Workspace::Workspace() @@ -716,15 +727,19 @@ void Workspace::showPopup( const QPoint& pos, Client* c) popup_client = c; // TODO customize popup for the client int ret = popup->exec( pos ); - + KConfig *config = KGlobal::config(); + config->setGroup("style"); switch( ret ) { case 100: + config->writeEntry("Plugin", "standard"); setDecoration( 0 ); break; case 101: + config->writeEntry("Plugin", "be"); setDecoration( 1 ); break; case 102: + config->writeEntry("Plugin", "system"); setDecoration( 2 ); break; default: