tag the actions; now the desktop toolbox is sanely ordered
svn path=/trunk/KDE/kdelibs/; revision=1069705
This commit is contained in:
parent
9a1a29125c
commit
1181a53e3c
@ -1588,12 +1588,14 @@ KActionCollection* AppletPrivate::defaultActions(QObject *parent)
|
||||
configAction->setText(i18n("Widget Settings"));
|
||||
configAction->setIcon(KIcon("configure"));
|
||||
configAction->setShortcut(KShortcut("alt+d, s"));
|
||||
configAction->setData(AbstractToolBox::ConfigureTool);
|
||||
|
||||
KAction *closeApplet = actions->addAction("remove");
|
||||
closeApplet->setAutoRepeat(false);
|
||||
closeApplet->setText(i18n("Remove this Widget"));
|
||||
closeApplet->setIcon(KIcon("edit-delete"));
|
||||
closeApplet->setShortcut(KShortcut("alt+d, r"));
|
||||
closeApplet->setData(AbstractToolBox::DestructiveTool);
|
||||
|
||||
KAction *runAssociatedApplication = actions->addAction("run associated application");
|
||||
runAssociatedApplication->setAutoRepeat(false);
|
||||
@ -1602,6 +1604,7 @@ KActionCollection* AppletPrivate::defaultActions(QObject *parent)
|
||||
runAssociatedApplication->setShortcut(KShortcut("alt+d, t"));
|
||||
runAssociatedApplication->setVisible(false);
|
||||
runAssociatedApplication->setEnabled(false);
|
||||
runAssociatedApplication->setData(AbstractToolBox::ControlTool);
|
||||
|
||||
return actions;
|
||||
}
|
||||
|
@ -298,16 +298,19 @@ void ContainmentPrivate::addDefaultActions(KActionCollection *actions, Containme
|
||||
appletBrowserAction->setText(i18n("Add Widgets..."));
|
||||
appletBrowserAction->setIcon(KIcon("list-add"));
|
||||
appletBrowserAction->setShortcut(KShortcut("alt+d, a"));
|
||||
appletBrowserAction->setData(AbstractToolBox::AddTool);
|
||||
|
||||
KAction *action = actions->addAction("next applet");
|
||||
action->setText(i18n("Next Widget"));
|
||||
//no icon
|
||||
action->setShortcut(KShortcut("alt+d, n"));
|
||||
action->setData(AbstractToolBox::ControlTool);
|
||||
|
||||
action = actions->addAction("previous applet");
|
||||
action->setText(i18n("Previous Widget"));
|
||||
//no icon
|
||||
action->setShortcut(KShortcut("alt+d, p"));
|
||||
action->setData(AbstractToolBox::ControlTool);
|
||||
|
||||
KAction *zoomAction = actions->addAction("zoom in");
|
||||
zoomAction->setAutoRepeat(false);
|
||||
@ -315,6 +318,7 @@ void ContainmentPrivate::addDefaultActions(KActionCollection *actions, Containme
|
||||
zoomAction->setIcon(KIcon("zoom-in"));
|
||||
//two shortcuts because I hate ctrl-+ but others expect it
|
||||
zoomAction->setShortcuts(KShortcut("alt+d, +; alt+d, ="));
|
||||
zoomAction->setData(AbstractToolBox::ControlTool);
|
||||
|
||||
}
|
||||
|
||||
@ -2240,9 +2244,7 @@ void ContainmentPrivate::containmentConstraintsEvent(Plasma::Constraints constra
|
||||
positionToolBox();
|
||||
}
|
||||
|
||||
if (toolBox &&
|
||||
constraints & Plasma::StartupCompletedConstraint &&
|
||||
type < Containment::CustomContainment) {
|
||||
if (toolBox && constraints & Plasma::StartupCompletedConstraint && type < Containment::CustomContainment) {
|
||||
toolBox.data()->addTool(q->action("remove"));
|
||||
checkRemoveAction();
|
||||
}
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include <kaction.h>
|
||||
#include <kshortcutsdialog.h>
|
||||
|
||||
#include "abstracttoolbox.h"
|
||||
#include "containment.h"
|
||||
#include "containmentactionspluginsconfig.h"
|
||||
#include "view.h"
|
||||
@ -87,10 +88,10 @@ public:
|
||||
actions.setConfigGroup("Shortcuts");
|
||||
|
||||
KAction *lockAction = actions.addAction("lock widgets");
|
||||
QObject::connect(lockAction, SIGNAL(triggered(bool)), q, SLOT(toggleImmutability()));
|
||||
lockAction->setText(i18n("Lock Widgets"));
|
||||
lockAction->setIcon(KIcon("object-locked"));
|
||||
QObject::connect(lockAction, SIGNAL(triggered(bool)),
|
||||
q, SLOT(toggleImmutability()));
|
||||
lockAction->setData(AbstractToolBox::ControlTool);
|
||||
lockAction->setShortcut(KShortcut("alt+d, l"));
|
||||
lockAction->setShortcutContext(Qt::ApplicationShortcut);
|
||||
|
||||
@ -98,11 +99,11 @@ public:
|
||||
//but should the shortcuts be per-app or really-global?
|
||||
//I don't know how to make kactioncollections use plasmarc
|
||||
KAction *action = actions.addAction("configure shortcuts");
|
||||
QObject::connect(action, SIGNAL(triggered()), q, SLOT(showShortcutConfig()));
|
||||
action->setText(i18n("Shortcut Settings"));
|
||||
action->setIcon(KIcon("configure"));
|
||||
action->setAutoRepeat(false);
|
||||
QObject::connect(action, SIGNAL(triggered()),
|
||||
q, SLOT(showShortcutConfig()));
|
||||
action->setData(AbstractToolBox::ConfigureTool);
|
||||
//action->setShortcut(KShortcut("ctrl+h"));
|
||||
action->setShortcutContext(Qt::ApplicationShortcut);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user