Index: /applications/editors/josm/plugins/globalsat/src/org/kaintoch/gps/globalsat/dg100/Dg100Config.java
===================================================================
--- /applications/editors/josm/plugins/globalsat/src/org/kaintoch/gps/globalsat/dg100/Dg100Config.java	(revision 11554)
+++ /applications/editors/josm/plugins/globalsat/src/org/kaintoch/gps/globalsat/dg100/Dg100Config.java	(revision 11555)
@@ -156,7 +156,7 @@
 	 * @return Returns the disableLogDist.
 	 */
-	public byte getDisableLogDist()
-	{
-		return disableLogDist;
+	public boolean getDisableLogDist()
+	{
+		return disableLogDist != 0;
 	}
 
@@ -164,7 +164,7 @@
 	 * @param disableLogDist The disableLogDist to set.
 	 */
-	public void setDisableLogDist(byte disableLogDist)
-	{
-		this.disableLogDist = disableLogDist;
+	public void setDisableLogDist(boolean disableLogDist)
+	{
+            this.disableLogDist = (byte)(disableLogDist ? 1 : 0);
 	}
 
@@ -172,7 +172,7 @@
 	 * @return Returns the disableLogSpeed.
 	 */
-	public byte getDisableLogSpeed()
-	{
-		return disableLogSpeed;
+	public boolean getDisableLogSpeed()
+	{
+		return disableLogSpeed != 0;
 	}
 
@@ -180,7 +180,7 @@
 	 * @param disableLogSpeed The disableLogSpeed to set.
 	 */
-	public void setDisableLogSpeed(byte disableLogSpeed)
-	{
-		this.disableLogSpeed = disableLogSpeed;
+	public void setDisableLogSpeed(boolean disableLogSpeed)
+	{
+            this.disableLogSpeed = (byte)(disableLogSpeed ? 1 : 0);
 	}
 
Index: /applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatConfigDialog.java
===================================================================
--- /applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatConfigDialog.java	(revision 11555)
+++ /applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatConfigDialog.java	(revision 11555)
@@ -0,0 +1,382 @@
+// License: GPL v2 or later (v3 preferred). Copyright 2008 by Raphael Mack
+
+//TODO: check input for numbers in text fields
+package org.openstreetmap.josm.plugins.globalsat;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.LinkedList;
+import java.util.Enumeration;
+
+import javax.swing.ButtonGroup;
+import javax.swing.JCheckBox;
+import javax.swing.JTextField;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JButton;
+import javax.swing.JTabbedPane;
+import javax.swing.JComboBox;
+import javax.swing.ListCellRenderer;
+import javax.swing.BoxLayout;
+
+
+import gnu.io.*;
+
+import org.kaintoch.gps.globalsat.dg100.Dg100Config;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.DownloadAction;
+import org.openstreetmap.josm.actions.downloadtasks.DownloadGpsTask;
+import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask;
+import org.openstreetmap.josm.gui.MapView;
+import org.openstreetmap.josm.plugins.PluginProxy;
+import org.openstreetmap.josm.tools.GBC;
+import org.openstreetmap.josm.data.gpx.GpxData;
+import org.openstreetmap.josm.data.gpx.GpxTrack;
+import org.openstreetmap.josm.data.gpx.WayPoint;
+
+
+/**
+ * Configuration download dialog.
+ * 
+ * @author Raphael Mack <ramack@raphael-mack.de>
+ *
+ */
+public class GlobalsatConfigDialog extends JPanel {
+
+
+    public class IntegerTextField extends JTextField {
+        
+        final static String badchars = "-`~!@#$%^&*()_+=\\|\"':;?/>.<, ";
+        
+        public void processKeyEvent(KeyEvent ev) {
+
+            char c = ev.getKeyChar();
+            if((Character.isLetter(c) && !ev.isAltDown()) 
+               || badchars.indexOf(c) > -1) {
+                ev.consume();
+                return;
+            }
+            super.processKeyEvent(ev);
+        }
+    }
+
+
+	
+    // the JOptionPane that contains this dialog. required for the closeDialog() method.
+    private JOptionPane optionPane;
+    private JCheckBox delete;
+    private JComboBox portCombo;
+    private JRadioButton formatPosOnly = new JRadioButton(tr("Position only"));
+    private JRadioButton formatPosTDS = new JRadioButton(tr("Position, Time, Date, Speed"));
+    private JRadioButton formatPosTDSA = new JRadioButton(tr("Position, Time, Date, Speed, Altitude"));
+
+    private JRadioButton aTime = new JRadioButton(tr("A By Time"));
+    private JRadioButton aDist = new JRadioButton(tr("A By Distance"));
+    private JRadioButton bTime = new JRadioButton(tr("B By Time"));
+    private JRadioButton bDist = new JRadioButton(tr("B By Distance"));
+    private JRadioButton cTime = new JRadioButton(tr("C By Time"));
+    private JRadioButton cDist = new JRadioButton(tr("C By Distance"));
+
+    private JTextField aSeconds = new IntegerTextField();
+    private JTextField aMeters = new IntegerTextField();
+    private JTextField bSeconds = new IntegerTextField();
+    private JTextField bMeters = new IntegerTextField();
+    private JTextField cSeconds = new IntegerTextField();
+    private JTextField cMeters = new IntegerTextField();
+
+    private JLabel memUsage = new JLabel();
+
+    private JCheckBox disableLogDist, disableLogSpeed;
+    private JTextField minLogDist, minLogSpeed;
+
+    private List<CommPortIdentifier> ports = new LinkedList<CommPortIdentifier>();
+    
+    private Dg100Config conf;
+
+
+    public GlobalsatConfigDialog(Dg100Config config) {
+        conf = config;
+        GridBagConstraints c = new GridBagConstraints();
+        System.out.println("read config " + config);
+
+        Dimension xx = aSeconds.getPreferredSize();
+        aSeconds.setPreferredSize(new Dimension((int)xx.getWidth() + 50, (int)xx.getHeight()));
+        aSeconds.setHorizontalAlignment(JTextField.RIGHT);
+        aMeters.setPreferredSize(new Dimension((int)xx.getWidth() + 50, (int)xx.getHeight()));
+        aMeters.setHorizontalAlignment(JTextField.RIGHT);
+        bSeconds.setPreferredSize(new Dimension((int)xx.getWidth() + 50, (int)xx.getHeight()));
+        bSeconds.setHorizontalAlignment(JTextField.RIGHT);
+        bMeters.setPreferredSize(new Dimension((int)xx.getWidth() + 50, (int)xx.getHeight()));
+        bMeters.setHorizontalAlignment(JTextField.RIGHT);
+        cSeconds.setPreferredSize(new Dimension((int)xx.getWidth() + 50, (int)xx.getHeight()));
+        cSeconds.setHorizontalAlignment(JTextField.RIGHT);
+        cMeters.setPreferredSize(new Dimension((int)xx.getWidth() + 50, (int)xx.getHeight()));
+        cMeters.setHorizontalAlignment(JTextField.RIGHT);
+
+        setLayout(new GridBagLayout());
+
+        ButtonGroup logFormat = new ButtonGroup();
+        logFormat.add(formatPosOnly);
+        logFormat.add(formatPosTDS);
+        logFormat.add(formatPosTDSA);
+        
+        JPanel logPanel = new JPanel();
+        logPanel.setLayout(new BoxLayout(logPanel, BoxLayout.PAGE_AXIS));
+        logPanel.add(new JLabel(tr("Data Logging Format")));
+        logPanel.add(formatPosOnly);
+        logPanel.add(formatPosTDS);
+        logPanel.add(formatPosTDSA);
+
+        c.insets = new Insets(4,4,0,4);
+        c.gridwidth = 1;
+        c.weightx = 1.8;
+        c.fill = GridBagConstraints.HORIZONTAL;
+        c.gridx = 0;
+        c.gridy = 0;
+        c.gridwidth = 1;
+        add(logPanel);
+
+        disableLogSpeed = new JCheckBox(tr("Disable data logging if speed falls below"));
+        c.insets = new Insets(4,4,0,4);
+        c.gridwidth = 1;
+        c.weightx = 0.8;
+        c.fill = GridBagConstraints.HORIZONTAL;
+        c.gridx = 0;
+        c.gridwidth = 1;
+        c.gridy = 1;
+        add(disableLogSpeed, c);
+
+        minLogSpeed = new IntegerTextField();
+        minLogSpeed.setHorizontalAlignment(JTextField.RIGHT);
+        c.insets = new Insets(4,4,0,4);
+        c.gridwidth = 1;
+        c.weightx = 1.5;
+        c.fill = GridBagConstraints.HORIZONTAL;
+        c.gridx = 1;
+        c.gridy = 1;
+        add(minLogSpeed, c);
+
+        disableLogSpeed.addActionListener(new ActionListener(){
+                public void actionPerformed(java.awt.event.ActionEvent e){
+                    minLogSpeed.setEnabled(disableLogSpeed.isSelected());
+                }
+            });
+
+        disableLogDist = new JCheckBox(tr("Disable data logging if distance falls below"));
+        c.insets = new Insets(0,4,4,4);
+        c.gridwidth = 1;
+        c.weightx = 0.8;
+        c.fill = GridBagConstraints.HORIZONTAL;
+        c.gridx = 0;
+        c.gridy = 2;
+        add(disableLogDist, c);
+
+        minLogDist = new IntegerTextField();
+        minLogDist.setHorizontalAlignment(JTextField.RIGHT);
+        c.insets = new Insets(0,4,4,4);
+        c.gridwidth = 1;
+        c.weightx = 1.5;
+        c.fill = GridBagConstraints.HORIZONTAL;
+        c.gridx = 1;
+        c.gridy = 2;
+        add(minLogDist, c);
+        Dimension x = minLogDist.getPreferredSize();
+        minLogDist.setPreferredSize(new Dimension((int)x.getWidth() + 50, (int)x.getHeight()));
+
+        disableLogDist.addActionListener(new ActionListener(){
+                public void actionPerformed(java.awt.event.ActionEvent e){
+                    minLogDist.setEnabled(disableLogDist.isSelected());
+                }
+            });
+
+        disableLogDist.setSelected(conf.getDisableLogDist());
+        disableLogSpeed.setSelected(conf.getDisableLogSpeed());
+        minLogDist.setEnabled(disableLogDist.isSelected());
+        minLogSpeed.setEnabled(disableLogSpeed.isSelected());
+
+        minLogSpeed.setText("" + conf.getSpeedThres());
+        minLogDist.setText("" + conf.getDistThres());
+        
+        ButtonGroup group = new ButtonGroup();
+        group.add(aTime);
+        group.add(aDist);
+
+        c.insets = new Insets(4,4,0,4);
+        c.gridwidth = 1;
+        c.weightx = 1;
+        c.fill = GridBagConstraints.HORIZONTAL;
+        c.gridx = 0;
+        c.gridy = 3;
+        add(aTime, c);
+        c.insets = new Insets(0,4,4,4);
+        c.gridy = 4;
+        add(aDist, c);
+
+        c.insets = new Insets(4,4,0,4);
+        c.gridwidth = 1;
+        c.weightx = 1;
+        c.fill = GridBagConstraints.HORIZONTAL;
+        c.gridx = 1;
+        c.gridy = 3;
+        add(aSeconds, c);
+        c.insets = new Insets(0,4,4,4);
+        c.gridy = 4;
+        add(aMeters, c);
+
+        group = new ButtonGroup();
+        group.add(bTime);
+        group.add(bDist);
+
+        c.insets = new Insets(4,4,0,4);
+        c.gridwidth = 1;
+        c.weightx = 1;
+        c.fill = GridBagConstraints.HORIZONTAL;
+        c.gridx = 0;
+        c.gridy = 5;
+        add(bTime, c);
+        c.insets = new Insets(0,4,4,4);
+        c.gridy = 6;
+        add(bDist, c);
+
+        c.insets = new Insets(4,4,0,4);
+        c.gridwidth = 1;
+        c.weightx = 1;
+        c.fill = GridBagConstraints.HORIZONTAL;
+        c.gridx = 1;
+        c.gridy = 5;
+        add(bSeconds, c);
+        c.insets = new Insets(0,4,4,4);
+        c.gridy = 6;
+        add(bMeters, c);
+        
+        group = new ButtonGroup();
+        group.add(cTime);
+        group.add(cDist);
+        
+        c.insets = new Insets(4,4,0,4);
+        c.gridwidth = 1;
+        c.weightx = 1;
+        c.fill = GridBagConstraints.HORIZONTAL;
+        c.gridx = 0;
+        c.gridy = 7;
+        add(cTime, c);
+        c.insets = new Insets(0,4,4,4);
+        c.gridy = 8;
+        add(cDist, c);
+
+        c.insets = new Insets(4,4,0,4);
+        c.gridwidth = 1;
+        c.weightx = 1;
+        c.fill = GridBagConstraints.HORIZONTAL;
+        c.gridx = 1;
+        c.gridy = 7;
+        add(cSeconds, c);
+        c.insets = new Insets(0,4,4,4);
+        c.gridy = 8;
+        add(cMeters, c);
+
+        //        add(new JLabel(tr("Memory Usage:")));
+        //        add(memUsage);
+        //add ID textbox
+
+
+
+        switch(conf.getLogFormat()){
+        case 0:
+            formatPosOnly.setSelected(true);
+            break;
+        case 1:
+            formatPosTDS.setSelected(true);
+            break;
+        case 2:
+            formatPosTDSA.setSelected(true);
+            break;
+        default:
+            JOptionPane.showMessageDialog(Main.parent, tr("Unknown logFormat"));
+        }
+            
+        if(conf.getSwATimeOrDist() == 0){
+            aTime.setSelected(true);
+            aDist.setSelected(false);
+        }else{
+            aTime.setSelected(false);
+            aDist.setSelected(true);
+        }
+
+        if(conf.getSwBTimeOrDist() == 0){
+            bTime.setSelected(true);
+            bDist.setSelected(false);
+        }else{
+            bTime.setSelected(false);
+            bDist.setSelected(true);
+        }
+
+        if(conf.getSwCTimeOrDist() == 0){
+            cTime.setSelected(true);
+            cDist.setSelected(false);
+        }else{
+            cTime.setSelected(false);
+            cDist.setSelected(true);
+        }
+
+        aSeconds.setText("" + conf.getSwATime() / 1000);
+        aMeters.setText("" + conf.getSwADist());
+
+        bSeconds.setText("" + conf.getSwBTime() / 1000);
+        bMeters.setText("" + conf.getSwBDist());
+
+        cSeconds.setText("" + conf.getSwCTime() / 1000);
+        cMeters.setText("" + conf.getSwCDist());
+
+    }
+
+    /**
+     * Has to be called after this dialog has been added to a JOptionPane.
+     * @param optionPane
+     */
+    public void setOptionPane(JOptionPane optionPane) {
+        this.optionPane = optionPane;
+    }
+
+    /**
+     * Get the selected configuration.
+     */
+    public Dg100Config getConfig(){
+        conf.setDisableLogDist(disableLogDist.isSelected());
+        conf.setDisableLogSpeed(disableLogSpeed.isSelected());
+        conf.setDistThres(Integer.parseInt(minLogDist.getText()));
+        conf.setSpeedThres(Integer.parseInt(minLogSpeed.getText()));
+
+        if(formatPosOnly.isSelected()){
+            conf.setLogFormat((byte)0);
+        }else if(formatPosTDS.isSelected()){
+            conf.setLogFormat((byte)1);
+        }else if(formatPosTDSA.isSelected()){
+            conf.setLogFormat((byte)2);
+        }
+
+        conf.setSwATimeOrDist((byte)(aDist.isSelected() ? 1 : 0));
+        conf.setSwBTimeOrDist((byte)(bDist.isSelected() ? 1 : 0));
+        conf.setSwCTimeOrDist((byte)(cDist.isSelected() ? 1 : 0));
+
+        conf.setSwATime(Integer.parseInt(aSeconds.getText()) * 1000);
+        conf.setSwADist(Integer.parseInt(aMeters.getText()));
+        conf.setSwBTime(Integer.parseInt(bSeconds.getText()) * 1000);
+        conf.setSwBDist(Integer.parseInt(bMeters.getText()));
+        conf.setSwCTime(Integer.parseInt(cSeconds.getText()) * 1000);
+        conf.setSwCDist(Integer.parseInt(cMeters.getText()));
+        return conf;
+    }
+}
Index: /applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatDg100.java
===================================================================
--- /applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatDg100.java	(revision 11554)
+++ /applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatDg100.java	(revision 11555)
@@ -18,4 +18,5 @@
 
 import org.kaintoch.gps.globalsat.dg100.Response;
+import org.kaintoch.gps.globalsat.dg100.Dg100Config;
 import org.kaintoch.gps.globalsat.dg100.FileInfoRec;
 import org.kaintoch.gps.globalsat.dg100.GpsRec;
@@ -124,4 +125,5 @@
     public void cancel(){
         cancelled = true;
+        disconnect();
     }
 
@@ -258,4 +260,45 @@
         int len = sendCmd(src, response, -1);
         return Response.parseResponse(response, len);
+    }
+
+    private Response sendCmdGetConfig() throws IOException, UnsupportedCommOperationException
+    {
+        byte[] src = dg100CmdGetConfig;
+        int len = sendCmd(src, response, -1);
+        return Response.parseResponse(response, len);
+    }
+
+    public Dg100Config getConfig() throws ConnectionException{
+        try{
+            if(port == null){
+                connect();
+            }
+            Response response = sendCmdGetConfig();
+            return response.getConfig();
+        }catch(Exception e){
+            throw new ConnectionException(e);
+        }
+    }
+
+
+    private void sendCmdSetConfig(Dg100Config config) throws IOException, UnsupportedCommOperationException
+    {
+        byte[] src = dg100CmdSetConfig;
+        ByteBuffer buf = ByteBuffer.wrap(src);
+        if (config != null){
+            config.write(buf);
+        }
+        updateCheckSum(buf);
+        int len = sendCmd(src, response, -1);
+
+        Response.parseResponse(response, len);
+    }
+
+    public void setConfig(Dg100Config conf) throws ConnectionException{
+        try{
+            sendCmdSetConfig(conf);
+        }catch(Exception e){
+            throw new ConnectionException(e);
+        }
     }
 
Index: /applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatImportDialog.java
===================================================================
--- /applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatImportDialog.java	(revision 11554)
+++ /applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatImportDialog.java	(revision 11555)
@@ -22,4 +22,5 @@
 import javax.swing.JComboBox;
 import javax.swing.ListCellRenderer;
+import javax.swing.JDialog;
 
 import gnu.io.*;
@@ -70,4 +71,5 @@
                     Object i = portCombo.getSelectedItem();
                     if(i instanceof CommPortIdentifier){
+                        GlobalsatPlugin.setPortIdent((CommPortIdentifier)i);
                         Main.pref.put("globalsat.portIdentifier", ((CommPortIdentifier)i).getName());
                     }
@@ -108,4 +110,20 @@
                 public void actionPerformed(java.awt.event.ActionEvent e){
                     System.out.println("configureing the device");
+                    try{
+                        
+                        GlobalsatConfigDialog dialog = new GlobalsatConfigDialog(GlobalsatPlugin.dg100().getConfig());
+                        JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
+                        JDialog dlg = pane.createDialog(Main.parent, tr("Configure Device"));
+                        dialog.setOptionPane(pane);
+                        dlg.setVisible(true);
+                        if(((Integer)pane.getValue()) == JOptionPane.OK_OPTION){
+                            GlobalsatPlugin.dg100().setConfig(dialog.getConfig());
+                        }
+                        dlg.dispose();
+
+                    }catch(GlobalsatDg100.ConnectionException ex){
+                        JOptionPane.showMessageDialog(Main.parent, tr("Connection Error.") + " " + ex.toString());
+                    }
+                    System.out.println("configureing the device finised");
                 }
             });
@@ -116,5 +134,5 @@
         c.gridx = 2;
         c.gridy = 1;
-        //        add(configBtn, c);
+        add(configBtn, c);
 
         
@@ -141,8 +159,11 @@
                 if(sel != null && port.getName() == sel){
                     portCombo.setSelectedItem(port);
+                    GlobalsatPlugin.setPortIdent(port);
                 }
             }
         }
         portCombo.setVisible(true);
+        GlobalsatPlugin.setPortIdent(getPort());
+
     }
 	
Index: /applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatPlugin.java
===================================================================
--- /applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatPlugin.java	(revision 11554)
+++ /applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatPlugin.java	(revision 11555)
@@ -27,14 +27,23 @@
 
 public class GlobalsatPlugin extends Plugin {
+    private static GlobalsatDg100 device = null;
+    public static GlobalsatDg100 dg100(){
+        return device;
+    }
+
+    public static void setPortIdent(CommPortIdentifier port){
+        if(device != null){
+            device.disconnect();
+        }
+        device = new GlobalsatDg100(port);
+    }
 
     private static class ImportTask extends PleaseWaitRunnable {
         public GpxData data;
-        private GlobalsatDg100 dg100;
         public Exception eee;
         private boolean deleteAfter;
 
-        public ImportTask(GlobalsatDg100 dg100, boolean delete){
+        public ImportTask(boolean delete){
             super(tr("Importing data from device."));
-            this.dg100 = dg100;
             deleteAfter = delete;
         }
@@ -44,5 +53,5 @@
             Main.pleaseWaitDlg.currentAction.setText(tr("Importing data from DG100..."));
             try{
-                data = dg100.readData();
+                data = GlobalsatPlugin.dg100().readData();
             }catch(Exception e){
                 eee = e;
@@ -51,8 +60,8 @@
 
         @Override protected void finish() {
-            if(deleteAfter && dg100.isCancelled() == false){
+            if(deleteAfter && GlobalsatPlugin.dg100().isCancelled() == false){
                 Main.pref.put("globalsat.deleteAfterDownload", true);
                 try{
-                    dg100.deleteData();
+                    GlobalsatPlugin.dg100().deleteData();
                 }catch(Exception ex){
                     JOptionPane.showMessageDialog(Main.parent, tr("Error deleting data.") + " " + ex.toString());
@@ -72,10 +81,10 @@
                 JOptionPane.showMessageDialog(Main.parent, tr("Connection failed.") + " (" + eee.toString() + ")");
             }
-            dg100.disconnect();
+            GlobalsatPlugin.dg100().disconnect();
         }
 
         @Override protected void cancel() {
-            dg100.cancel();
-            dg100.disconnect();
+            GlobalsatPlugin.dg100().cancel();
+            GlobalsatPlugin.dg100().disconnect();
         }
     }
@@ -108,6 +117,6 @@
             dlg.setVisible(true);
             if(((Integer)pane.getValue()) == JOptionPane.OK_OPTION){
-                GlobalsatDg100 dg100 = new GlobalsatDg100(dialog.getPort());
-                ImportTask task = new ImportTask(dg100, dialog.deleteFilesAfterDownload());
+                setPortIdent(dialog.getPort());
+                ImportTask task = new ImportTask(dialog.deleteFilesAfterDownload());
                 Main.worker.execute(task);
             }
