Show warning with continue/cancel in case of many search results

Task-number: QTCREATORBUG-6116
Change-Id: I57a66b8989f1cc4137b02df370704dfe43d392ac
Reviewed-by: Robert Löhning <robert.loehning@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
Eike Ziller
2012-05-25 16:45:18 +02:00
parent 72187be3dd
commit ddc0c89bd6
15 changed files with 219 additions and 29 deletions

View File

@@ -66,6 +66,13 @@ void InfoBarEntry::setCancelButtonInfo(QObject *_object, const char *_member)
cancelButtonPressMember = _member;
}
void InfoBarEntry::setCancelButtonInfo(const QString &_cancelButtonText, QObject *_object, const char *_member)
{
cancelButtonText = _cancelButtonText;
cancelObject = _object;
cancelButtonPressMember = _member;
}
void InfoBar::addInfo(const InfoBarEntry &info)
{
@@ -169,15 +176,22 @@ void InfoBarDisplay::update()
}
QToolButton *infoWidgetCloseButton = new QToolButton;
infoWidgetCloseButton->setAutoRaise(true);
infoWidgetCloseButton->setIcon(QIcon(QLatin1String(Core::Constants::ICON_CLEAR)));
infoWidgetCloseButton->setToolTip(tr("Close"));
infoWidgetCloseButton->setProperty("infoId", info.id);
connect(infoWidgetCloseButton, SIGNAL(clicked()), SLOT(cancelButtonClicked()));
// need to connect to cancelObjectbefore connecting to cancelButtonClicked,
// because the latter removes the button and with it any connect
if (info.cancelObject)
connect(infoWidgetCloseButton, SIGNAL(clicked()),
info.cancelObject, info.cancelButtonPressMember);
connect(infoWidgetCloseButton, SIGNAL(clicked()), SLOT(cancelButtonClicked()));
if (info.cancelButtonText.isEmpty()) {
infoWidgetCloseButton->setAutoRaise(true);
infoWidgetCloseButton->setIcon(QIcon(QLatin1String(Core::Constants::ICON_CLEAR)));
infoWidgetCloseButton->setToolTip(tr("Close"));
} else {
infoWidgetCloseButton->setText(info.cancelButtonText);
}
hbox->addWidget(infoWidgetCloseButton);