(hopefully) temporary fix for shortcuts.
this could interfere with plasma-mid, because it assumes one view per window but it's the best we can get until we can use real QGraphicsWidget action stuff svn path=/trunk/KDE/kdelibs/; revision=935758
This commit is contained in:
parent
655f63d1fb
commit
d1fa9d361b
@ -1033,7 +1033,6 @@ void Applet::flushPendingConstraintsEvents()
|
|||||||
closeApplet->setIcon(KIcon("edit-delete"));
|
closeApplet->setIcon(KIcon("edit-delete"));
|
||||||
closeApplet->setEnabled(unlocked);
|
closeApplet->setEnabled(unlocked);
|
||||||
closeApplet->setVisible(unlocked);
|
closeApplet->setVisible(unlocked);
|
||||||
closeApplet->setShortcutContext(Qt::WidgetShortcut); //don't clash with other views
|
|
||||||
closeApplet->setText(i18nc("%1 is the name of the applet", "Remove this %1", name()));
|
closeApplet->setText(i18nc("%1 is the name of the applet", "Remove this %1", name()));
|
||||||
if (d->isContainment) {
|
if (d->isContainment) {
|
||||||
closeApplet->setShortcut(QKeySequence("alt+d,alt+r"));
|
closeApplet->setShortcut(QKeySequence("alt+d,alt+r"));
|
||||||
@ -1170,6 +1169,7 @@ QAction *Applet::action(QString name) const
|
|||||||
void Applet::addAction(QString name, QAction *action)
|
void Applet::addAction(QString name, QAction *action)
|
||||||
{
|
{
|
||||||
d->actions.addAction(name, action);
|
d->actions.addAction(name, action);
|
||||||
|
QGraphicsWidget::addAction(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Applet::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
void Applet::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||||
@ -1401,7 +1401,7 @@ void Applet::setHasConfigurationInterface(bool hasInterface)
|
|||||||
if (!configAction) { //should be always true
|
if (!configAction) { //should be always true
|
||||||
configAction = new KAction(i18n("%1 Settings", name()), this);
|
configAction = new KAction(i18n("%1 Settings", name()), this);
|
||||||
configAction->setIcon(KIcon("configure"));
|
configAction->setIcon(KIcon("configure"));
|
||||||
configAction->setShortcutContext(Qt::WidgetShortcut); //don't clash with other views
|
//configAction->setShortcutContext(Qt::WidgetWithChildrenShortcut); //don't clash with other views
|
||||||
bool unlocked = immutability() == Mutable;
|
bool unlocked = immutability() == Mutable;
|
||||||
bool canConfig = unlocked || KAuthorized::authorize("PlasmaAllowConfigureWhenLocked");
|
bool canConfig = unlocked || KAuthorized::authorize("PlasmaAllowConfigureWhenLocked");
|
||||||
configAction->setVisible(canConfig);
|
configAction->setVisible(canConfig);
|
||||||
|
@ -145,21 +145,18 @@ void Containment::init()
|
|||||||
appletBrowserAction->setVisible(unlocked);
|
appletBrowserAction->setVisible(unlocked);
|
||||||
appletBrowserAction->setEnabled(unlocked);
|
appletBrowserAction->setEnabled(unlocked);
|
||||||
connect(appletBrowserAction, SIGNAL(triggered()), this, SLOT(triggerShowAddWidgets()));
|
connect(appletBrowserAction, SIGNAL(triggered()), this, SLOT(triggerShowAddWidgets()));
|
||||||
appletBrowserAction->setShortcutContext(Qt::WidgetShortcut);
|
|
||||||
appletBrowserAction->setShortcut(QKeySequence("alt+d,a"));
|
appletBrowserAction->setShortcut(QKeySequence("alt+d,a"));
|
||||||
d->actions().addAction("add widgets", appletBrowserAction);
|
d->actions().addAction("add widgets", appletBrowserAction);
|
||||||
|
|
||||||
KAction *action = new KAction(i18n("Next Widget"), this);
|
KAction *action = new KAction(i18n("Next Widget"), this);
|
||||||
//no icon
|
//no icon
|
||||||
connect(action, SIGNAL(triggered()), this, SLOT(focusNextApplet()));
|
connect(action, SIGNAL(triggered()), this, SLOT(focusNextApplet()));
|
||||||
action->setShortcutContext(Qt::WidgetShortcut);
|
|
||||||
action->setShortcut(QKeySequence("alt+d,n"));
|
action->setShortcut(QKeySequence("alt+d,n"));
|
||||||
d->actions().addAction("next applet", action);
|
d->actions().addAction("next applet", action);
|
||||||
|
|
||||||
action = new KAction(i18n("Previous Widget"), this);
|
action = new KAction(i18n("Previous Widget"), this);
|
||||||
//no icon
|
//no icon
|
||||||
connect(action, SIGNAL(triggered()), this, SLOT(focusPreviousApplet()));
|
connect(action, SIGNAL(triggered()), this, SLOT(focusPreviousApplet()));
|
||||||
action->setShortcutContext(Qt::WidgetShortcut);
|
|
||||||
action->setShortcut(QKeySequence("alt+d,p"));
|
action->setShortcut(QKeySequence("alt+d,p"));
|
||||||
d->actions().addAction("previous applet", action);
|
d->actions().addAction("previous applet", action);
|
||||||
|
|
||||||
@ -171,7 +168,6 @@ void Containment::init()
|
|||||||
lockDesktopAction->setIcon(KIcon(unlocked ? "object-locked" : "object-unlocked"));
|
lockDesktopAction->setIcon(KIcon(unlocked ? "object-locked" : "object-unlocked"));
|
||||||
connect(lockDesktopAction, SIGNAL(triggered(bool)),
|
connect(lockDesktopAction, SIGNAL(triggered(bool)),
|
||||||
this, SLOT(toggleDesktopImmutability()));
|
this, SLOT(toggleDesktopImmutability()));
|
||||||
lockDesktopAction->setShortcutContext(Qt::WidgetShortcut);
|
|
||||||
lockDesktopAction->setShortcut(QKeySequence("alt+d,l"));
|
lockDesktopAction->setShortcut(QKeySequence("alt+d,l"));
|
||||||
d->actions().addAction("lock widgets", lockDesktopAction);
|
d->actions().addAction("lock widgets", lockDesktopAction);
|
||||||
}
|
}
|
||||||
@ -181,7 +177,6 @@ void Containment::init()
|
|||||||
KAction *zoomAction = new KAction(i18n("Zoom In"), this);
|
KAction *zoomAction = new KAction(i18n("Zoom In"), this);
|
||||||
zoomAction->setIcon(KIcon("zoom-in"));
|
zoomAction->setIcon(KIcon("zoom-in"));
|
||||||
connect(zoomAction, SIGNAL(triggered(bool)), this, SLOT(zoomIn()));
|
connect(zoomAction, SIGNAL(triggered(bool)), this, SLOT(zoomIn()));
|
||||||
zoomAction->setShortcutContext(Qt::WidgetShortcut);
|
|
||||||
//two shortcuts because I hate ctrl-+ but others expect it
|
//two shortcuts because I hate ctrl-+ but others expect it
|
||||||
QList<QKeySequence> keys;
|
QList<QKeySequence> keys;
|
||||||
keys << QKeySequence("alt+d,+");
|
keys << QKeySequence("alt+d,+");
|
||||||
@ -192,7 +187,6 @@ void Containment::init()
|
|||||||
zoomAction = new KAction(i18n("Zoom Out"), this);
|
zoomAction = new KAction(i18n("Zoom Out"), this);
|
||||||
zoomAction->setIcon(KIcon("zoom-out"));
|
zoomAction->setIcon(KIcon("zoom-out"));
|
||||||
connect(zoomAction, SIGNAL(triggered(bool)), this, SLOT(zoomOut()));
|
connect(zoomAction, SIGNAL(triggered(bool)), this, SLOT(zoomOut()));
|
||||||
zoomAction->setShortcutContext(Qt::WidgetShortcut);
|
|
||||||
zoomAction->setShortcut(QKeySequence("alt+d,-"));
|
zoomAction->setShortcut(QKeySequence("alt+d,-"));
|
||||||
d->actions().addAction("zoom out", zoomAction);
|
d->actions().addAction("zoom out", zoomAction);
|
||||||
|
|
||||||
@ -201,7 +195,6 @@ void Containment::init()
|
|||||||
activityAction->setVisible(unlocked);
|
activityAction->setVisible(unlocked);
|
||||||
activityAction->setEnabled(unlocked);
|
activityAction->setEnabled(unlocked);
|
||||||
connect(activityAction, SIGNAL(triggered(bool)), this, SLOT(addSiblingContainment()));
|
connect(activityAction, SIGNAL(triggered(bool)), this, SLOT(addSiblingContainment()));
|
||||||
activityAction->setShortcutContext(Qt::WidgetShortcut);
|
|
||||||
activityAction->setShortcut(QKeySequence("alt+d,alt+a"));
|
activityAction->setShortcut(QKeySequence("alt+d,alt+a"));
|
||||||
d->actions().addAction("add sibling containment", activityAction);
|
d->actions().addAction("add sibling containment", activityAction);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user