activity naming consistency, take 2
svn path=/trunk/KDE/kdelibs/; revision=1034920
This commit is contained in:
parent
c27ddab67e
commit
ee461e739e
@ -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());
|
||||
}
|
||||
|
@ -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<KAction*>(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<KAction*>(actions->action("configure"));
|
||||
if (appAction) {
|
||||
appAction->setShortcut(KShortcut("alt+d, alt+s"));
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user