InfoBar: Make adding more buttons possible

Change-Id: Ic0c946cf3f87fe46cd06391f38e0bc71374ad340
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Eike Ziller
2022-01-17 16:47:31 +01:00
parent 49ac087955
commit 3749cfc896
22 changed files with 40 additions and 39 deletions

View File

@@ -746,7 +746,7 @@ void AndroidManifestEditorWidget::updateInfoBar(const QString &errorMessage, int
else
text = tr("%2: Could not parse file: \"%1\".").arg(errorMessage).arg(line);
Utils::InfoBarEntry infoBarEntry(infoBarId, text);
infoBarEntry.setCustomButtonInfo(tr("Goto error"), [this]() {
infoBarEntry.addCustomButton(tr("Goto error"), [this]() {
m_textEditorWidget->gotoLine(m_errorLine, m_errorColumn);
});
infoBar->removeInfo(infoBarId);

View File

@@ -195,7 +195,7 @@ void AndroidPlugin::askUserAboutAndroidSetup()
"Android kits can be usable and all essential packages are installed. "
"To do it later, select Options > Devices > Android."),
Utils::InfoBarEntry::GlobalSuppression::Enabled);
info.setCustomButtonInfo(tr("Configure Android"), [this] {
info.addCustomButton(tr("Configure Android"), [this] {
Core::ICore::infoBar()->removeInfo(kSetupAndroidSetting);
Core::ICore::infoBar()->globallySuppressInfo(kSetupAndroidSetting);
QTimer::singleShot(0, this, [this]() { d->potentialKit.executeFromMenu(); });