diff options
Diffstat (limited to 'plugins/hg4idea/src/org/zmlx/hg4idea/ui')
-rw-r--r-- | plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgConfigurationProjectPanel.form | 44 | ||||
-rw-r--r-- | plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgConfigurationProjectPanel.java | 11 |
2 files changed, 44 insertions, 11 deletions
diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgConfigurationProjectPanel.form b/plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgConfigurationProjectPanel.form index 38dc6eb52908..cc1ea793d2c7 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgConfigurationProjectPanel.form +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgConfigurationProjectPanel.form @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.zmlx.hg4idea.ui.HgConfigurationProjectPanel"> - <grid id="27dc6" binding="myMainPanel" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> + <grid id="27dc6" binding="myMainPanel" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> <margin top="0" left="0" bottom="0" right="0"/> <constraints> - <xy x="20" y="20" width="623" height="228"/> + <xy x="20" y="20" width="623" height="299"/> </constraints> <properties/> <border type="none"/> @@ -11,7 +11,7 @@ <grid id="8c1f" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> <margin top="0" left="0" bottom="0" right="0"/> <constraints> - <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="2" indent="0" use-parent-layout="false"/> + <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="2" indent="0" use-parent-layout="false"/> </constraints> <properties/> <clientProperties> @@ -39,16 +39,43 @@ </component> </children> </grid> + <vspacer id="4088f"> + <constraints> + <grid row="3" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/> + </constraints> + </vspacer> + <grid id="c2117" binding="myRepositorySettingsPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> + <margin top="0" left="0" bottom="0" right="0"/> + <constraints> + <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="2" indent="0" use-parent-layout="false"/> + </constraints> + <properties/> + <clientProperties> + <BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/> + </clientProperties> + <border type="etched" title="Repository Settings"/> + <children> + <component id="fadf2" class="com.intellij.ui.components.JBCheckBox" binding="mySyncBranchControl"> + <constraints> + <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> + </constraints> + <properties> + <text value="Control &branches from different roots synchronously"/> + <toolTipText value="If selected, you would be able to checkout, compare, delete and create new branches in all Git roots with a single action"/> + </properties> + </component> + </children> + </grid> <grid id="4e3f3" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> <margin top="0" left="0" bottom="0" right="0"/> <constraints> - <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/> + <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/> </constraints> <properties/> <clientProperties> <BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"/> </clientProperties> - <border type="etched" title="Path to hg executable"/> + <border type="none"/> <children> <component id="83ec6" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myPathSelector" custom-create="true"> <constraints> @@ -65,7 +92,7 @@ <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> </constraints> <properties> - <text value="&Specify executable path"/> + <text value="&Path to hg executable"/> </properties> </component> <component id="61549" class="javax.swing.JButton" binding="myTestButton"> @@ -80,11 +107,6 @@ </component> </children> </grid> - <vspacer id="4088f"> - <constraints> - <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/> - </constraints> - </vspacer> </children> </grid> <buttonGroups> diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgConfigurationProjectPanel.java b/plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgConfigurationProjectPanel.java index 2aff9073d266..619536de0f88 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgConfigurationProjectPanel.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/ui/HgConfigurationProjectPanel.java @@ -12,14 +12,18 @@ // limitations under the License. package org.zmlx.hg4idea.ui; +import com.intellij.dvcs.branch.DvcsBranchSync; +import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.Messages; import com.intellij.openapi.ui.TextFieldWithBrowseButton; +import com.intellij.ui.components.JBCheckBox; import org.jetbrains.annotations.NotNull; import org.zmlx.hg4idea.HgProjectSettings; import org.zmlx.hg4idea.HgVcs; import org.zmlx.hg4idea.HgVcsMessages; +import org.zmlx.hg4idea.repo.HgRepositoryManager; import org.zmlx.hg4idea.util.HgUtil; import org.zmlx.hg4idea.util.HgVersion; @@ -36,6 +40,8 @@ public class HgConfigurationProjectPanel { private JCheckBox myIgnoredWhitespacesInAnnotationsCbx; private TextFieldWithBrowseButton myPathSelector; private JButton myTestButton; + private JBCheckBox mySyncBranchControl; + private JPanel myRepositorySettingsPanel; private final HgVcs myVcs; public HgConfigurationProjectPanel(@NotNull HgProjectSettings projectSettings, @NotNull Project project) { @@ -58,12 +64,15 @@ public class HgConfigurationProjectPanel { ); } }); + final HgRepositoryManager repositoryManager = ServiceManager.getService(project, HgRepositoryManager.class); + myRepositorySettingsPanel.setVisible(repositoryManager != null && repositoryManager.moreThanOneRoot()); } public boolean isModified() { boolean executableModified = !getCurrentPath().equals(myProjectSettings.getHgExecutable()); return executableModified || myCheckIncomingOutgoingCbx.isSelected() != myProjectSettings.isCheckIncomingOutgoing() || + ((myProjectSettings.getSyncSetting() == DvcsBranchSync.SYNC) != mySyncBranchControl.isSelected()) || myIgnoredWhitespacesInAnnotationsCbx.isSelected() != myProjectSettings.isWhitespacesIgnoredInAnnotations(); } @@ -71,6 +80,7 @@ public class HgConfigurationProjectPanel { myProjectSettings.setCheckIncomingOutgoing(myCheckIncomingOutgoingCbx.isSelected()); myProjectSettings.setIgnoreWhitespacesInAnnotations(myIgnoredWhitespacesInAnnotationsCbx.isSelected()); myProjectSettings.setHgExecutable(getCurrentPath()); + myProjectSettings.setSyncSetting(mySyncBranchControl.isSelected() ? DvcsBranchSync.SYNC : DvcsBranchSync.DONT); myVcs.checkVersion(); } @@ -82,6 +92,7 @@ public class HgConfigurationProjectPanel { myCheckIncomingOutgoingCbx.setSelected(myProjectSettings.isCheckIncomingOutgoing()); myIgnoredWhitespacesInAnnotationsCbx.setSelected(myProjectSettings.isWhitespacesIgnoredInAnnotations()); myPathSelector.setText(myProjectSettings.getGlobalSettings().getHgExecutable()); + mySyncBranchControl.setSelected(myProjectSettings.getSyncSetting() == DvcsBranchSync.SYNC); } public JPanel getPanel() { |