differentiate between runtime and kiosk immutability
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=744675
This commit is contained in:
parent
f7a0308982
commit
e2249860fd
18
applet.cpp
18
applet.cpp
@ -599,7 +599,14 @@ QString Applet::category(const QString& appletName)
|
|||||||
|
|
||||||
bool Applet::isImmutable() const
|
bool Applet::isImmutable() const
|
||||||
{
|
{
|
||||||
return (containment() && containment()->isImmutable()) || d->immutable || d->kioskImmutable;
|
return d->immutable || d->kioskImmutable ||
|
||||||
|
(containment() && containment()->isImmutable()) ||
|
||||||
|
(scene() && static_cast<Corona*>(scene())->isImmutable());
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Applet::isKioskImmutable() const
|
||||||
|
{
|
||||||
|
return d->kioskImmutable;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Applet::setImmutable(bool immutable)
|
void Applet::setImmutable(bool immutable)
|
||||||
@ -716,7 +723,9 @@ void Applet::performSetupConfig()
|
|||||||
|
|
||||||
void Applet::checkImmutability()
|
void Applet::checkImmutability()
|
||||||
{
|
{
|
||||||
d->kioskImmutable = globalConfig().isImmutable() || config().isImmutable();
|
d->kioskImmutable = globalConfig().isImmutable() || config().isImmutable() ||
|
||||||
|
(containment() && containment()->isKioskImmutable()) ||
|
||||||
|
(scene() && static_cast<Corona*>(scene())->isKioskImmutable());
|
||||||
setImmutable(d->kioskImmutable);
|
setImmutable(d->kioskImmutable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -883,13 +892,14 @@ FormFactor Applet::formFactor() const
|
|||||||
Containment* Applet::containment() const
|
Containment* Applet::containment() const
|
||||||
{
|
{
|
||||||
QGraphicsItem *parent = parentItem();
|
QGraphicsItem *parent = parentItem();
|
||||||
|
Containment *c = 0;
|
||||||
while (parent) {
|
while (parent) {
|
||||||
if (dynamic_cast<Containment*>(parent)) {
|
if ((c = dynamic_cast<Containment*>(parent))) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
parent = parent->parentItem();
|
parent = parent->parentItem();
|
||||||
}
|
}
|
||||||
return dynamic_cast<Containment*>(parent);
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
Location Applet::location() const
|
Location Applet::location() const
|
||||||
|
5
applet.h
5
applet.h
@ -401,6 +401,11 @@ class PLASMA_EXPORT Applet : public Widget
|
|||||||
**/
|
**/
|
||||||
bool isImmutable() const;
|
bool isImmutable() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if this applet is immutable due to Kiosk settings
|
||||||
|
*/
|
||||||
|
bool isKioskImmutable() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return returns whether or not the applet is using the standard
|
* @return returns whether or not the applet is using the standard
|
||||||
* background
|
* background
|
||||||
|
10
corona.cpp
10
corona.cpp
@ -67,6 +67,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool immutable;
|
bool immutable;
|
||||||
|
bool kioskImmutable;
|
||||||
QString mimetype;
|
QString mimetype;
|
||||||
QString configName;
|
QString configName;
|
||||||
KSharedConfigPtr config;
|
KSharedConfigPtr config;
|
||||||
@ -225,7 +226,7 @@ void Corona::loadApplets(const QString& configName)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setImmutable(config.isImmutable());
|
d->kioskImmutable = config.isImmutable();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Corona::loadApplets()
|
void Corona::loadApplets()
|
||||||
@ -457,7 +458,12 @@ void Corona::screenResized(int screen)
|
|||||||
|
|
||||||
bool Corona::isImmutable() const
|
bool Corona::isImmutable() const
|
||||||
{
|
{
|
||||||
return d->immutable;
|
return d->kioskImmutable || d->immutable;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Corona::isKioskImmutable() const
|
||||||
|
{
|
||||||
|
return d->kioskImmutable;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Corona::setImmutable(bool immutable)
|
void Corona::setImmutable(bool immutable)
|
||||||
|
5
corona.h
5
corona.h
@ -52,6 +52,11 @@ public:
|
|||||||
**/
|
**/
|
||||||
bool isImmutable() const;
|
bool isImmutable() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if this Corona is immutable due to Kiosk settings
|
||||||
|
*/
|
||||||
|
bool isKioskImmutable() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A rect containing the maximum size a plasmoid on this corona should
|
* A rect containing the maximum size a plasmoid on this corona should
|
||||||
* consider being.
|
* consider being.
|
||||||
|
Loading…
Reference in New Issue
Block a user