Provide "Restart Now" functionality

And use it for the plugin dialog and when changing the UI language.

Change-Id: Ic767837d2526409f7ec46d7e4612a1499f19459e
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2020-01-03 16:47:15 +01:00
parent ad729a4085
commit be19b00289
17 changed files with 215 additions and 10 deletions

View File

@@ -28,6 +28,8 @@
#include "icore.h"
#include "infobar.h"
#include <coreplugin/dialogs/restartdialog.h>
#include <utils/checkablemessagebox.h>
#include <utils/hostosinfo.h>
#include <utils/stylehelper.h>
@@ -199,9 +201,11 @@ QString GeneralSettings::language() const
void GeneralSettings::setLanguage(const QString &locale)
{
QSettings *settings = ICore::settings();
if (settings->value(QLatin1String("General/OverrideLanguage")).toString() != locale)
QMessageBox::information(ICore::mainWindow(), tr("Restart Required"),
tr("The language change will take effect after restart."));
if (settings->value(QLatin1String("General/OverrideLanguage")).toString() != locale) {
RestartDialog dialog(ICore::dialogParent(),
tr("The language change will take effect after restart."));
dialog.exec();
}
if (locale.isEmpty())
settings->remove(QLatin1String("General/OverrideLanguage"));