[Zerofile-svn] SF.net SVN: zerofile: [45] trunk/src
Status: Pre-Alpha
Brought to you by:
karl-bengtsson
|
From: <zo...@us...> - 2007-11-09 12:43:04
|
Revision: 45
http://zerofile.svn.sourceforge.net/zerofile/?rev=45&view=rev
Author: zondar
Date: 2007-11-09 04:43:02 -0800 (Fri, 09 Nov 2007)
Log Message:
-----------
added functionality to settings and settingswindow
Modified Paths:
--------------
trunk/src/ZeroFileSettings.java
trunk/src/ZeroFileSettingsWindow.java
Modified: trunk/src/ZeroFileSettings.java
===================================================================
--- trunk/src/ZeroFileSettings.java 2007-11-09 12:18:29 UTC (rev 44)
+++ trunk/src/ZeroFileSettings.java 2007-11-09 12:43:02 UTC (rev 45)
@@ -66,12 +66,39 @@
else
return "1337";
}
-
public static void setMainPort(String p)
{
_zeroFileProperties.put("Port", p);
}
+
+ public static void setCheckBox(String p)
+ {
+ _zeroFileProperties.put("CheckBox", p);
+ }
+
+ public static String getCheckBox() {
+ if (_zeroFileProperties.containsKey("CheckBox"))
+ return _zeroFileProperties.getProperty("CheckBox");
+ else
+ return "false";
+ }
+
+ public static void setDownloadFolder(String p)
+ {
+ _zeroFileProperties.put("DownloadFolder", p);
+ }
+
+ public static String getDownloadFolder() {
+ if (_zeroFileProperties.containsKey("DownloadFolder"))
+ return _zeroFileProperties.getProperty("DownloadFolder");
+ else
+ return "";
+ }
+
+
+
+
public static void saveSettings() throws IOException {
FileOutputStream appStream = new FileOutputStream("appProperties");
_zeroFileProperties.store(appStream, "settings");;
Modified: trunk/src/ZeroFileSettingsWindow.java
===================================================================
--- trunk/src/ZeroFileSettingsWindow.java 2007-11-09 12:18:29 UTC (rev 44)
+++ trunk/src/ZeroFileSettingsWindow.java 2007-11-09 12:43:02 UTC (rev 45)
@@ -56,6 +56,7 @@
//Label + browsing for chosing download folder
JLabel downloadLabel = new JLabel("Download Folder:", JLabel.CENTER);
final JLabel pathNowLabel = new JLabel("", JLabel.CENTER);
+ pathNowLabel.setText(ZeroFileSettings.getDownloadFolder());
JLabel pathLabel = new JLabel("Desired catalog:", JLabel.CENTER);
JButton browseButton = new JButton("Browse");
settingsWindowFrame.add(downloadLabel);
@@ -66,6 +67,7 @@
//Checkbox for auto accept file transfers
JLabel checkBoxLabel = new JLabel("Auto accept file transfers", JLabel.CENTER);
final JCheckBox checkBoxTransfer = new JCheckBox();
+ checkBoxTransfer.setSelected(Boolean.valueOf(ZeroFileSettings.getCheckBox()));
settingsWindowFrame.add(checkBoxLabel);
settingsWindowFrame.add(checkBoxTransfer);
@@ -93,7 +95,6 @@
okButton.addActionListener(
new ActionListener(){
public void actionPerformed(ActionEvent okb){
- //checkBoxTransfer.isSelected();
if(!nickNameField.getText().equals(""))
ZeroFileSettings.setNickName(nickNameField.getText());
if(!firstNameField.getText().equals(""))
@@ -104,6 +105,9 @@
ZeroFileSettings.setEmail(emailField.getText());
if(!portField.getText().equals(""))
ZeroFileSettings.setMainPort(portField.getText());
+ if(!pathNowLabel.getText().equals(""))
+ ZeroFileSettings.setDownloadFolder(pathNowLabel.getText());
+ ZeroFileSettings.setCheckBox(String.valueOf(checkBoxTransfer.isSelected()));
try {
ZeroFileSettings.saveSettings();
} catch (IOException e) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|