only close the desktop toolbox if the action is non-repeatable, which implies it's a fire-and-forget type of action such as something that triggers a dialog

BUG:198229

svn path=/trunk/KDE/kdelibs/; revision=988884
This commit is contained in:
Aaron J. Seigo 2009-06-29 01:22:58 +00:00
parent 1611d9f38d
commit a179a16a9e
4 changed files with 10 additions and 1 deletions

View File

@ -1442,11 +1442,13 @@ KActionCollection* AppletPrivate::defaultActions(QObject *parent)
actions->setConfigGroup("Shortcuts-Applet"); actions->setConfigGroup("Shortcuts-Applet");
KAction *configAction = actions->addAction("configure"); KAction *configAction = actions->addAction("configure");
configAction->setAutoRepeat(false);
configAction->setText(i18n("Widget Settings")); configAction->setText(i18n("Widget Settings"));
configAction->setIcon(KIcon("configure")); configAction->setIcon(KIcon("configure"));
configAction->setShortcut(KShortcut("alt+d, s")); configAction->setShortcut(KShortcut("alt+d, s"));
KAction *closeApplet = actions->addAction("remove"); KAction *closeApplet = actions->addAction("remove");
closeApplet->setAutoRepeat(false);
closeApplet->setText("Remove this Widget"); closeApplet->setText("Remove this Widget");
closeApplet->setIcon(KIcon("edit-delete")); closeApplet->setIcon(KIcon("edit-delete"));
closeApplet->setShortcut(KShortcut("alt+d, r")); closeApplet->setShortcut(KShortcut("alt+d, r"));

View File

@ -240,6 +240,7 @@ void ContainmentPrivate::addDefaultActions(KActionCollection *actions)
//add our own actions //add our own actions
KAction *appletBrowserAction = actions->addAction("add widgets"); KAction *appletBrowserAction = actions->addAction("add widgets");
appletBrowserAction->setAutoRepeat(false);
appletBrowserAction->setText(i18n("Add Widgets...")); appletBrowserAction->setText(i18n("Add Widgets..."));
appletBrowserAction->setIcon(KIcon("list-add")); appletBrowserAction->setIcon(KIcon("list-add"));
appletBrowserAction->setShortcut(KShortcut("alt+d, a")); appletBrowserAction->setShortcut(KShortcut("alt+d, a"));
@ -255,6 +256,7 @@ void ContainmentPrivate::addDefaultActions(KActionCollection *actions)
action->setShortcut(KShortcut("alt+d, p")); action->setShortcut(KShortcut("alt+d, p"));
KAction *zoomAction = actions->addAction("zoom in"); KAction *zoomAction = actions->addAction("zoom in");
zoomAction->setAutoRepeat(false);
zoomAction->setText(i18n("Zoom In")); zoomAction->setText(i18n("Zoom In"));
zoomAction->setIcon(KIcon("zoom-in")); zoomAction->setIcon(KIcon("zoom-in"));
//two shortcuts because I hate ctrl-+ but others expect it //two shortcuts because I hate ctrl-+ but others expect it

View File

@ -98,6 +98,7 @@ public:
KAction *action = actions.addAction("configure shortcuts"); KAction *action = actions.addAction("configure shortcuts");
action->setText(i18n("Shortcut Settings")); action->setText(i18n("Shortcut Settings"));
action->setIcon(KIcon("configure")); action->setIcon(KIcon("configure"));
action->setAutoRepeat(false);
QObject::connect(action, SIGNAL(triggered()), QObject::connect(action, SIGNAL(triggered()),
q, SLOT(showShortcutConfig())); q, SLOT(showShortcutConfig()));
//action->setShortcut(KShortcut("ctrl+h")); //action->setShortcut(KShortcut("ctrl+h"));

View File

@ -309,7 +309,11 @@ void DesktopToolBox::assignColors()
void DesktopToolBox::toolTriggered(bool) void DesktopToolBox::toolTriggered(bool)
{ {
hideToolBox(); QAction *action = qobject_cast<QAction *>(sender());
if (!action || !action->autoRepeat()) {
hideToolBox();
}
} }
void DesktopToolBox::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) void DesktopToolBox::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)