emit cancel signal
both when clicking cancel and pressing esc CCBUG:265738
This commit is contained in:
parent
e193b7eab0
commit
11d3b789a4
11
applet.cpp
11
applet.cpp
@ -655,9 +655,12 @@ void AppletPrivate::destroyMessageOverlay()
|
||||
buttonCode = ButtonNo;
|
||||
}
|
||||
if (button->text() == i18n("Cancel")) {
|
||||
buttonCode = ButtonCancel;
|
||||
}
|
||||
|
||||
emit q->messageButtonPressed(buttonCode);
|
||||
} else if (q->sender() == messageOverlay) {
|
||||
emit q->messageButtonPressed(ButtonCancel);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1116,10 +1119,10 @@ void Applet::showMessage(const QIcon &icon, const QString &message, const Messag
|
||||
connect(cancel, SIGNAL(clicked()), this, SLOT(destroyMessageOverlay()));
|
||||
}
|
||||
|
||||
QAction *action = new QAction(this);
|
||||
action->setShortcut(Qt::Key_Escape);
|
||||
mainWidget->addAction(action);
|
||||
connect(action, SIGNAL(triggered()), this, SLOT(destroyMessageOverlay()));
|
||||
d->messageCloseAction = new QAction(d->messageOverlay);
|
||||
d->messageCloseAction.data()->setShortcut(Qt::Key_Escape);
|
||||
mainWidget->addAction(d->messageCloseAction.data());
|
||||
connect(d->messageCloseAction.data(), SIGNAL(triggered()), this, SLOT(destroyMessageOverlay()));
|
||||
|
||||
buttonLayout->addStretch();
|
||||
|
||||
|
@ -177,6 +177,7 @@ public:
|
||||
AppletScript *script;
|
||||
Package *package;
|
||||
ConfigLoader *configLoader;
|
||||
QWeakPointer<QAction> messageCloseAction;
|
||||
|
||||
// actions stuff; put activationAction into actions?
|
||||
KActionCollection *actions;
|
||||
|
Loading…
Reference in New Issue
Block a user