forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user