Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDariusz Luksza2011-01-19 05:31:46 +0000
committerDariusz Luksza2011-01-19 05:31:46 +0000
commit4dae1a77c36e6766129dbe4f5c05c1edef7945e8 (patch)
treea06285ea3366cdea923f7b9345d5f3aeb18de0da
parent7bdfc9422e1fb249daa043214a99f85d8f2a74d0 (diff)
downloadegit-4dae1a77c36e6766129dbe4f5c05c1edef7945e8.tar.gz
egit-4dae1a77c36e6766129dbe4f5c05c1edef7945e8.tar.xz
egit-4dae1a77c36e6766129dbe4f5c05c1edef7945e8.zip
[sync] Include local changes by default
Improve user experience by selecting 'Include local uncommitted changes in comparison' check box in synchronization dialog by default Change-Id: I454a5fb3fc5221e7d3abf6e4dae90d0b370d955c Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/SelectSynchronizeResourceDialog.java35
1 files changed, 20 insertions, 15 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/SelectSynchronizeResourceDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/SelectSynchronizeResourceDialog.java
index 5bc307388e..db84c4861f 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/SelectSynchronizeResourceDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/SelectSynchronizeResourceDialog.java
@@ -42,10 +42,10 @@ public class SelectSynchronizeResourceDialog extends TitleAreaDialog {
private String srcRef;
- private boolean shouldIncluldeLocal;
-
private final String repoName;
+ private boolean shouldIncludeLocal = true;
+
private final List<SyncRepoEntity> syncRepos;
private RemoteSelectionCombo dstRefCombo;
@@ -97,7 +97,7 @@ public class SelectSynchronizeResourceDialog extends TitleAreaDialog {
* in comparison
*/
public boolean shouldIncludeLocal() {
- return shouldIncluldeLocal;
+ return shouldIncludeLocal;
}
@Override
@@ -110,31 +110,36 @@ public class SelectSynchronizeResourceDialog extends TitleAreaDialog {
| GridData.VERTICAL_ALIGN_CENTER);
data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH / 2);
- new Label(composite, SWT.WRAP)
- .setText(UIText.SelectSynchronizeResourceDialog_srcRef);
-
- srcRefCombo = new RemoteSelectionCombo(composite, syncRepos,
- UIText.RemoteSelectionCombo_sourceName,
- UIText.RemoteSelectionCombo_sourceRef);
- srcRefCombo.setDefaultValue(UIText.SynchronizeWithAction_localRepoName, HEAD);
- srcRefCombo.setLayoutData(data);
- srcRefCombo.setLayoutData(GridDataFactory.fillDefaults().grab(true,
- false).create());
-
shouldIncludeLocalButton = new Button(composite, SWT.CHECK | SWT.WRAP);
shouldIncludeLocalButton
.setText(UIText.SelectSynchronizeResourceDialog_includeUncommitedChanges);
+ shouldIncludeLocalButton.setSelection(true);
+
+ final Label srcRefLabel = new Label(composite, SWT.WRAP);
+ srcRefLabel.setText(UIText.SelectSynchronizeResourceDialog_srcRef);
+ srcRefLabel.setEnabled(false);
+
shouldIncludeLocalButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
boolean includeLocal = shouldIncludeLocalButton.getSelection();
srcRefCombo.setEnabled(!includeLocal);
+ srcRefLabel.setEnabled(!includeLocal);
if (includeLocal)
srcRefCombo.setDefaultValue(
UIText.SynchronizeWithAction_localRepoName, HEAD);
}
});
+ srcRefCombo = new RemoteSelectionCombo(composite, syncRepos,
+ UIText.RemoteSelectionCombo_sourceName,
+ UIText.RemoteSelectionCombo_sourceRef);
+ srcRefCombo.setDefaultValue(UIText.SynchronizeWithAction_localRepoName, HEAD);
+ srcRefCombo.setLayoutData(data);
+ srcRefCombo.setLayoutData(GridDataFactory.fillDefaults().grab(true,
+ false).create());
+ srcRefCombo.setEnabled(false);
+
new Label(composite, SWT.WRAP)
.setText(UIText.SelectSynchronizeResourceDialog_dstRef);
@@ -171,7 +176,7 @@ public class SelectSynchronizeResourceDialog extends TitleAreaDialog {
if (buttonId == IDialogConstants.OK_ID) {
dstRef = dstRefCombo.getValue();
srcRef = srcRefCombo.getValue();
- shouldIncluldeLocal = shouldIncludeLocalButton.getSelection();
+ shouldIncludeLocal = shouldIncludeLocalButton.getSelection();
}
super.buttonPressed(buttonId);
}

Back to the top