forked from qt-creator/qt-creator
Remove RestartDialog in favor of static function
The pattern was always to create the dialog and exec it, which can be done as well with just a function call. Change-Id: I3934cf5d869211713902abd333aa64d87ec59f32 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -907,6 +907,24 @@ Utils::InfoBar *ICore::infoBar()
|
||||
return d->m_modeStack->infoBar();
|
||||
}
|
||||
|
||||
/*!
|
||||
Shows a modal dialog that asks the user if they want to restart \QC.
|
||||
Uses \a text as the main text in the dialog, and triggers a restart
|
||||
of \QC if the user chooses that option.
|
||||
*/
|
||||
void ICore::askForRestart(const QString &text)
|
||||
{
|
||||
QMessageBox mb(dialogParent());
|
||||
mb.setWindowTitle(Tr::tr("Restart Required"));
|
||||
mb.setText(text);
|
||||
mb.setIcon(QMessageBox::Information);
|
||||
mb.addButton(Tr::tr("Later"), QMessageBox::NoRole);
|
||||
mb.addButton(Tr::tr("Restart Now"), QMessageBox::YesRole);
|
||||
|
||||
mb.connect(&mb, &QDialog::accepted, ICore::instance(), &ICore::restart, Qt::QueuedConnection);
|
||||
mb.exec();
|
||||
}
|
||||
|
||||
/*!
|
||||
Raises and activates the window for \a widget. This contains workarounds
|
||||
for X11.
|
||||
|
||||
Reference in New Issue
Block a user