some kiosk/immutability logic fixes
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=758174
This commit is contained in:
parent
033f1f52b3
commit
32c6c94c76
10
applet.cpp
10
applet.cpp
@ -645,7 +645,8 @@ bool Applet::isKioskImmutable() const
|
|||||||
|
|
||||||
void Applet::setImmutable(bool immutable)
|
void Applet::setImmutable(bool immutable)
|
||||||
{
|
{
|
||||||
if (d->immutable == immutable) {
|
if (d->immutable == immutable ||
|
||||||
|
(immutable && d->kioskImmutable)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -766,8 +767,11 @@ void Applet::checkImmutability()
|
|||||||
{
|
{
|
||||||
d->kioskImmutable = globalConfig().isImmutable() || config().isImmutable() ||
|
d->kioskImmutable = globalConfig().isImmutable() || config().isImmutable() ||
|
||||||
(containment() && containment()->isKioskImmutable()) ||
|
(containment() && containment()->isKioskImmutable()) ||
|
||||||
(dynamic_cast<Corona*>( scene() ) && static_cast<Corona*>(scene())->isKioskImmutable());
|
(dynamic_cast<Corona*>(scene()) && static_cast<Corona*>(scene())->isKioskImmutable());
|
||||||
setImmutable(d->kioskImmutable);
|
|
||||||
|
if (d->kioskImmutable) {
|
||||||
|
updateConstraints(ImmutableConstraint);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Applet::flushUpdatedConstraints()
|
void Applet::flushUpdatedConstraints()
|
||||||
|
22
corona.cpp
22
corona.cpp
@ -90,6 +90,15 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void updateContainmentImmutability()
|
||||||
|
{
|
||||||
|
foreach (Containment *c, containments) {
|
||||||
|
// we need to tell each containment that immutability has been altered
|
||||||
|
// TODO: should we tell the applets too?
|
||||||
|
c->updateConstraints(ImmutableConstraint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool immutable;
|
bool immutable;
|
||||||
bool kioskImmutable;
|
bool kioskImmutable;
|
||||||
QString mimetype;
|
QString mimetype;
|
||||||
@ -274,6 +283,10 @@ void Corona::loadApplets(const QString& configName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
d->kioskImmutable = config()->isImmutable();
|
d->kioskImmutable = config()->isImmutable();
|
||||||
|
if (d->kioskImmutable) {
|
||||||
|
d->updateContainmentImmutability();
|
||||||
|
}
|
||||||
|
|
||||||
KConfigGroup coronaConfig(config(), "General");
|
KConfigGroup coronaConfig(config(), "General");
|
||||||
setImmutable(coronaConfig.readEntry("locked", false));
|
setImmutable(coronaConfig.readEntry("locked", false));
|
||||||
}
|
}
|
||||||
@ -521,17 +534,14 @@ bool Corona::isKioskImmutable() const
|
|||||||
|
|
||||||
void Corona::setImmutable(bool immutable)
|
void Corona::setImmutable(bool immutable)
|
||||||
{
|
{
|
||||||
if (d->immutable == immutable) {
|
if (d->immutable == immutable ||
|
||||||
|
(!immutable && d->kioskImmutable)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
kDebug() << "setting immutability to" << immutable;
|
kDebug() << "setting immutability to" << immutable;
|
||||||
d->immutable = immutable;
|
d->immutable = immutable;
|
||||||
foreach (Containment *c, d->containments) {
|
d->updateContainmentImmutability();
|
||||||
// we need to tell each containment that immutability has been altered
|
|
||||||
// TODO: should we tell the applets too?
|
|
||||||
c->updateConstraints(ImmutableConstraint);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Plasma
|
} // namespace Plasma
|
||||||
|
Loading…
Reference in New Issue
Block a user