Skip to content

Commit

Permalink
Add screenshots. Remove ul.cfg in case user removed all records inside.
Browse files Browse the repository at this point in the history
  • Loading branch information
developersu committed Sep 24, 2022
1 parent ecc586d commit 42f1677
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

OPL-compatible PS2 tool for making split files. Sort of ul.cfg manager or USBUtil.

![Application screenshot](screenshots/1.png)
![Application screenshot1](screenshots/1.png)
![Application screenshot2](screenshots/2.png)

#### Let's stay in touch

Expand Down
Binary file modified screenshots/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions src/main/java/tihwin/UpdateUlTableUi.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import javax.swing.table.JTableHeader;
import java.awt.*;
import java.io.File;
import java.nio.file.Files;
import java.util.*;
import java.util.List;

Expand All @@ -49,6 +50,7 @@ public UpdateUlTableUi(String ulDestinationLocation) {
super();
this.resourceBundle = ResourceBundle.getBundle("locale");
this.ulLocationLbl = new JLabel(ulDestinationLocation);
this.recentRomLocation = ulDestinationLocation;
setupTable();
setupSaveButton();

Expand Down Expand Up @@ -86,7 +88,6 @@ public UpdateUlTableUi(String ulDestinationLocation) {
setTitle(resourceBundle.getString("ulManager"));

File ulCfgFile = new File(ulDestinationLocation + File.separator + "ul.cfg");
this.recentRomLocation = ulDestinationLocation;
if (ulCfgFile.exists())
showInTableUlCfgFile(ulCfgFile);
}
Expand Down Expand Up @@ -151,6 +152,7 @@ private void showInTableUlCfgFile(File ulCfgFile){
}

saveChangesBtn.setEnabled(true);
ulLocationLbl.setText(ulCfgFile.getParentFile().getAbsolutePath());
statusLbl.setText(ulCfgFile.getAbsolutePath());
}
catch (Exception e){
Expand Down Expand Up @@ -193,7 +195,13 @@ private void saveChangesAction(){
// Write new ul.cfg
UlServiceTools.writeUlCfgFile(ulLocation, finalConfigurationSet);
File ulCfgFile = new File(ulLocation+File.separator+"ul.cfg");
showInTableUlCfgFile(ulCfgFile);
if (ulCfgFile.length() == 0) {
Files.deleteIfExists(ulCfgFile.toPath());
saveChangesBtn.setEnabled(false);
}
else {
showInTableUlCfgFile(ulCfgFile);
}

statusLbl.setText(resourceBundle.getString("SuccessText"));
}
Expand Down

0 comments on commit 42f1677

Please sign in to comment.