mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-11 16:34:04 +02:00
Reorganize the about dialog into a single JScrollPane
This commit is contained in:
@@ -1125,10 +1125,9 @@ public final class MainWindow implements Runnable, RipStatusHandler {
|
|||||||
trayMenuMain.addActionListener(arg0 -> toggleTrayClick());
|
trayMenuMain.addActionListener(arg0 -> toggleTrayClick());
|
||||||
MenuItem trayMenuAbout = new MenuItem("About " + mainFrame.getTitle());
|
MenuItem trayMenuAbout = new MenuItem("About " + mainFrame.getTitle());
|
||||||
trayMenuAbout.addActionListener(arg0 -> {
|
trayMenuAbout.addActionListener(arg0 -> {
|
||||||
StringBuilder about = new StringBuilder();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
List<String> rippers = Utils.getListOfAlbumRippers();
|
List<String> albumRippers = Utils.getListOfAlbumRippers();
|
||||||
|
List<String> videoRippers = Utils.getListOfVideoRippers();
|
||||||
|
|
||||||
JTextArea aboutTextArea = new JTextArea();
|
JTextArea aboutTextArea = new JTextArea();
|
||||||
aboutTextArea.setEditable(false);
|
aboutTextArea.setEditable(false);
|
||||||
@@ -1140,7 +1139,7 @@ public final class MainWindow implements Runnable, RipStatusHandler {
|
|||||||
|
|
||||||
StringBuilder aboutContent = new StringBuilder();
|
StringBuilder aboutContent = new StringBuilder();
|
||||||
aboutContent.append("Download albums from various websites:\n");
|
aboutContent.append("Download albums from various websites:\n");
|
||||||
for (String ripper : rippers) {
|
for (String ripper : albumRippers) {
|
||||||
ripper = ripper.substring(ripper.lastIndexOf('.') + 1);
|
ripper = ripper.substring(ripper.lastIndexOf('.') + 1);
|
||||||
if (ripper.contains("Ripper")) {
|
if (ripper.contains("Ripper")) {
|
||||||
ripper = ripper.substring(0, ripper.indexOf("Ripper"));
|
ripper = ripper.substring(0, ripper.indexOf("Ripper"));
|
||||||
@@ -1148,33 +1147,19 @@ public final class MainWindow implements Runnable, RipStatusHandler {
|
|||||||
aboutContent.append("- ").append(ripper).append("\n");
|
aboutContent.append("- ").append(ripper).append("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
aboutTextArea.setText(aboutContent.toString());
|
aboutContent.append("\nDownload videos from video sites:\n");
|
||||||
JOptionPane.showMessageDialog(null, scrollPane, "Supported Rippers", JOptionPane.INFORMATION_MESSAGE);
|
for (String ripper : videoRippers) {
|
||||||
} catch (Exception e) {
|
|
||||||
LOGGER.warn(e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
about.append("<br>And download videos from video sites:");
|
|
||||||
try {
|
|
||||||
List<String> rippers = Utils.getListOfVideoRippers();
|
|
||||||
about.append("<ul>");
|
|
||||||
for (String ripper : rippers) {
|
|
||||||
about.append("<li>");
|
|
||||||
ripper = ripper.substring(ripper.lastIndexOf('.') + 1);
|
ripper = ripper.substring(ripper.lastIndexOf('.') + 1);
|
||||||
if (ripper.contains("Ripper")) {
|
if (ripper.contains("Ripper")) {
|
||||||
ripper = ripper.substring(0, ripper.indexOf("Ripper"));
|
ripper = ripper.substring(0, ripper.indexOf("Ripper"));
|
||||||
}
|
}
|
||||||
about.append(ripper);
|
aboutContent.append("- ").append(ripper).append("\n");
|
||||||
about.append("</li>");
|
|
||||||
}
|
|
||||||
about.append("</ul>");
|
|
||||||
} catch (Exception e) {
|
|
||||||
LOGGER.warn(e.getMessage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
about.append("Do you want to visit the project homepage on Github?");
|
aboutContent.append("\nDo you want to visit the project homepage on Github?");
|
||||||
about.append("</html>");
|
aboutTextArea.setText(aboutContent.toString());
|
||||||
int response = JOptionPane.showConfirmDialog(null, about.toString(), mainFrame.getTitle(),
|
|
||||||
|
int response = JOptionPane.showConfirmDialog(null, scrollPane, mainFrame.getTitle(),
|
||||||
JOptionPane.YES_NO_OPTION, JOptionPane.PLAIN_MESSAGE, new ImageIcon(mainIcon));
|
JOptionPane.YES_NO_OPTION, JOptionPane.PLAIN_MESSAGE, new ImageIcon(mainIcon));
|
||||||
if (response == JOptionPane.YES_OPTION) {
|
if (response == JOptionPane.YES_OPTION) {
|
||||||
try {
|
try {
|
||||||
@@ -1183,6 +1168,9 @@ public final class MainWindow implements Runnable, RipStatusHandler {
|
|||||||
LOGGER.error("Exception while opening project home page", e);
|
LOGGER.error("Exception while opening project home page", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
LOGGER.warn(e.getMessage());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
MenuItem trayMenuExit = new MenuItem(Utils.getLocalizedString("tray.exit"));
|
MenuItem trayMenuExit = new MenuItem(Utils.getLocalizedString("tray.exit"));
|
||||||
|
Reference in New Issue
Block a user