Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2018-03-30 09:49:19 +0000
committerMichael Keppler2018-03-30 09:50:10 +0000
commit40cc626957292a0dbd058f6f399eac6a7cd52773 (patch)
treeae8ae07b37ca912fedb55284e40104e5d3abf2fd /org.eclipse.egit.ui/src
parentaab7bb39d5351fc1f59853005734d5a5523ce37e (diff)
downloadegit-40cc626957292a0dbd058f6f399eac6a7cd52773.tar.gz
egit-40cc626957292a0dbd058f6f399eac6a7cd52773.tar.xz
egit-40cc626957292a0dbd058f6f399eac6a7cd52773.zip
Update staging view on repository config changes
Reinitialize the staging view after config changes. The listener handling is basically a copy of the already existing refsChangedListener. With the new listener, the author and committer fields are updated whenever the config is modified either by text editing or by using the preference page. Change-Id: I05dfc104c491c4eb8c2d2033cd9a1dee96e78d61 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de> Bug:533019
Diffstat (limited to 'org.eclipse.egit.ui/src')
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java
index 11add5c4c7..43328b4d28 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java
@@ -737,6 +737,8 @@ public class StagingView extends ViewPart
private ListenerHandle refsChangedListener;
+ private ListenerHandle configChangedListener;
+
private LocalResourceManager resources = new LocalResourceManager(
JFaceResources.getResources());
@@ -3682,6 +3684,12 @@ public class StagingView extends ViewPart
.addRefsChangedListener(
event -> updateRebaseButtonVisibility(repository
.getRepositoryState().isRebasing()));
+ if (configChangedListener != null) {
+ configChangedListener.remove();
+ }
+ configChangedListener = repository.getListenerList()
+ .addConfigChangedListener(
+ event -> resetCommitMessageComponent());
}
final StagingViewUpdate update = new StagingViewUpdate(repository,
indexDiff, null);
@@ -4222,6 +4230,9 @@ public class StagingView extends ViewPart
if (refsChangedListener != null) {
refsChangedListener.remove();
}
+ if (configChangedListener != null) {
+ configChangedListener.remove();
+ }
if (switchRepositoriesAction != null) {
switchRepositoriesAction.dispose();

Back to the top