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
icc-effect-5.14.5
Daniel M. Duley 1999-11-11 01:27:37 +00:00
parent 35c7b77082
commit c9e72c7700
1 changed files with 18 additions and 3 deletions

View File

@ -1,3 +1,6 @@
#include <kconfig.h>
#include <kglobal.h>
#include "workspace.h"
#include "client.h"
#include "stdclient.h"
@ -13,7 +16,6 @@
#include <X11/keysym.h>
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: