mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
Migrate application data (config, logs, backups) directory from
'$USER_HOME/.diylc' to '$USER_HOME/diylc' to avoid it being hidden on some OSs
This commit is contained in:
Binary file not shown.
@@ -3394,6 +3394,10 @@
|
|||||||
<releaseDate>2020-12-20 00:00:00.000 CET</releaseDate>
|
<releaseDate>2020-12-20 00:00:00.000 CET</releaseDate>
|
||||||
<name></name>
|
<name></name>
|
||||||
<changes>
|
<changes>
|
||||||
|
<org.diylc.appframework.update.Change>
|
||||||
|
<changeType>IMPROVEMENT</changeType>
|
||||||
|
<description>Migrate application data (config, logs, backups) directory from '$USER_HOME/.diylc' to '$USER_HOME/diylc' to avoid it being hidden on some OSs</description>
|
||||||
|
</org.diylc.appframework.update.Change>
|
||||||
<org.diylc.appframework.update.Change>
|
<org.diylc.appframework.update.Change>
|
||||||
<changeType>BUG_FIX</changeType>
|
<changeType>BUG_FIX</changeType>
|
||||||
<description>macOS: splash screen hangs for several minutes on some machines</description>
|
<description>macOS: splash screen hangs for several minutes on some machines</description>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -10,7 +10,7 @@
|
|||||||
<property name="jar.dir" value="${build.dir}/jar" />
|
<property name="jar.dir" value="${build.dir}/jar" />
|
||||||
<property name="report.dir" value="${build.dir}/junitreport" />
|
<property name="report.dir" value="${build.dir}/junitreport" />
|
||||||
<property name="main.class" value="org.diylc.DIYLCStarter" />
|
<property name="main.class" value="org.diylc.DIYLCStarter" />
|
||||||
<property name="diylc.version" value="4.13.0" />
|
<property name="diylc.version" value="4.14.0" />
|
||||||
|
|
||||||
<property name="osx.jre8.path" value="jre\osx\jdk8u275-b01-jre\Contents\Home\" />
|
<property name="osx.jre8.path" value="jre\osx\jdk8u275-b01-jre\Contents\Home\" />
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -18,8 +18,13 @@
|
|||||||
package org.diylc;
|
package org.diylc;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.nio.file.StandardCopyOption;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
@@ -97,11 +102,7 @@ public class DIYLCStarter {
|
|||||||
LOG.error("Could not initialize log4j configuration", e);
|
LOG.error("Could not initialize log4j configuration", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize configuration
|
initializeConfiguration();
|
||||||
ConfigurationManager configurationManager = ConfigurationManager.getInstance();
|
|
||||||
XStream xStream = configurationManager.getSerializer();
|
|
||||||
ProjectFileManager.configure(xStream);
|
|
||||||
configurationManager.initialize("diylc");
|
|
||||||
|
|
||||||
// disable HIGHLIGHT_CONTINUITY_AREA config, keep it transient
|
// disable HIGHLIGHT_CONTINUITY_AREA config, keep it transient
|
||||||
ConfigurationManager.getInstance().writeValue(IPlugInPort.HIGHLIGHT_CONTINUITY_AREA, false);
|
ConfigurationManager.getInstance().writeValue(IPlugInPort.HIGHLIGHT_CONTINUITY_AREA, false);
|
||||||
@@ -239,4 +240,24 @@ public class DIYLCStarter {
|
|||||||
+ "Replace the main 'config.xml' file with the backup when running the latest version of DIYLC."
|
+ "Replace the main 'config.xml' file with the backup when running the latest version of DIYLC."
|
||||||
+ "</html>", "Warning", IView.WARNING_MESSAGE);
|
+ "</html>", "Warning", IView.WARNING_MESSAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void initializeConfiguration() {
|
||||||
|
// migrate config file from old folder path to the new one
|
||||||
|
Path oldPath = Paths.get(Utils.getUserDataDirectory(".diylc") + "config.xml");
|
||||||
|
Path newPath = Paths.get(Utils.getUserDataDirectory("diylc") + "config.xml");
|
||||||
|
try {
|
||||||
|
if (oldPath.toFile().exists() && !newPath.toFile().exists()) {
|
||||||
|
LOG.info("Copying config file to the new directory");
|
||||||
|
Files.copy(oldPath, newPath, StandardCopyOption.REPLACE_EXISTING);
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
LOG.error("Failed to copy config file to the new directory", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
// initialize
|
||||||
|
ConfigurationManager configurationManager = ConfigurationManager.getInstance();
|
||||||
|
XStream xStream = configurationManager.getSerializer();
|
||||||
|
ProjectFileManager.configure(xStream);
|
||||||
|
configurationManager.initialize("diylc");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ log4j.rootLogger = DEBUG, fileout, stdout
|
|||||||
log4j.appender.fileout = org.diylc.appframework.miscutils.NewLogForEachRunFileAppender
|
log4j.appender.fileout = org.diylc.appframework.miscutils.NewLogForEachRunFileAppender
|
||||||
log4j.appender.fileout.layout.ConversionPattern = %d{ABSOLUTE} %5p [%t] %c{1} - %m%n
|
log4j.appender.fileout.layout.ConversionPattern = %d{ABSOLUTE} %5p [%t] %c{1} - %m%n
|
||||||
log4j.appender.fileout.layout = org.apache.log4j.PatternLayout
|
log4j.appender.fileout.layout = org.apache.log4j.PatternLayout
|
||||||
log4j.appender.fileout.File = ${user.home}/.diylc/logs/log.txt
|
log4j.appender.fileout.File = ${user.home}/diylc/logs/log.txt
|
||||||
|
|
||||||
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
|
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
|
||||||
log4j.appender.stdout.layout.ConversionPattern = %d{ABSOLUTE} %5p [%t] %c{1} - %m%n
|
log4j.appender.stdout.layout.ConversionPattern = %d{ABSOLUTE} %5p [%t] %c{1} - %m%n
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public class HelpMenuPlugin implements IPlugIn {
|
|||||||
HELP_TITLE);
|
HELP_TITLE);
|
||||||
swingUI.injectMenuAction(new NavigateURLAction("Plugin API", IconLoader.ApplicationEdit.getIcon(), PLUGIN_URL), HELP_TITLE);
|
swingUI.injectMenuAction(new NavigateURLAction("Plugin API", IconLoader.ApplicationEdit.getIcon(), PLUGIN_URL), HELP_TITLE);
|
||||||
swingUI.injectMenuAction(new NavigateURLAction("Submit a Bug", IconLoader.Bug.getIcon(), BUG_URL), HELP_TITLE);
|
swingUI.injectMenuAction(new NavigateURLAction("Submit a Bug", IconLoader.Bug.getIcon(), BUG_URL), HELP_TITLE);
|
||||||
swingUI.injectMenuAction(new NavigateFolderAction("Access User Files", IconLoader.User.getIcon(), System.getProperty("user.home") + "/.diylc"), HELP_TITLE);
|
swingUI.injectMenuAction(new NavigateFolderAction("Access User Files", IconLoader.User.getIcon(), Utils.getUserDataDirectory("diylc")), HELP_TITLE);
|
||||||
swingUI.injectMenuAction(null, HELP_TITLE);
|
swingUI.injectMenuAction(null, HELP_TITLE);
|
||||||
swingUI.injectMenuAction(new RecentUpdatesAction(), HELP_TITLE);
|
swingUI.injectMenuAction(new RecentUpdatesAction(), HELP_TITLE);
|
||||||
swingUI.injectMenuAction(null, HELP_TITLE);
|
swingUI.injectMenuAction(null, HELP_TITLE);
|
||||||
|
|||||||
Reference in New Issue
Block a user