Skip to content

Commit

Permalink
Fix wrong formatted error dialog texts and remove unused variant of G…
Browse files Browse the repository at this point in the history
…uiUtils.showMessageDialog()
  • Loading branch information
bwRavencl committed Aug 17, 2024
1 parent 7796838 commit 5e4e03b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
8 changes: 0 additions & 8 deletions src/main/java/de/bwravencl/controllerbuddy/gui/GuiUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.UIManager;

@SuppressWarnings({ "exports", "missing-explicit-ctor" })
public final class GuiUtils {
Expand Down Expand Up @@ -175,13 +174,6 @@ private static void setFrameLocationRespectingBounds(final Frame frame, final Po
frame.setLocation(location);
}

public static void showMessageDialog(final Main main, @SuppressWarnings("exports") final Component parentComponent,
final Object message) throws HeadlessException {
showMessageDialog(main, parentComponent, message,
UIManager.getString("OptionPane.messageDialogTitle", parentComponent.getLocale()),
JOptionPane.INFORMATION_MESSAGE);
}

public static void showMessageDialog(final Main main, @SuppressWarnings("exports") final Component parentComponent,
final Object message, final String title, final int messageType) throws HeadlessException {
showMessageDialog(main, parentComponent, message, title, messageType, null);
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/de/bwravencl/controllerbuddy/gui/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -1742,10 +1742,9 @@ private void handleRemainingCommandLine(final CommandLine commandLine) {
MessageFormat.format(
strings.getString("INVALID_VALUE_FOR_COMMAND_LINE_OPTION_AUTOSTART_DIALOG_TEXT"),
OPTION_AUTOSTART, autostartOptionValue,
MessageFormat.format(
isWindows || isLinux ? strings.getString("LOCAL_FEEDER_OR_CLIENT_OR_SERVER")
: strings.getString("SERVER"),
strings.getString("ERROR_DIALOG_TITLE"), JOptionPane.ERROR_MESSAGE)));
isWindows || isLinux ? strings.getString("LOCAL_FEEDER_OR_CLIENT_OR_SERVER")
: strings.getString("SERVER")),
strings.getString("ERROR_DIALOG_TITLE"), JOptionPane.ERROR_MESSAGE);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ final boolean init() {
"vJoy DLL version " + dllVersion + " does not match driver version " + drvVersion);
EventQueue.invokeLater(() -> GuiUtils.showMessageDialog(main, main.getFrame(),
MessageFormat.format(Main.strings.getString("VJOY_VERSION_MISMATCH_DIALOG_TEXT"),
dllVersion.getValue().shortValue(), drvVersion.getValue().shortValue(),
Main.strings.getString("ERROR_DIALOG_TITLE"), JOptionPane.ERROR_MESSAGE)));
dllVersion.getValue().shortValue(), drvVersion.getValue().shortValue()),
Main.strings.getString("ERROR_DIALOG_TITLE"), JOptionPane.ERROR_MESSAGE));
return false;
}

Expand Down

0 comments on commit 5e4e03b

Please sign in to comment.