Skip to content

Commit

Permalink
ho-dev#2063 download missing world details
Browse files Browse the repository at this point in the history
  • Loading branch information
wsbrenk committed May 20, 2024
1 parent 78dc458 commit 301c3a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
1 change: 0 additions & 1 deletion src/main/java/core/net/MyConnector.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import com.github.scribejava.core.model.*;
import core.file.xml.XMLCHPPPreParser;
import core.file.xml.XMLTeamDetailsParser;
import core.gui.CursorToolkit;
import core.gui.HOMainFrame;
import core.model.HOVerwaltung;
Expand Down
24 changes: 6 additions & 18 deletions src/main/java/module/ifa/RightPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import core.model.WorldDetailsManager;
import core.net.MyConnector;
import core.util.GUIUtils;
import core.util.HOLogger;
import core.util.IOUtils;
import module.ifa.gif.Gif89Encoder;
import module.ifa.model.IfaModel;
Expand All @@ -17,10 +18,7 @@
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.List;
Expand Down Expand Up @@ -61,10 +59,10 @@ private void initComponents() {

JPanel buttonPanel = new JPanel();
GridBagConstraints gbc = new GridBagConstraints();
this.updateButton = new JButton(getLangString("ls.button.update"));
this.updateButton = new JButton(HOVerwaltung.instance().getLanguageString("ls.button.update"));
gbc.anchor = GridBagConstraints.EAST;
buttonPanel.add(this.updateButton, gbc);
this.saveImageButton = new JButton(getLangString("ifa.imageBuilder.button.save"));
this.saveImageButton = new JButton(HOVerwaltung.instance().getLanguageString("ifa.imageBuilder.button.save"));
gbc.gridx = 1;
gbc.anchor = GridBagConstraints.WEST;
buttonPanel.add(this.saveImageButton, gbc);
Expand All @@ -75,13 +73,13 @@ private void initComponents() {
gbc.gridwidth = 2;
add(buttonPanel, gbc);

this.awayRadioButton = new JRadioButton(getLangString("ifa.imageBuilder.visited"), true);
this.awayRadioButton = new JRadioButton(HOVerwaltung.instance().getLanguageString("ifa.imageBuilder.visited"), true);
gbc.insets = new Insets(5, 6, 5, 6);
gbc.gridy = 1;
gbc.gridwidth = 1;
add(this.awayRadioButton, gbc);

this.homeRadioButton = new JRadioButton(getLangString("ifa.imageBuilder.hosted"), false);
this.homeRadioButton = new JRadioButton(HOVerwaltung.instance().getLanguageString("ifa.imageBuilder.hosted"), false);
gbc.gridx = 1;
add(this.homeRadioButton, gbc);

Expand Down Expand Up @@ -121,7 +119,7 @@ private void addListeners() {
DBManager.instance().storeWorldDetailLeagues(leagues);
WorldDetailsManager.instance().refresh();
} catch (IOException e1) {
e1.printStackTrace();
HOLogger.instance().warning(getClass(), "Could not download world details: " + e1.getMessage());
}
PluginIfaUtils.updateMatchesTable();
RightPanel.this.model.reload();
Expand All @@ -137,16 +135,6 @@ private void addListeners() {

}

/**
* Convenience method
*
* @param key
* @return
*/
private static String getLangString(String key) {
return HOVerwaltung.instance().getLanguageString(key);
}

private void saveImage() throws IOException {
boolean away = this.awayRadioButton.isSelected();

Expand Down

0 comments on commit 301c3a7

Please sign in to comment.