diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/HgGlobalSettings.java b/plugins/hg4idea/src/org/zmlx/hg4idea/HgGlobalSettings.java index ff8c3742c436..a80870709925 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/HgGlobalSettings.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/HgGlobalSettings.java @@ -12,10 +12,7 @@ // limitations under the License. package org.zmlx.hg4idea; -import com.intellij.openapi.components.PersistentStateComponent; -import com.intellij.openapi.components.State; -import com.intellij.openapi.components.Storage; -import com.intellij.openapi.components.StoragePathMacros; +import com.intellij.openapi.components.*; import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.text.StringUtil; import com.intellij.util.containers.HashMap; @@ -28,10 +25,13 @@ import java.util.Map; @State( name = "HgGlobalSettings", - storages = @Storage(file = StoragePathMacros.APP_CONFIG + "/vcs.xml") + storages = { + @Storage(file = StoragePathMacros.APP_CONFIG + "/vcs.xml"), + @Storage(file = StoragePathMacros.APP_CONFIG + "/hg.xml", roamingType = RoamingType.PER_PLATFORM) + }, + storageChooser = LastStorageChooserForWrite.class ) public class HgGlobalSettings implements PersistentStateComponent { - @NonNls private static final String[] DEFAULT_WINDOWS_PATHS = {"C:\\Program Files\\Mercurial", "C:\\Program Files (x86)\\Mercurial", "C:\\cygwin\\bin"}; @@ -53,10 +53,12 @@ public class HgGlobalSettings implements PersistentStateComponent myRememberedUserNames = new HashMap(); } + @Override public State getState() { return myState; } + @Override public void loadState(State state) { myState = state; }