From ae3986568f7204a7678f6550b653972d1ae26aa9 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Fri, 19 Sep 2008 19:16:53 +0000 Subject: [PATCH] make Applet::name Activity aware svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=862758 --- applet.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/applet.cpp b/applet.cpp index d87a79b45..b4b45c965 100644 --- a/applet.cpp +++ b/applet.cpp @@ -515,7 +515,16 @@ Extender *Applet::extender() const QString Applet::name() const { - if (!d->appletDescription.isValid()) { + if (isContainment()) { + if (!d->appletDescription.isValid()) { + return i18n("Unknown Activity"); + } + + const Containment *c = qobject_cast(this); + if (c && !c->activity().isNull()) { + return i18n("%1 Activity", c->activity()); + } + } else if (!d->appletDescription.isValid()) { return i18n("Unknown Applet"); } @@ -753,11 +762,10 @@ void Applet::flushPendingConstraintsEvents() closeApplet->setEnabled(unlocked); closeApplet->setVisible(unlocked); closeApplet->setShortcutContext(Qt::WidgetShortcut); //don't clash with other views + closeApplet->setText(i18n("Remove this %1", name())); if (isContainment()) { - closeApplet->setText(i18n("Remove this %1 Activity", name())); closeApplet->setShortcut(QKeySequence("ctrl+shift+r")); } else { - closeApplet->setText(i18n("Remove this %1", name())); closeApplet->setShortcut(QKeySequence("ctrl+r")); } connect(closeApplet, SIGNAL(triggered(bool)), this, SLOT(selectItemToDestroy()));