2
0
Nicolas Cannasse 1 жил өмнө
parent
commit
18daa4fdd9

+ 2 - 2
hide/Config.hx

@@ -135,7 +135,7 @@ class Config {
 		return config;
 	}
 
-	public static function loadForProject( projectPath : String, resourcePath : String ) {
+	public static function loadForProject( projectPath : String, resourcePath : String, appDataPath : String ) {
 		var hidePath = Ide.inst.appPath;
 
 		var defaults = new Config();
@@ -161,7 +161,7 @@ class Config {
 
 		var perProject = loadConfig(new Config(userGlobals), resourcePath + "/props.json");
 
-		var projectUserCustom = loadConfig(new Config(perProject), nw.App.dataPath + "/" + projectPath.split("\\").join("/").split("/").join("_").split(":").join("_") + ".json");
+		var projectUserCustom = loadConfig(new Config(perProject), appDataPath + "/" + projectPath.split("\\").join("/").split("/").join("_").split(":").join("_") + ".json");
 		var p = projectUserCustom;
 		if( p.source.hide == null )
 			p.source.hide = ({ layouts : [], renderer : null, dbCategories: null, dbProofread: null } : HideProjectConfig);

+ 4 - 0
hide/Ide.hx

@@ -59,6 +59,10 @@ class Ide extends hide.tools.IdeData {
 		return js.Browser.window.localStorage;
 	}
 
+	override function getAppDataPath() {
+		return nw.App.dataPath;
+	}
+
 	function initPad() {
 		gamePad = hxd.Pad.createDummy();
 		hxd.Pad.wait((p) -> gamePad = p);

+ 6 - 2
hide/tools/IdeData.hx

@@ -35,8 +35,12 @@ class IdeData {
 	function get_projectDir() return ideConfig.currentProject.split("\\").join("/");
 	function get_resourceDir() return projectDir+"/res";
 
+	function getAppDataPath() {
+		return ".";
+	}
+
 	function initConfig( cwd : String ) {
-		config = Config.loadForProject(cwd, cwd+"/res");
+		config = Config.loadForProject(cwd, cwd+"/res", getAppDataPath());
 		fileWatcher = new hide.tools.FileWatcher();
 	}
 
@@ -50,7 +54,7 @@ class IdeData {
 			if( ideConfig.recentProjects.length > 10 ) ideConfig.recentProjects.pop();
 			config.global.save();
 		}
-		config = Config.loadForProject(projectDir, resourceDir);
+		config = Config.loadForProject(projectDir, resourceDir, getAppDataPath());
 		databaseFile = config.project.get("cdb.databaseFile");
 		databaseDiff = config.user.get("cdb.databaseDiff");
 

+ 1 - 1
hide/ui/View.hx

@@ -79,6 +79,7 @@ class View<T> extends hide.comp.Component {
 		return Type.getClassName(Type.getClass(this));
 	}
 
+	#if !hl
 	public function setClipboard( v : Dynamic, ?type : String, ?opts : {} ) {
 		nw.Clipboard.get().set(ide.toJSON({ type : type == null ? viewClass : type, value : v, opts : opts }));
 	}
@@ -96,7 +97,6 @@ class View<T> extends hide.comp.Component {
 		return v == null || v.type != type ? null : v.value;
 	}
 
-	#if !hl
 	function syncTitle() {
 		container.setTitle(getTitle());
 	}