Skip to content

Commit

Permalink
Cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
RetGal committed Mar 3, 2024
1 parent 79548e2 commit b494679
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main/java/mpo/dayon/common/gui/common/BaseFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.regex.Pattern;

import javax.swing.*;

Expand Down Expand Up @@ -270,7 +271,7 @@ protected Action createConnectionSettingsAction(Assistant assistant) {
public void actionPerformed(ActionEvent ev) {
JFrame networkFrame = (JFrame) SwingUtilities.getRoot((Component) ev.getSource());
final Font titleFont = new Font("Sans Serif", Font.BOLD, 14);
final String custom ="custom";
final String custom = "custom";

final JPanel panel = new JPanel();
panel.setLayout(new GridBagLayout());
Expand All @@ -285,7 +286,7 @@ public void actionPerformed(ActionEvent ev) {
if (frameType.equals(FrameType.ASSISTED)) {
final NetworkAssistedEngineConfiguration networkConfiguration = new NetworkAssistedEngineConfiguration();
currentTokenServer = networkConfiguration.getTokenServerUrl();
final JLabel hostLbl = new JLabel(translate("assistant"));
final JLabel hostLbl = new JLabel(toUpperFirst(translate("assistant")));
hostLbl.setFont(titleFont);
panel.add(hostLbl, createGridBagConstraints(gridy++));

Expand All @@ -306,7 +307,7 @@ public void actionPerformed(ActionEvent ev) {
} else {
final NetworkAssistantEngineConfiguration networkConfiguration = new NetworkAssistantEngineConfiguration();
currentTokenServer = networkConfiguration.getTokenServerUrl();
final JLabel hostLbl = new JLabel(translate("host"));
final JLabel hostLbl = new JLabel(toUpperFirst(translate("host")));
hostLbl.setFont(titleFont);
panel.add(hostLbl, createGridBagConstraints(gridy++));

Expand All @@ -327,7 +328,7 @@ public void actionPerformed(ActionEvent ev) {
panel.add(portPanel, createGridBagConstraints(gridy++));
}

final JLabel tokenServerLbl = new JLabel(translate("token.server"));
final JLabel tokenServerLbl = new JLabel(toUpperFirst(translate("token.server")));
tokenServerLbl.setFont(titleFont);
panel.add(tokenServerLbl, createGridBagConstraints(gridy++));

Expand Down Expand Up @@ -426,6 +427,10 @@ private void updateSystemProperty(String newTokenServerUrl) {
System.setProperty("dayon.custom.tokenServer", newTokenServerUrl);
}
}

private String toUpperFirst(String text) {
return Pattern.compile("^.").matcher(text).replaceFirst(m -> m.group().toUpperCase());
}
};
conf.putValue(Action.SHORT_DESCRIPTION, translate("connection.settings"));
conf.putValue(Action.SMALL_ICON, getOrCreateIcon(ImageNames.NETWORK_SETTINGS));
Expand Down

0 comments on commit b494679

Please sign in to comment.