activity naming consistency, take 2

svn path=/trunk/KDE/kdelibs/; revision=1034920
This commit is contained in:
Aaron J. Seigo 2009-10-13 23:07:35 +00:00
parent c27ddab67e
commit ee461e739e
3 changed files with 13 additions and 4 deletions

View File

@ -779,6 +779,9 @@ QString Applet::name() const
if (!d->appletDescription.isValid()) { if (!d->appletDescription.isValid()) {
return i18n("Unknown Activity"); return i18n("Unknown Activity");
} else if (c->d->type == Containment::PanelContainment ||
c->d->type == Containment::CustomPanelContainment) {
return d->appletDescription.name();
} else { } else {
return i18n("%1 Activity", d->appletDescription.name()); return i18n("%1 Activity", d->appletDescription.name());
} }

View File

@ -149,7 +149,7 @@ void Containment::init()
} }
//connect actions //connect actions
ContainmentPrivate::addDefaultActions(d->actions()); ContainmentPrivate::addDefaultActions(d->actions(), this);
bool unlocked = immutability() == Mutable; bool unlocked = immutability() == Mutable;
//fix the text of the actions that need name() //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"); actions->setConfigGroup("Shortcuts-Containment");
//adjust applet actions //adjust applet actions
KAction *appAction = qobject_cast<KAction*>(actions->action("remove")); KAction *appAction = qobject_cast<KAction*>(actions->action("remove"));
appAction->setShortcut(KShortcut("alt+d, alt+r")); 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<KAction*>(actions->action("configure")); appAction = qobject_cast<KAction*>(actions->action("configure"));
if (appAction) { if (appAction) {
appAction->setShortcut(KShortcut("alt+d, alt+s")); appAction->setShortcut(KShortcut("alt+d, alt+s"));

View File

@ -103,7 +103,7 @@ public:
/** /**
* add the regular actions & keyboard shortcuts onto Applet's collection * 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 * give keyboard focus to applet within this containment