[ui] fine-tuning startup error dialog actions (IJPL-358)

GitOrigin-RevId: df2d405d9e842b25d83ae3fe812a7b6b4f7bac51
This commit is contained in:
Roman Shevchenko
2024-07-17 13:31:50 +02:00
committed by intellij-monorepo-bot
parent 0274790972
commit 5ac939d463
4 changed files with 16 additions and 4 deletions

View File

@@ -1 +1,2 @@
skip: gradientBackground*
skip: questionSign.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 962 B

View File

@@ -29,6 +29,8 @@ import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.URI;
@@ -121,17 +123,26 @@ public final class StartupErrorReporter {
catch (Throwable ignore) { }
try {
var options = new String[]{
var iconUrl = StartupErrorReporter.class.getResource("/images/questionSign.png");
var learnMore = iconUrl != null ? new JLabel(new ImageIcon(iconUrl)) : new JLabel("?");
learnMore.setToolTipText(BootstrapBundle.message("bootstrap.error.option.support"));
learnMore.setCursor(new Cursor(Cursor.HAND_CURSOR));
learnMore.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
supportCenter();
}
});
var options = new Object[]{
BootstrapBundle.message("bootstrap.error.option.close"),
BootstrapBundle.message("bootstrap.error.option.reset"),
BootstrapBundle.message("bootstrap.error.option.report"),
BootstrapBundle.message("bootstrap.error.option.support")
learnMore
};
var choice = JOptionPane.showOptionDialog(JOptionPane.getRootFrame(), prepareMessage(message), title, JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE, null, options, options[0]);
switch (choice) {
case 1 -> cleanStart();
case 2 -> reportProblem(title, message);
case 3 -> supportCenter();
}
}
catch (Throwable t) {

View File

@@ -11,7 +11,7 @@ bootstrap.error.appendix.graphics=Also, a UI exception occurred in an attempt to
bootstrap.error.option.close=Close
bootstrap.error.option.support=Learn More
bootstrap.error.option.report=Report Problem
bootstrap.error.option.reset=Reset Settings
bootstrap.error.option.reset=Reset Settings\\&Plugins
bootstrap.error.title.browser=Cannot Open Browser
bootstrap.error.message.browser=Cannot launch the default browser.\n\nThe cause: {0}