From ee461e739e9800e1d579f15540013ba540f75fb1 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 13 Oct 2009 23:07:35 +0000 Subject: [PATCH] activity naming consistency, take 2 svn path=/trunk/KDE/kdelibs/; revision=1034920 --- applet.cpp | 3 +++ containment.cpp | 12 +++++++++--- private/containment_p.h | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/applet.cpp b/applet.cpp index d7c8ffbbe..423d2280f 100644 --- a/applet.cpp +++ b/applet.cpp @@ -779,6 +779,9 @@ QString Applet::name() const if (!d->appletDescription.isValid()) { return i18n("Unknown Activity"); + } else if (c->d->type == Containment::PanelContainment || + c->d->type == Containment::CustomPanelContainment) { + return d->appletDescription.name(); } else { return i18n("%1 Activity", d->appletDescription.name()); } diff --git a/containment.cpp b/containment.cpp index bc75bd5bc..5367bd542 100644 --- a/containment.cpp +++ b/containment.cpp @@ -149,7 +149,7 @@ void Containment::init() } //connect actions - ContainmentPrivate::addDefaultActions(d->actions()); + ContainmentPrivate::addDefaultActions(d->actions(), this); bool unlocked = immutability() == Mutable; //fix the text of the actions that need name() @@ -259,14 +259,20 @@ void Containment::init() } -void ContainmentPrivate::addDefaultActions(KActionCollection *actions) +void ContainmentPrivate::addDefaultActions(KActionCollection *actions, Containment *c) { actions->setConfigGroup("Shortcuts-Containment"); //adjust applet actions KAction *appAction = qobject_cast(actions->action("remove")); appAction->setShortcut(KShortcut("alt+d, alt+r")); - appAction->setText(i18n("Remove this Activity")); + if (c && (c->d->type == Containment::PanelContainment || + c->d->type == Containment::CustomPanelContainment)) { + appAction->setText(i18n("Remove this panel")); + } else { + appAction->setText(i18n("Remove this activity")); + } + appAction = qobject_cast(actions->action("configure")); if (appAction) { appAction->setShortcut(KShortcut("alt+d, alt+s")); diff --git a/private/containment_p.h b/private/containment_p.h index 199184b68..ad2427e47 100644 --- a/private/containment_p.h +++ b/private/containment_p.h @@ -103,7 +103,7 @@ public: /** * add the regular actions & keyboard shortcuts onto Applet's collection */ - static void addDefaultActions(KActionCollection *actions); + static void addDefaultActions(KActionCollection *actions, Containment *c = 0); /** * give keyboard focus to applet within this containment