X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Fload%2FBabelLoadFromFile.java;h=187bb495c196ead68ad00b73a5926041267360e8;hb=326f489e36aa7f235bc19409a57bf4955cd50f24;hp=f7866efaf0cacc1512dbca0facc3b2aa509df944;hpb=649c5da6ee1bbc590699e11a92316ece2ea8512d;p=GpsPrune.git diff --git a/tim/prune/load/BabelLoadFromFile.java b/tim/prune/load/BabelLoadFromFile.java index f7866ef..187bb49 100644 --- a/tim/prune/load/BabelLoadFromFile.java +++ b/tim/prune/load/BabelLoadFromFile.java @@ -25,6 +25,7 @@ import tim.prune.config.Config; import tim.prune.data.SourceInfo; import tim.prune.data.SourceInfo.FILE_TYPE; import tim.prune.gui.GuiGridLayout; +import tim.prune.load.babel.BabelFilterPanel; /** @@ -40,7 +41,7 @@ public class BabelLoadFromFile extends BabelLoader // Label for filename private JLabel _inputFileLabel = null; // Dropdown for format of file - private JComboBox _formatDropdown = null; + private JComboBox _formatDropdown = null; // Last used file suffix private String _lastSuffix = null; @@ -132,7 +133,7 @@ public class BabelLoadFromFile extends BabelLoader grid.add(_inputFileLabel); JLabel formatLabel = new JLabel(I18nManager.getText("dialog.gpsload.format")); grid.add(formatLabel); - _formatDropdown = new JComboBox(BabelFileFormats.getDescriptions()); + _formatDropdown = new JComboBox(BabelFileFormats.getDescriptions()); grid.add(_formatDropdown); gridPanel.setAlignmentX(Component.CENTER_ALIGNMENT); gridPanel.setBorder(BorderFactory.createEmptyBorder(10, 5, 5, 20)); @@ -158,6 +159,15 @@ public class BabelLoadFromFile extends BabelLoader _saveCheckbox.setAlignmentX(Component.CENTER_ALIGNMENT); mainPanel.add(_saveCheckbox); + // Filter panel + _filterPanel = new BabelFilterPanel(_parentFrame); + // Give filter panel the contents of the config + String filter = Config.getConfigString(Config.KEY_GPSBABEL_FILTER); + if (filter != null) { + _filterPanel.setFilterString(filter); + } + mainPanel.add(_filterPanel); + // progress bar (initially invisible) _progressBar = new JProgressBar(0, 10); mainPanel.add(_progressBar); @@ -216,6 +226,8 @@ public class BabelLoadFromFile extends BabelLoader */ protected void saveConfigValues() { - // nothing needed + // Save the filter string, clear it if it's now blank + final String filter = _filterPanel.getFilterString(); + Config.setConfigString(Config.KEY_GPSBABEL_FILTER, filter); } }