diff options
author | Michael Keppler | 2018-06-23 08:06:51 +0000 |
---|---|---|
committer | Thomas Wolf | 2018-06-30 16:34:33 +0000 |
commit | eaea49ca97365415d516073901c2335c84513149 (patch) | |
tree | 91f1031b230e6127c6141eb2c0c3f594af2a5efc | |
parent | 5d34e9dc6d94018e1762e630fbc4d6e763d86311 (diff) | |
download | egit-eaea49ca97365415d516073901c2335c84513149.tar.gz egit-eaea49ca97365415d516073901c2335c84513149.tar.xz egit-eaea49ca97365415d516073901c2335c84513149.zip |
Disable commit buttons immediately on committing
Since all the file related checks can take quite some time, we need to
disable the buttons immediately, not only when triggering the commit
operation on the repository.
Most notable visible difference is that the complete staging view is
disabled when the user gets the "no files staged" error message dialog.
Change-Id: Iae825abfb9235832a3fae49e9f967d983461dec5
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
Bug:533005
-rw-r--r-- | org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java | 15 |
1 files changed, 11 insertions, 4 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 6395190e7c..d49184696d 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 @@ -4152,20 +4152,28 @@ public class StagingView extends ViewPart } private void commit(boolean pushUpstream) { + // don't allow to do anything as long as commit is in progress + enableAllWidgets(false); + if (!isCommitWithoutFilesAllowed()) { MessageDialog md = new MessageDialog(getSite().getShell(), UIText.StagingView_committingNotPossible, null, UIText.StagingView_noStagedFiles, MessageDialog.ERROR, new String[] { IDialogConstants.CLOSE_LABEL }, 0); md.open(); + enableAllWidgets(true); return; } - if (!commitMessageComponent.checkCommitInfo()) + if (!commitMessageComponent.checkCommitInfo()) { + enableAllWidgets(true); return; + } if (!UIUtils.saveAllEditors(currentRepository, - UIText.StagingView_cancelCommitAfterSaving)) + UIText.StagingView_cancelCommitAfterSaving)) { + enableAllWidgets(true); return; + } String commitMessage = commitMessageComponent.getCommitMessage(); CommitOperation commitOperation = null; @@ -4176,6 +4184,7 @@ public class StagingView extends ViewPart commitMessage); } catch (CoreException e) { Activator.handleError(UIText.StagingView_commitFailed, e, true); + enableAllWidgets(true); return; } if (amendPreviousCommitAction.isChecked()) @@ -4191,8 +4200,6 @@ public class StagingView extends ViewPart .setOpenCommitEditor(openNewCommitsAction.isChecked()) .setPushUpstream(pushMode); - // don't allow to do anything as long as commit is in progress - enableAllWidgets(false); commitJob.addJobChangeListener(new JobChangeAdapter() { @Override |