mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
[ui] altering the confirmation text when restart is not supported
GitOrigin-RevId: 2c9695093124fd47b009ca4c82c50df8565706bc
This commit is contained in:
committed by
intellij-monorepo-bot
parent
665ed312f8
commit
12b784de5c
@@ -2156,6 +2156,7 @@ toolwindow.header.accessible.name=Tool Window Header
|
||||
|
||||
dialog.title.restart.ide=Restart?
|
||||
dialog.message.restart.ide=Would you like to restart the IDE?
|
||||
dialog.message.restart.alt=Restart is not supported on your setup. Would you like to quit the IDE?
|
||||
dialog.action.restart.yes=Restart
|
||||
dialog.action.restart.cancel=Cancel
|
||||
dialog.message.caches.will.be.invalidated=Remove caches and indexes for all projects. New caches will be built when you reopen the projects.
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.intellij.ide.GeneralSettings
|
||||
import com.intellij.ide.IdeBundle
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.application.ApplicationNamesInfo
|
||||
import com.intellij.openapi.application.ex.ApplicationEx
|
||||
import com.intellij.openapi.application.ex.ApplicationManagerEx
|
||||
import com.intellij.openapi.ui.MessageConstants
|
||||
import com.intellij.openapi.ui.Messages
|
||||
@@ -28,19 +27,21 @@ class RestartDialogImpl : RestartDialog {
|
||||
|
||||
@JvmStatic
|
||||
fun restartWithConfirmation() {
|
||||
val app = ApplicationManagerEx.getApplicationEx()
|
||||
|
||||
if (GeneralSettings.getInstance().isConfirmExit) {
|
||||
if (Messages.showYesNoDialog(
|
||||
IdeBundle.message("dialog.message.restart.ide"),
|
||||
IdeBundle.message("dialog.title.restart.ide"),
|
||||
IdeBundle.message("dialog.action.restart.yes"),
|
||||
IdeBundle.message("dialog.action.restart.cancel"),
|
||||
Messages.getWarningIcon()
|
||||
) != Messages.YES) {
|
||||
val answer = Messages.showYesNoDialog(
|
||||
IdeBundle.message(if (app.isRestartCapable()) "dialog.message.restart.ide" else "dialog.message.restart.alt"),
|
||||
IdeBundle.message("dialog.title.restart.ide"),
|
||||
IdeBundle.message(if (app.isRestartCapable()) "ide.restart.action" else "ide.shutdown.action"),
|
||||
CommonBundle.getCancelButtonText(),
|
||||
Messages.getQuestionIcon()
|
||||
)
|
||||
if (answer != Messages.YES) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
val app = ApplicationManager.getApplication() as ApplicationEx
|
||||
app.restart(true)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user