X-Git-Url: https://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Fsave%2FPovExporter.java;h=654aac6d4c8ed83baadb8ddc099f11527c466596;hp=c96d744dbcfc0c35f6886d5e75fbe752cccc7b7a;hb=112bb0c9b46894adca9a33ed8c99ea712b253185;hpb=54b9d8bc8f0025ccf97a67d9dd217ef1f9cf082f diff --git a/tim/prune/save/PovExporter.java b/tim/prune/save/PovExporter.java index c96d744..654aac6 100644 --- a/tim/prune/save/PovExporter.java +++ b/tim/prune/save/PovExporter.java @@ -167,7 +167,7 @@ public class PovExporter extends GenericFunction JLabel fontLabel = new JLabel(I18nManager.getText("dialog.exportpov.font")); fontLabel.setHorizontalAlignment(SwingConstants.TRAILING); centralPanel.add(fontLabel); - String defaultFont = Config.getPovrayFont(); + String defaultFont = Config.getConfigString(Config.KEY_POVRAY_FONT); if (defaultFont == null || defaultFont.equals("")) { defaultFont = DEFAULT_FONT_FILE; } @@ -265,8 +265,8 @@ public class PovExporter extends GenericFunction _fileChooser.setFileFilter(new GenericFileFilter("filetype.pov", new String[] {"pov"})); _fileChooser.setAcceptAllFileFilterUsed(false); // start from directory in config which should be set - File configDir = Config.getWorkingDirectory(); - if (configDir != null) {_fileChooser.setCurrentDirectory(configDir);} + final String configDir = Config.getConfigString(Config.KEY_TRACK_DIR); + if (configDir != null) {_fileChooser.setCurrentDirectory(new File(configDir));} } // Allow choose again if an existing file is selected @@ -295,7 +295,7 @@ public class PovExporter extends GenericFunction { // file saved // Store directory in config for later - Config.setWorkingDirectory(file.getParentFile()); + Config.setConfigString(Config.KEY_TRACK_DIR, file.getParentFile().getAbsolutePath()); } else { @@ -359,7 +359,7 @@ public class PovExporter extends GenericFunction } catch (IOException ioe) { - JOptionPane.showMessageDialog(_parentFrame, I18nManager.getText("error.save.failed") + ioe.getMessage(), + JOptionPane.showMessageDialog(_parentFrame, I18nManager.getText("error.save.failed") + " : " + ioe.getMessage(), I18nManager.getText("error.save.dialogtitle"), JOptionPane.ERROR_MESSAGE); } finally @@ -394,6 +394,9 @@ public class PovExporter extends GenericFunction { fontPath = DEFAULT_FONT_FILE; } + else { + Config.setConfigString(Config.KEY_POVRAY_FONT, fontPath); + } // Set up output String[] outputLines = { "global_settings { ambient_light rgb <4, 4, 4> }", "", @@ -428,7 +431,7 @@ public class PovExporter extends GenericFunction " open", " pigment { color rgb <0.5 0.5 0.5> }", " }", "", - // TODO: Export rods to POV? How to store in data? + // MAYBE: Export rods to POV? How to store in data? "#declare waypoint_sphere =", " sphere {", " <0, 0, 0>, 0.4", @@ -514,7 +517,7 @@ public class PovExporter extends GenericFunction " pigment { color rgb <1 1 1> }", " translate <-" + (inModelSize * 1.03) + ", 0.2, 0>", "}", "", - // TODO: Light positions should relate to model size + // MAYBE: Light positions should relate to model size "// lights", "light_source { <-1, 9, -4> color rgb <0.5 0.5 0.5>}", "light_source { <1, 6, -14> color rgb <0.6 0.6 0.6>}",