diff options
| author | Michael Wilson | 2014-08-25 14:36:22 +0200 |
|---|---|---|
| committer | Michael Wilson | 2014-08-25 14:36:22 +0200 |
| commit | fdf1e6116b40d999da007ab002e47360c80879e4 (patch) | |
| tree | 5c7007ed23cb4a05398593c6d9068157ceaaa892 /Dozentenmodul/src/gui/image/FTPEditDownloader_GUI.java | |
| parent | falsche FTP Erfolgsmeldung entfernt (diff) | |
| parent | Merge branch 'master' of git.openslx.org:openslx-ng/tutor-module (diff) | |
| download | tutor-module-fdf1e6116b40d999da007ab002e47360c80879e4.tar.gz tutor-module-fdf1e6116b40d999da007ab002e47360c80879e4.tar.xz tutor-module-fdf1e6116b40d999da007ab002e47360c80879e4.zip | |
Merge branch 'master' of ssh://git.openslx.org/openslx-ng/tutor-module
Diffstat (limited to 'Dozentenmodul/src/gui/image/FTPEditDownloader_GUI.java')
| -rw-r--r-- | Dozentenmodul/src/gui/image/FTPEditDownloader_GUI.java | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/Dozentenmodul/src/gui/image/FTPEditDownloader_GUI.java b/Dozentenmodul/src/gui/image/FTPEditDownloader_GUI.java index a944be46..8f7bb8ce 100644 --- a/Dozentenmodul/src/gui/image/FTPEditDownloader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPEditDownloader_GUI.java @@ -15,6 +15,7 @@ import java.awt.event.WindowEvent; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.io.File; +import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; @@ -40,6 +41,8 @@ import models.Links; import models.SessionData; import org.apache.thrift.TException; +import org.ini4j.InvalidFileFormatException; +import org.ini4j.Wini; import server.Server.Client; import server.User; @@ -155,6 +158,21 @@ public class FTPEditDownloader_GUI extends JFrame implements fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); fc.showOpenDialog(getParent()); + try { + Wini ini = new Wini( + new File( + "C:\\Users\\" + + System.getProperty("user.name") + + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + System.out.println("FileChooser Pfad: "+ini.get("main", "Letzter Downloadpfad", String.class)); + fc.setCurrentDirectory(new File(ini.get("main", "Letzter Downloadpfad", String.class))); + } catch (InvalidFileFormatException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } catch (IOException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } File dir = fc.getSelectedFile(); // check if directory is selected if (dir != null) { @@ -173,6 +191,20 @@ public class FTPEditDownloader_GUI extends JFrame implements } lblPath = new JLabel(""); + try { + Wini ini = new Wini( + new File( + "C:\\Users\\" + + System.getProperty("user.name") + + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + lblPath.setText(ini.get("main", "Letzter Downloadpfad",String.class)); + } catch (InvalidFileFormatException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } catch (IOException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } lblPath.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent arg0) { if (lblPath.getText().isEmpty()) { @@ -418,7 +450,21 @@ public class FTPEditDownloader_GUI extends JFrame implements JOptionPane.ERROR_MESSAGE); } } - + try { + Wini ini = new Wini( + new File( + "C:\\Users\\" + + System.getProperty("user.name") + + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini")); + ini.put("main", "Letzter Downloadpfad", lblPath.getText()); + ini.store(); + } catch (InvalidFileFormatException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } catch (IOException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } SearchEditImage_GUI se = new SearchEditImage_GUI(); se.setVisible(true); dispose(); |
