Skip to content

Commit e4de5b9

Browse files
committed
fix. disable install button when showing all games.
1 parent 617d0fa commit e4de5b9

File tree

4 files changed

+14
-24
lines changed

4 files changed

+14
-24
lines changed

Diff for: pom.xml

+3-18
Original file line numberDiff line numberDiff line change
@@ -40,37 +40,22 @@
4040
<dependency>
4141
<groupId>com.google.code.gson</groupId>
4242
<artifactId>gson</artifactId>
43-
<version>2.8.1</version>
43+
<version>2.8.2</version>
4444
</dependency>
4545
<dependency>
4646
<groupId>commons-io</groupId>
4747
<artifactId>commons-io</artifactId>
48-
<version>2.4</version>
48+
<version>2.6</version>
4949
</dependency>
5050
<dependency>
5151
<groupId>commons-lang</groupId>
5252
<artifactId>commons-lang</artifactId>
5353
<version>2.6</version>
5454
</dependency>
55-
<dependency>
56-
<groupId>com.squareup.retrofit2</groupId>
57-
<artifactId>retrofit</artifactId>
58-
<version>2.2.0</version>
59-
</dependency>
60-
<dependency>
61-
<groupId>com.squareup.retrofit2</groupId>
62-
<artifactId>converter-gson</artifactId>
63-
<version>2.2.0</version>
64-
</dependency>
65-
<dependency>
66-
<groupId>com.squareup.okhttp3</groupId>
67-
<artifactId>okhttp</artifactId>
68-
<version>3.6.0</version>
69-
</dependency>
7055
<dependency>
7156
<groupId>org.apache.commons</groupId>
7257
<artifactId>commons-csv</artifactId>
73-
<version>1.4</version>
58+
<version>1.5</version>
7459
</dependency>
7560

7661
<dependency>

Diff for: src/main/java/org/ado/psplib/gameloader/GameLoaderService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public void setLibraryDirectory(String libraryDirectory) {
4848
protected Task<List<GameView>> createTask() {
4949
return new Task<List<GameView>>() {
5050
@Override
51-
protected List<GameView> call() throws Exception {
51+
protected List<GameView> call() {
5252
final List<GameView> list = new ArrayList<>();
5353

5454
if (libraryDir != null && new File(libraryDir).exists()) {

Diff for: src/main/java/org/ado/psplib/install/InstallGameService.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import java.io.File;
1111
import java.io.IOException;
12+
import java.nio.charset.StandardCharsets;
1213
import java.util.List;
1314

1415
import static java.lang.String.format;
@@ -69,7 +70,7 @@ protected GameView call() throws Exception {
6970
);
7071
try {
7172
final int statusCode = extractProcess.waitFor();
72-
final String input = IOUtils.toString(extractProcess.getInputStream());
73+
final String input = IOUtils.toString(extractProcess.getInputStream(), StandardCharsets.UTF_8);
7374
if (statusCode > 0 || input.startsWith("Usage")) {
7475
LOGGER.error("Unable to extract CSO file into ISO. Cause: " + input);
7576
throw new IOException(format("Unable to extract CSO file %s into ISO.", csoFile.getAbsolutePath()));

Diff for: src/main/java/org/ado/psplib/view/AppPresenter.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,15 @@ public void myGames() {
342342
}
343343

344344
public void allGames() {
345+
installButton.setText("Install");
346+
installButton.setDisable(true);
347+
uninstallButton.setDisable(true);
345348
gamePane.setVisible(false);
346349
statusLabel.setText("");
347350
gameViewObservableList.setAll(fullGameList);
348351
gamesListView.setOnMouseClicked(event -> {
349352
final ObservableList<GameView> selectedItems = gamesListView.getSelectionModel().getSelectedItems();
353+
gamePane.setVisible(false);
350354
if (!selectedItems.isEmpty()) {
351355
gamePane.setVisible(true);
352356

@@ -356,9 +360,6 @@ public void allGames() {
356360
genreLabel.setText(String.join(", ", (CharSequence[]) gameView.game().genres()));
357361
scoreLabel.setText(String.valueOf(gameView.game().score()) + "/100");
358362
loadGameImage(gameView.game().cover());
359-
360-
} else {
361-
gamePane.setVisible(false);
362363
}
363364
});
364365
}
@@ -395,7 +396,10 @@ private EventHandler<MouseEvent> onClickMyGames() {
395396
if (isInstalled) {
396397
uninstallButton.setDisable(false);
397398
} else {
398-
installButton.setText(format("Install (%d)", selectedItems.size()));
399+
installButton.setText("Install");
400+
if (selectedItems.size() > 1) {
401+
installButton.setText(format("Install (%d)", selectedItems.size()));
402+
}
399403
installButton.setDisable(false);
400404
}
401405
} else {

0 commit comments

Comments
 (0)