summaryrefslogtreecommitdiffstats
path: root/Dozentenmodul/src/gui/image/FTPSearchDownloader_GUI.java
diff options
context:
space:
mode:
authorMichael Wilson2014-08-25 17:50:38 +0200
committerMichael Wilson2014-08-25 17:50:38 +0200
commit7c08e2fb5958666edabdd46ea5665be04577fe6d (patch)
tree365e0b859d640dd69c0ea72d9ea31bacadea45da /Dozentenmodul/src/gui/image/FTPSearchDownloader_GUI.java
parentVerhindere unerlaubtes zurückgehen auf vorige Seite während Up-DOwnloads (diff)
parentLetzter Down- und Uploadpfad werden nun in die Konfig geschrieben (diff)
downloadtutor-module-7c08e2fb5958666edabdd46ea5665be04577fe6d.tar.gz
tutor-module-7c08e2fb5958666edabdd46ea5665be04577fe6d.tar.xz
tutor-module-7c08e2fb5958666edabdd46ea5665be04577fe6d.zip
Merge branch 'master' of ssh://git.openslx.org/openslx-ng/tutor-module
Conflicts: Dozentenmodul/bin/ftp/DownloadTask.class Dozentenmodul/bin/ftp/UploadTask.class Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class Dozentenmodul/bin/gui/image/FTPEditUploader_GUI.class Dozentenmodul/bin/gui/image/SearchEditImage_GUI.class
Diffstat (limited to 'Dozentenmodul/src/gui/image/FTPSearchDownloader_GUI.java')
-rw-r--r--Dozentenmodul/src/gui/image/FTPSearchDownloader_GUI.java71
1 files changed, 66 insertions, 5 deletions
diff --git a/Dozentenmodul/src/gui/image/FTPSearchDownloader_GUI.java b/Dozentenmodul/src/gui/image/FTPSearchDownloader_GUI.java
index ce2a3f35..ad178085 100644
--- a/Dozentenmodul/src/gui/image/FTPSearchDownloader_GUI.java
+++ b/Dozentenmodul/src/gui/image/FTPSearchDownloader_GUI.java
@@ -14,6 +14,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;
@@ -39,6 +40,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;
@@ -68,6 +71,7 @@ public class FTPSearchDownloader_GUI extends JFrame implements
JLabel lblBytesread;
JLabel lblNewLabel_3;
JLabel labelVerbleibend;
+ JFileChooser fc;
long filesize;
double speed;
int progress = 0; // progress of download
@@ -148,10 +152,25 @@ public class FTPSearchDownloader_GUI extends JFrame implements
"Speicherort ausw\u00E4hlen");
btnSpeicherortAuswhlen.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
- JFileChooser fc = new JFileChooser();
- fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+ 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 = new JFileChooser(ini.get("main", "Letzter Downloadpfad", String.class));
+ fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+
+ fc.showOpenDialog(getParent());
+ } catch (InvalidFileFormatException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ } catch (IOException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
- fc.showOpenDialog(getParent());
File dir = fc.getSelectedFile();
// check if directory is selected
if (dir != null) {
@@ -170,6 +189,20 @@ public class FTPSearchDownloader_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()) {
@@ -416,7 +449,21 @@ public class FTPSearchDownloader_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();
+ }
SearchImage_GUI se = new SearchImage_GUI();
se.setVisible(true);
dispose();
@@ -428,7 +475,21 @@ public class FTPSearchDownloader_GUI extends JFrame implements
btnMainMenu.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
-
+ 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();
+ }
MainMenue_GUI mm = new MainMenue_GUI();
mm.setVisible(true);
dispose();