Commit 37cb5ded authored by Daniel Dreibrodt's avatar Daniel Dreibrodt

Put configuration file into user directory

%AppData%/vlc/VlcSkinEditor.cfg on Windows
~/.vlc/VLCSkinEditor.cfg on all other systems (dunno if that is the best path to put it on linux? anybody knows if thats the right place to save it to?)
parent 671575bf
...@@ -38,8 +38,8 @@ import javax.swing.*; ...@@ -38,8 +38,8 @@ import javax.swing.*;
public class Config { public class Config {
private static Hashtable<String, String> strings = new Hashtable<String, String>(); private static Hashtable<String, String> strings = new Hashtable<String, String>();
private static File configFile = new File("VLCSkinEditor.cfg"); private static File configFile;
static { static {
//Default values //Default values
strings.put("autoupdate", "true"); strings.put("autoupdate", "true");
...@@ -61,6 +61,17 @@ public class Config { ...@@ -61,6 +61,17 @@ public class Config {
strings.put("win.items.width","190"); strings.put("win.items.width","190");
strings.put("win.items.height","200"); strings.put("win.items.height","200");
strings.put("swing.laf","System"); strings.put("swing.laf","System");
//Locate the config file
if(System.getProperty("os.name").indexOf("Windows")!=-1) {
File parent = new File(System.getenv("APPDATA"),"vlc");
if(!parent.exists()) parent.mkdirs();
configFile = new File(parent,"VLCSkinEditor.cfg");
} else {
File parent = new File("~/.vlc");
if(!parent.exists()) parent.mkdirs();
configFile = new File(parent,"VLCSkinEditor.cfg");
}
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment