updater: use system look&feel

This commit is contained in:
Roman Shevchenko
2014-03-04 16:49:41 +01:00
parent 76b0d68a32
commit b82ea0b8e3
2 changed files with 14 additions and 12 deletions
@@ -155,6 +155,7 @@ public class Main {
patchCopy.getPath() + File.pathSeparator + log4jCopy.getPath(),
"-Djava.io.tmpdir=" + tempDir,
"-Didea.updater.log=" + PathManager.getLogPath(),
"-Dswing.defaultlaf=" + UIManager.getSystemLookAndFeelClassName(),
"com.intellij.updater.Runner",
"install",
PathManager.getHomePath());
+13 -12
View File
@@ -66,7 +66,6 @@ public class Runner {
return logFolder;
}
// public static void initLogger(String logFolder) {
public static void initLogger() {
if (logger == null) {
String logFolder = getLogDir();
@@ -82,7 +81,6 @@ public class Runner {
updateError.setFile(new File(logFolder, "idea_updater_error.log").getAbsolutePath());
updateError.setLayout(new PatternLayout("%d{dd MMM yyyy HH:mm:ss} %-5p %C{1}.%M - %m%n"));
updateError.setThreshold(Level.ERROR);
// The error(s) from an old run of the updater (if there were) could be found in idea_updater.log file
updateError.setAppend(false);
updateError.activateOptions();
@@ -198,17 +196,20 @@ public class Runner {
in.close();
}
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
// todo[r.sh] to delete in IDEA 14 (after a full circle of platform updates)
if (System.getProperty("swing.defaultlaf") == null) {
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch (Exception ignore) {
printStackTrace(ignore);
}
}
catch (Exception ignore) {
printStackTrace(ignore);
}
}
});
});
}
new SwingUpdaterUI(props.getProperty(OLD_BUILD_DESCRIPTION),
props.getProperty(NEW_BUILD_DESCRIPTION),