Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Hungershausen2019-10-13 10:08:23 -0400
committerJonas Hungershausen2019-10-15 02:11:06 -0400
commit0756f4d648f24ef07e4c3ad0230dbb332ec26308 (patch)
treed71b1f31790724662261b2aff2e9f3d8c42e68ed /org.eclipse.egit.ui
parent1de7387c4183e68c18735ef5ce56c4d5bb5d02e2 (diff)
downloadegit-0756f4d648f24ef07e4c3ad0230dbb332ec26308.tar.gz
egit-0756f4d648f24ef07e4c3ad0230dbb332ec26308.tar.xz
egit-0756f4d648f24ef07e4c3ad0230dbb332ec26308.zip
Stashing files: Remember selection state for "Include untracked files"
Bug 540466 Change-Id: Ia33409b16dd6135688dfcd8bde0c9ef11ff1431d Signed-off-by: Jonas Hungershausen <jonas.hungershausen@vogella.com>
Diffstat (limited to 'org.eclipse.egit.ui')
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIPreferences.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/stash/StashCreateUI.java10
2 files changed, 13 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIPreferences.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIPreferences.java
index 61b9069f6..867c8f4f3 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIPreferences.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIPreferences.java
@@ -284,6 +284,9 @@ public class UIPreferences {
/** */
public static final String BLOCK_COMMIT_LEVEL = "blockCommitCombo"; //$NON-NLS-1$
+ /** */
+ public static final String STASH_INCLUDE_UNTRACKED = "stashIncludeUntracked"; //$NON-NLS-1$
+
/**
* Converts a persisted String separated with commas to an integer array
*
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/stash/StashCreateUI.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/stash/StashCreateUI.java
index c82d236fb..829d35f51 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/stash/StashCreateUI.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/stash/StashCreateUI.java
@@ -22,11 +22,13 @@ import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.egit.core.op.StashCreateOperation;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.JobFamilies;
+import org.eclipse.egit.ui.UIPreferences;
import org.eclipse.egit.ui.UIUtils;
import org.eclipse.egit.ui.internal.UIText;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.window.Window;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
@@ -136,6 +138,9 @@ public class StashCreateUI {
private boolean includeUntracked;
+ private final IPreferenceStore store = Activator.getDefault()
+ .getPreferenceStore();
+
public StashCreateDialog(Shell shell) {
super(shell);
}
@@ -163,6 +168,9 @@ public class StashCreateUI {
untrackedButton = new Button(composite, SWT.CHECK);
untrackedButton
.setText(UIText.StashCreateCommand_includeUntrackedLabel);
+ includeUntracked = store
+ .getBoolean(UIPreferences.STASH_INCLUDE_UNTRACKED);
+ untrackedButton.setSelection(includeUntracked);
text.setFocus();
return composite;
@@ -173,6 +181,8 @@ public class StashCreateUI {
if (buttonId == IDialogConstants.OK_ID) {
commitMessage = text.getText();
includeUntracked = untrackedButton.getSelection();
+ store.setValue(UIPreferences.STASH_INCLUDE_UNTRACKED,
+ includeUntracked);
} else {
commitMessage = null;
includeUntracked = false;

Back to the top