more code clean ups
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=816745
This commit is contained in:
parent
1cd27868ac
commit
3d45aae7fb
12
applet.cpp
12
applet.cpp
@ -139,8 +139,6 @@ void Applet::init()
|
||||
if (d->script && !d->script->init()) {
|
||||
setFailedToLaunch(true, i18n("Script initialization failed"));
|
||||
}
|
||||
//Here is the code for the window frame
|
||||
//setWindowFlags(Qt::Window);
|
||||
}
|
||||
|
||||
uint Applet::id() const
|
||||
@ -635,8 +633,8 @@ bool Applet::hasFailedToLaunch() const
|
||||
void Applet::paintWindowFrame(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget)
|
||||
{
|
||||
//Here come the code for the window frame
|
||||
//kDebug()<<"ENTER in windowFrame";
|
||||
//painter->drawRoundedRect(windowFrameGeometry(),5,5);
|
||||
//kDebug() << windowFrameGeometry();
|
||||
//painter->drawRoundedRect(windowFrameGeometry(), 5, 5);
|
||||
}
|
||||
|
||||
bool Applet::configurationRequired() const
|
||||
@ -704,10 +702,10 @@ void Applet::flushPendingConstraintsEvents()
|
||||
closeApplet->setEnabled(unlocked);
|
||||
closeApplet->setVisible(unlocked);
|
||||
closeApplet->setShortcutContext(Qt::WidgetWithChildrenShortcut); //don't clash with other views
|
||||
if (! isContainment()) {
|
||||
closeApplet->setShortcut(QKeySequence("ctrl+r"));
|
||||
} else {
|
||||
if (isContainment()) {
|
||||
closeApplet->setShortcut(QKeySequence("ctrl+shift+r"));
|
||||
} else {
|
||||
closeApplet->setShortcut(QKeySequence("ctrl+r"));
|
||||
}
|
||||
connect(closeApplet, SIGNAL(triggered(bool)), this, SLOT(destroy()));
|
||||
d->actions.addAction("remove", closeApplet);
|
||||
|
@ -389,7 +389,7 @@ void Containment::contextMenuEvent(QGraphicsSceneContextMenuEvent* event)
|
||||
}
|
||||
|
||||
QAction* closeApplet = applet->d->actions.action("remove");
|
||||
if (! closeApplet) { //unlikely but not impossible
|
||||
if (!closeApplet) { //unlikely but not impossible
|
||||
kDebug() << "wtf!! no remove action!!!!!!!!";
|
||||
closeApplet = new QAction(i18n("Remove this %1", applet->name()), &desktopMenu);
|
||||
closeApplet->setIcon(KIcon("edit-delete"));
|
||||
@ -547,6 +547,7 @@ void Containment::addApplet(Applet *applet, const QPointF &pos, bool delayInit)
|
||||
if (delayInit) {
|
||||
if (containmentType() == DesktopContainment) {
|
||||
applet->installSceneEventFilter(this);
|
||||
//applet->setWindowFlags(Qt::Window);
|
||||
}
|
||||
} else {
|
||||
applet->init();
|
||||
@ -1227,11 +1228,14 @@ void Containment::Private::appletDestroyed(QObject* object)
|
||||
|
||||
void Containment::Private::containmentAppletAnimationComplete(QGraphicsItem *item, Plasma::Animator::Animation anim)
|
||||
{
|
||||
if (anim == Animator::AppearAnimation) {
|
||||
if (q->containmentType() == DesktopContainment &&
|
||||
item->parentItem() == q &&
|
||||
qgraphicsitem_cast<Applet*>(item)) {
|
||||
item->installSceneEventFilter(q);
|
||||
if (anim == Animator::AppearAnimation &&
|
||||
q->containmentType() == DesktopContainment &&
|
||||
item->parentItem() == q) {
|
||||
Applet *applet = qgraphicsitem_cast<Applet*>(item);
|
||||
|
||||
if (applet) {
|
||||
applet->installSceneEventFilter(q);
|
||||
//applet->setWindowFlags(Qt::Window);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user