Added the ability to lock all Applets and the Desktop.
svn path=/trunk/KDE/kdebase/workspace/lib/plasma/; revision=671176
This commit is contained in:
parent
80fae8f7a3
commit
8674306992
19
corona.cpp
19
corona.cpp
@ -23,11 +23,13 @@
|
||||
#include <QDesktopWidget>
|
||||
#include <QGraphicsSceneDragDropEvent>
|
||||
#include <QMimeData>
|
||||
#include <QGraphicsView>
|
||||
|
||||
#include <KLocale>
|
||||
#include <KMenu>
|
||||
#include <KRun>
|
||||
#include <KWindowSystem>
|
||||
#include <KDebug>
|
||||
|
||||
#include "applet.h"
|
||||
#include "dataengine.h"
|
||||
@ -51,7 +53,7 @@ public:
|
||||
engineExplorerAction(0)
|
||||
{
|
||||
}
|
||||
|
||||
bool immutable;
|
||||
Applet::List applets;
|
||||
FormFactor formFactor;
|
||||
Location location;
|
||||
@ -101,6 +103,7 @@ void Corona::init()
|
||||
// connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(displayContextMenu(QPoint)));
|
||||
d->engineExplorerAction = new QAction(i18n("Engine Explorer"), this);
|
||||
connect(d->engineExplorerAction, SIGNAL(triggered(bool)), this, SLOT(launchExplorer()));
|
||||
d->immutable = false;
|
||||
// setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
}
|
||||
|
||||
@ -302,6 +305,20 @@ void Corona::appletDestroyed(QObject* object)
|
||||
}
|
||||
}
|
||||
|
||||
bool Corona::isImmutable()
|
||||
{
|
||||
return d->immutable;
|
||||
}
|
||||
|
||||
void Corona::setImmutable(bool immutable_)
|
||||
{
|
||||
d->immutable = immutable_;
|
||||
foreach (QGraphicsView* view, views()) {
|
||||
//TODO: setInteractive(false) prevents context menues from showing up
|
||||
view->setInteractive(!(d->immutable));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Plasma
|
||||
|
||||
#include "corona.moc"
|
||||
|
11
corona.h
11
corona.h
@ -45,6 +45,11 @@ public:
|
||||
explicit Corona(const QRectF & sceneRect, QObject * parent = 0);
|
||||
explicit Corona(qreal x, qreal y, qreal width, qreal height, QObject * parent = 0);
|
||||
~Corona();
|
||||
|
||||
/**
|
||||
* The applets are changable or not
|
||||
**/
|
||||
bool isImmutable();
|
||||
|
||||
/**
|
||||
* The location of the Corona. @see Plasma::Location
|
||||
@ -93,6 +98,11 @@ public Q_SLOTS:
|
||||
* @param path the path to the theme file
|
||||
*/
|
||||
void addKaramba(const KUrl& path);
|
||||
|
||||
/**
|
||||
* Sets if the applets are Immutable
|
||||
*/
|
||||
void setImmutable(bool immutable_);
|
||||
|
||||
protected:
|
||||
void dragEnterEvent(QGraphicsSceneDragDropEvent* event);
|
||||
@ -107,6 +117,7 @@ protected Q_SLOTS:
|
||||
|
||||
private:
|
||||
void init();
|
||||
|
||||
|
||||
class Private;
|
||||
Private * const d;
|
||||
|
Loading…
Reference in New Issue
Block a user