summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Spitzer2014-08-25 14:32:25 +0200
committerTobias Spitzer2014-08-25 14:32:25 +0200
commitcfce5baa25dcd864f8d4c2b44d5d0102a39e1570 (patch)
tree7ff0c8341d5e6101d8af700a670e119dbd68f974
parentKonfigdatei wird beim ändern des Logins zurückgesetzt (diff)
downloadtutor-module-cfce5baa25dcd864f8d4c2b44d5d0102a39e1570.tar.gz
tutor-module-cfce5baa25dcd864f8d4c2b44d5d0102a39e1570.tar.xz
tutor-module-cfce5baa25dcd864f8d4c2b44d5d0102a39e1570.zip
Uploadpfad speichern
-rw-r--r--Dozentenmodul/bin/config/config_file.classbin1812 -> 1926 bytes
-rw-r--r--Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.classbin13712 -> 14418 bytes
-rw-r--r--Dozentenmodul/src/config/config_file.java4
-rw-r--r--Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java36
-rw-r--r--Dozentenmodul/src/gui/image/FTPEditDownloader_GUI.java48
5 files changed, 85 insertions, 3 deletions
diff --git a/Dozentenmodul/bin/config/config_file.class b/Dozentenmodul/bin/config/config_file.class
index 07f04540..b84df019 100644
--- a/Dozentenmodul/bin/config/config_file.class
+++ b/Dozentenmodul/bin/config/config_file.class
Binary files differ
diff --git a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class
index b34abb62..1eddd68d 100644
--- a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class
+++ b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class
Binary files differ
diff --git a/Dozentenmodul/src/config/config_file.java b/Dozentenmodul/src/config/config_file.java
index e8746a1f..7b9f8649 100644
--- a/Dozentenmodul/src/config/config_file.java
+++ b/Dozentenmodul/src/config/config_file.java
@@ -35,6 +35,8 @@ public class config_file {
ini.put("main", "vmware", false);
ini.put("main", "Benutzername speichern", false);
ini.put("main", "Benutzername", "");
+ ini.put("main", "Letzter Downloadpfad", "");
+ ini.put("main", "Letzter Uploadpfad", "");
ini.store();
return true;
@@ -57,6 +59,8 @@ public class config_file {
ini.put("main", "vmware", false);
ini.put("main", "Benutzername speichern", false);
ini.put("main", "Benutzername", "");
+ ini.put("main", "Letzter Downloadpfad", "");
+ ini.put("main", "Letzter Uploadpfad", "");
ini.store();
return true;
diff --git a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java
index ba442928..0f480d79 100644
--- a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java
+++ b/Dozentenmodul/src/gui/image/FTPCreateUploader_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;
import java.text.DateFormat;
@@ -43,6 +44,8 @@ import models.SessionData;
import models.person;
import org.apache.thrift.TException;
+import org.ini4j.InvalidFileFormatException;
+import org.ini4j.Wini;
import server.Server.Client;
import thrift.ThriftConnection;
@@ -177,11 +180,25 @@ public class FTPCreateUploader_GUI extends JFrame implements
btnSpeicherortAuswhlen.setVerticalAlignment(SwingConstants.TOP);
contentPanel.add(btnSpeicherortAuswhlen);
}
-
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 Uploadpfad",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()) {
+ if (lblPath.getText()==null) {
// wenn leer, dann upload button nicht freigeben
btnUploadStarten.setEnabled(false);
btnUploadStarten.setText("Bitte warten");
@@ -333,6 +350,21 @@ public class FTPCreateUploader_GUI extends JFrame implements
finishButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
writeData();
+ try {
+ Wini ini = new Wini(
+ new File(
+ "C:\\Users\\"
+ + System.getProperty("user.name")
+ + "\\AppData\\Roaming\\bwLehrpoolSuite\\config.ini"));
+ ini.put("main", "Letzter Uploadpfad", lblPath.getText().substring(0, lblPath.getText().lastIndexOf("\\")));
+ ini.store();
+ } catch (InvalidFileFormatException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ } catch (IOException e2) {
+ // TODO Auto-generated catch block
+ e2.printStackTrace();
+ }
dispose();
MainMenue_GUI m = new MainMenue_GUI();
m.setVisible(true);
diff --git a/Dozentenmodul/src/gui/image/FTPEditDownloader_GUI.java b/Dozentenmodul/src/gui/image/FTPEditDownloader_GUI.java
index e03d07a3..1a4b387e 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;
@@ -151,6 +154,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) {
@@ -169,6 +187,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()) {
@@ -414,7 +446,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();