Skip to content

Commit

Permalink
Merge pull request #524 from diamant3/improve-about-popup-window
Browse files Browse the repository at this point in the history
Improve About dialog window
  • Loading branch information
gid15 committed Dec 22, 2023
2 parents 37411ec + cd2251b commit 8a30f45
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 30 deletions.
54 changes: 28 additions & 26 deletions src/jpcsp/MainGUI.java
Expand Up @@ -40,6 +40,7 @@
import java.io.PrintStream;
import java.io.RandomAccessFile;
import java.net.InetAddress;
import java.net.URISyntaxException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.security.Security;
Expand All @@ -48,6 +49,7 @@
import java.util.List;

import javax.swing.*;
import javax.swing.event.HyperlinkEvent;

import jpcsp.Allegrex.compiler.Profiler;
import jpcsp.Allegrex.compiler.RuntimeContext;
Expand Down Expand Up @@ -1822,32 +1824,32 @@ private void EnterImageViewerActionPerformed(java.awt.event.ActionEvent evt) {//
private void AboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AboutActionPerformed
StringBuilder message = new StringBuilder();
message
.append("<html>")
.append("<h2>")
.append(MetaInformation.FULL_NAME)
.append("</h2>")
.append("<hr/>")
.append("Official site : <a href='")
.append(MetaInformation.OFFICIAL_SITE)
.append("'>")
.append(MetaInformation.OFFICIAL_SITE)
.append("</a><br/>")
.append("Official forum : <a href='")
.append(MetaInformation.OFFICIAL_FORUM)
.append("'>")
.append(MetaInformation.OFFICIAL_FORUM)
.append("</a><br/>")
.append("Official repository: <a href='")
.append(MetaInformation.OFFICIAL_REPOSITORY)
.append("'>")
.append(MetaInformation.OFFICIAL_REPOSITORY)
.append("</a><br/>")
.append("<hr/>")
.append("<i>Team:</i> <font color='gray'>")
.append(MetaInformation.TEAM)
.append("</font>")
.append("</html>");
JOptionPane.showMessageDialog(this, message.toString(), MetaInformation.FULL_NAME, JOptionPane.INFORMATION_MESSAGE);
.append("<html><body><center>")
.append("<h1>" + MetaInformation.FULL_NAME + "</h1>")
.append("<hr/>")
.append("<h2>Official Links</h2>")
.append("<p><b>Website:</b> <a href='" + MetaInformation.OFFICIAL_SITE + "'>" + MetaInformation.OFFICIAL_SITE + "</a></p>")
.append("<p><b>Forum:</b> <a href='" + MetaInformation.OFFICIAL_FORUM + "'>" + MetaInformation.OFFICIAL_FORUM + "</a></p>")
.append("<p><b>Source repository:</b> <a href='" + MetaInformation.OFFICIAL_REPOSITORY + "'>" + MetaInformation.OFFICIAL_REPOSITORY + "</a></p>")
.append("<hr/>")
.append("<h2>Jpcsp Present Team</h2>")
.append("<h3><font color='gray'>" + MetaInformation.TEAM + "</font></h3>")
.append("<h2>Past Members and Contributors</h2>")
.append("<h3><font color='gray'>" + MetaInformation.PAST_TEAM + "</font></h3>")
.append("</center></body></html>");
JEditorPane msg = new JEditorPane();
msg.addHyperlinkListener(link -> { // make all hyperlinks clickable
if (link.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
try { Desktop.getDesktop().browse(link.getURL().toURI()); }
catch (URISyntaxException | IOException ex) { ex.printStackTrace(); }
}
});
msg.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE); // use default look and feel
msg.setContentType("text/html");
msg.setEditable(false);
msg.setOpaque(false);
msg.setText(message.toString());
JOptionPane.showMessageDialog(this, msg, "About", JOptionPane.PLAIN_MESSAGE);
}//GEN-LAST:event_AboutActionPerformed

private void ConfigMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ConfigMenuActionPerformed
Expand Down
10 changes: 6 additions & 4 deletions src/jpcsp/util/MetaInformation.java
Expand Up @@ -24,11 +24,13 @@ public class MetaInformation {
public static String NAME = "Jpcsp";
public static String VERSION = "v0.7";
public static String FULL_NAME = NAME + " " + VERSION;
public static String OFFICIAL_SITE = "http://jpcsp.org/";
public static String OFFICIAL_FORUM = "http://www.emunewz.net/forum/forumdisplay.php?fid=51";
public static String OFFICIAL_SITE = "https://jpcsp.org";
public static String OFFICIAL_FORUM = "https://www.emunewz.net/forum/forumdisplay.php?fid=51";
public static String OFFICIAL_REPOSITORY = "https://github.com/jpcsp/jpcsp";
public static String TEAM = "JPCSP Team: gid15, Hykem, Orphis, shadow.<br/>" +
"Past members and contributors: hlide, mad, dreampeppers99, wrayal,<br/> fiveofhearts, Nutzje, aisesal, shashClp, spip2, mozvip, gigaherz, <br/>Drakon, raziel1000, theball, J_BYYX, i30817, tempura.san.";
public static String TEAM = "gid15 <br/>";
public static String PAST_TEAM = "Hykem, Orphis, shadow, nickblame, hlide, mad, dreampeppers99, wrayal, <br/>" +
"fiveofhearts, Nutzje, aisesal, shashClp, spip2, mozvip, gigaherz, <br/>" +
"Drakon, raziel1000, theball, J_BYYX, i30817, tempura.san";

private MetaInformation() {
try {
Expand Down

0 comments on commit 8a30f45

Please sign in to comment.