Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Lay2010-06-01 15:13:02 +0000
committerMatthias Sohn2010-06-02 14:19:05 +0000
commit4e05b4a52ca736a207918d47eb3574d86089785d (patch)
tree9d34936892b17cce880415a42baeeecb10050f7d
parentaa6bdc0ec74561d6dfe4808b33a43f1c0b16cb97 (diff)
downloadegit-4e05b4a52ca736a207918d47eb3574d86089785d.tar.gz
egit-4e05b4a52ca736a207918d47eb3574d86089785d.tar.xz
egit-4e05b4a52ca736a207918d47eb3574d86089785d.zip
Show untracked files per default and remember last selection
The old behaviour was not intuitive. Additionally many users want to see the untracked files. Bug: 314997 Change-Id: I87813befb7288f24d4144e09522bda2de5b38e97 Signed-off-by: Stefan Lay <stefan.lay@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CommitAction.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java34
2 files changed, 16 insertions, 20 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CommitAction.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CommitAction.java
index a3ec158b65..a92eab5e87 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CommitAction.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CommitAction.java
@@ -144,8 +144,6 @@ public class CommitAction extends RepositoryAction {
commitDialog.setPreselectedFiles(getSelectedFiles());
commitDialog.setAuthor(author);
commitDialog.setCommitter(committer);
- if(notTracked.size() == files.size())
- commitDialog.setShowUntracked(true);
if (previousCommit != null) {
commitDialog.setPreviousCommitMessage(previousCommit.getMessage());
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java
index da3a77c290..64e6682864 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java
@@ -168,6 +168,8 @@ public class CommitDialog extends Dialog {
private static final String AUTHOR_VALUES_PREF = "CommitDialog.authorValues"; //$NON-NLS-1$
+ private static final String SHOW_UNTRACKED_PREF = "CommitDialog.showUntracked"; //$NON-NLS-1$
+
/**
* @param parentShell
@@ -317,9 +319,18 @@ public class CommitDialog extends Dialog {
});
showUntrackedButton = new Button(container, SWT.CHECK);
- showUntrackedButton.setSelection(showUntracked);
showUntrackedButton.setText(UIText.CommitDialog_ShowUntrackedFiles);
showUntrackedButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).span(2, 1).create());
+
+ IDialogSettings settings = org.eclipse.egit.ui.Activator.getDefault()
+ .getDialogSettings();
+ if (settings.get(SHOW_UNTRACKED_PREF) != null) {
+ showUntracked = Boolean.valueOf(settings.get(SHOW_UNTRACKED_PREF))
+ .booleanValue();
+ }
+
+ showUntrackedButton.setSelection(showUntracked);
+
showUntrackedButton.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
@@ -559,7 +570,7 @@ public class CommitDialog extends Dialog {
private boolean signedOff = false;
private boolean amending = false;
private boolean amendAllowed = true;
- private boolean showUntracked = false;
+ private boolean showUntracked = true;
private ArrayList<IFile> selectedFiles = new ArrayList<IFile>();
private String previousCommitMessage = ""; //$NON-NLS-1$
@@ -729,6 +740,9 @@ public class CommitDialog extends Dialog {
addValueToPrefs(author, AUTHOR_VALUES_PREF);
addValueToPrefs(committer, COMMITTER_VALUES_PREF);
+ IDialogSettings settings = org.eclipse.egit.ui.Activator
+ .getDefault().getDialogSettings();
+ settings.put(SHOW_UNTRACKED_PREF, showUntracked);
super.okPressed();
}
@@ -869,22 +883,6 @@ public class CommitDialog extends Dialog {
}
/**
- * @return whether the untracked files should be shown
- */
- public boolean isShowUntracked() {
- return showUntracked;
- }
-
- /**
- * Pre-set whether the untracked files should be shown
- *
- * @param showUntracked
- */
- public void setShowUntracked(boolean showUntracked) {
- this.showUntracked = showUntracked;
- }
-
- /**
* Set the message from the previous commit for amending.
*
* @param string

Back to the top