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
This commit is contained in:
parent
35c7b77082
commit
c9e72c7700
1 changed files with 18 additions and 3 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
#include <kconfig.h>
|
||||||
|
#include <kglobal.h>
|
||||||
|
|
||||||
#include "workspace.h"
|
#include "workspace.h"
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "stdclient.h"
|
#include "stdclient.h"
|
||||||
|
@ -13,7 +16,6 @@
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static Client* clientFactory( Workspace *ws, WId w )
|
static Client* clientFactory( Workspace *ws, WId w )
|
||||||
{
|
{
|
||||||
// hack TODO hints
|
// hack TODO hints
|
||||||
|
@ -36,7 +38,16 @@ static Client* clientFactory( Workspace *ws, WId w )
|
||||||
return c;
|
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()
|
Workspace::Workspace()
|
||||||
|
@ -716,15 +727,19 @@ void Workspace::showPopup( const QPoint& pos, Client* c)
|
||||||
popup_client = c;
|
popup_client = c;
|
||||||
// TODO customize popup for the client
|
// TODO customize popup for the client
|
||||||
int ret = popup->exec( pos );
|
int ret = popup->exec( pos );
|
||||||
|
KConfig *config = KGlobal::config();
|
||||||
|
config->setGroup("style");
|
||||||
switch( ret ) {
|
switch( ret ) {
|
||||||
case 100:
|
case 100:
|
||||||
|
config->writeEntry("Plugin", "standard");
|
||||||
setDecoration( 0 );
|
setDecoration( 0 );
|
||||||
break;
|
break;
|
||||||
case 101:
|
case 101:
|
||||||
|
config->writeEntry("Plugin", "be");
|
||||||
setDecoration( 1 );
|
setDecoration( 1 );
|
||||||
break;
|
break;
|
||||||
case 102:
|
case 102:
|
||||||
|
config->writeEntry("Plugin", "system");
|
||||||
setDecoration( 2 );
|
setDecoration( 2 );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue