Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default export file name. #249

Merged
merged 3 commits into from
Jun 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/org/jmc/gui/ExportWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,9 @@ public void actionPerformed(ActionEvent arg0) {
@Override
public void approveSelection() {
File f = getSelectedFile();
if (!f.toString().substring(f.toString().length() - 4).contentEquals(".obj")
|| f.toString().length() < 4)
if (!f.toString().toLowerCase().endsWith(".obj")) {
setSelectedFile(new File(f.toString() + ".obj"));
}
f = getSelectedFile();

if (f.exists()) {
Expand All @@ -606,6 +606,7 @@ public void approveSelection() {
super.approveSelection();
}
};
jfc.setSelectedFile(new File("clouds.obj"));
jfc.setFileHidingEnabled(false);
jfc.setFileFilter(new FileNameExtensionFilter("Obj files", "obj", "OBJ", "Obj"));
int retval = jfc.showDialog(ExportWindow.this, Messages.getString("TexsplitDialog.SEL_EXPORT_DEST"));
Expand All @@ -631,9 +632,9 @@ public void actionPerformed(ActionEvent arg0) {
@Override
public void approveSelection() {
File f = getSelectedFile();
if (!f.toString().substring(f.toString().length() - 4).contentEquals(".obj")
|| f.toString().length() < 4)
if (!f.toString().toLowerCase().endsWith(".obj")) {
setSelectedFile(new File(f.toString() + ".obj"));
}
f = getSelectedFile();

if (f.exists()) {
Expand Down Expand Up @@ -676,9 +677,9 @@ public void actionPerformed(ActionEvent e) {
@Override
public void approveSelection() {
File f = getSelectedFile();
if (!f.toString().substring(f.toString().length() - 4).contentEquals(".obj")
|| f.toString().length() < 4)
if (!f.toString().toLowerCase().endsWith(".obj")) {
setSelectedFile(new File(f.toString() + ".obj"));
}
f = getSelectedFile();
File f2 = new File(f.toString().replace(".obj", ".mtl"));

Expand Down Expand Up @@ -745,6 +746,7 @@ private void sendExport() {

};

jfc.setSelectedFile(new File("minecraft.obj"));
jfc.setFileHidingEnabled(false);

if (Options.useLastSaveLoc && !prefs.get("LAST_EXPORT_PATH", "not here").equals("not here")
Expand Down