Merge pull request #1309 from SiboVG/issue-1304
fixes #1304 Improve thrust curve import dialog
This commit is contained in:
commit
2c4ebabaa1
@ -1,5 +1,6 @@
|
|||||||
package net.sf.openrocket.database;
|
package net.sf.openrocket.database;
|
||||||
|
|
||||||
|
import java.awt.Dialog;
|
||||||
import java.io.BufferedInputStream;
|
import java.io.BufferedInputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
@ -24,6 +25,7 @@ import net.sf.openrocket.startup.Application;
|
|||||||
import net.sf.openrocket.util.BugException;
|
import net.sf.openrocket.util.BugException;
|
||||||
import net.sf.openrocket.util.Pair;
|
import net.sf.openrocket.util.Pair;
|
||||||
|
|
||||||
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -144,11 +146,15 @@ public class MotorDatabaseLoader extends AsynchronousDatabaseLoader {
|
|||||||
}
|
}
|
||||||
catch (IllegalArgumentException e) {
|
catch (IllegalArgumentException e) {
|
||||||
Translator trans = Application.getTranslator();
|
Translator trans = Application.getTranslator();
|
||||||
|
File thrustCurveDir = ((SwingPreferences) Application.getPreferences()).getDefaultUserThrustCurveFile();
|
||||||
|
File fullPath = new File(thrustCurveDir, f.getU());
|
||||||
String message = "<html><body><p style='width: 400px;'><i>" + e.getMessage() +
|
String message = "<html><body><p style='width: 400px;'><i>" + e.getMessage() +
|
||||||
"</i>.<br><br>" + MessageFormat.format( trans.get("MotorDbLoaderDlg.message1"), f.getU()) +
|
"</i>.<br><br>" + MessageFormat.format( trans.get("MotorDbLoaderDlg.message1"), fullPath.getPath()) +
|
||||||
"<br>" + trans.get("MotorDbLoaderDlg.message2") + "</p></body></html>";
|
"<br>" + trans.get("MotorDbLoaderDlg.message2") + "</p></body></html>";
|
||||||
JOptionPane.showMessageDialog(null,
|
JOptionPane pane = new JOptionPane(message, JOptionPane.WARNING_MESSAGE);
|
||||||
message, trans.get("MotorDbLoaderDlg.title"), JOptionPane.WARNING_MESSAGE);
|
JDialog dialog = pane.createDialog(null, trans.get("MotorDbLoaderDlg.title"));
|
||||||
|
dialog.setModalityType(Dialog.ModalityType.DOCUMENT_MODAL);
|
||||||
|
dialog.setVisible(true);
|
||||||
}
|
}
|
||||||
f.getV().close();
|
f.getV().close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user