From 63484f6c0c2e63c76df2ea3ce159d668586f16f8 Mon Sep 17 00:00:00 2001 From: irengrig Date: Fri, 26 Aug 2011 12:52:11 +0400 Subject: [PATCH] not totally successful attempt to fix git log action after default project refactoring --- .../vcs/changes/ui/ChangesBrowserNodeRenderer.java | 4 ++++ .../src/git4idea/config/GitExecutableValidator.java | 1 + .../src/git4idea/history/GitHistoryUtils.java | 1 + .../src/git4idea/history/wholeTree/GitLogUI.java | 12 +++++++----- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserNodeRenderer.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserNodeRenderer.java index ca314157d7f5..95371991f275 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserNodeRenderer.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesBrowserNodeRenderer.java @@ -57,6 +57,10 @@ public class ChangesBrowserNodeRenderer extends ColoredTreeCellRenderer { protected void appendFileName(final VirtualFile vFile, final String fileName, final Color color) { + if (myProject.isDefault()) { + append(fileName, new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, color)); + return; + } final ChangesFileNameDecorator decorator = ChangesFileNameDecorator.getInstance(myProject); if (decorator != null) { decorator.appendFileName(this, vFile, fileName, color, myHighlightProblems); diff --git a/plugins/git4idea/src/git4idea/config/GitExecutableValidator.java b/plugins/git4idea/src/git4idea/config/GitExecutableValidator.java index dd61ca65b5e1..964b4167182f 100644 --- a/plugins/git4idea/src/git4idea/config/GitExecutableValidator.java +++ b/plugins/git4idea/src/git4idea/config/GitExecutableValidator.java @@ -74,6 +74,7 @@ public class GitExecutableValidator extends ExecutableValidator { @Override protected void saveCurrentExecutable(String executable) { myVcs.getAppSettings().setPathToGit(executable); + myVcs.checkVersion(); } /** diff --git a/plugins/git4idea/src/git4idea/history/GitHistoryUtils.java b/plugins/git4idea/src/git4idea/history/GitHistoryUtils.java index 245bb0bbb276..6c6ac94543dd 100644 --- a/plugins/git4idea/src/git4idea/history/GitHistoryUtils.java +++ b/plugins/git4idea/src/git4idea/history/GitHistoryUtils.java @@ -707,6 +707,7 @@ public class GitHistoryUtils { * @return the name of file in the last commit or argument */ public static FilePath getLastCommitName(final Project project, FilePath path) { + if (project.isDefault()) return path; final ChangeListManager changeManager = ChangeListManager.getInstance(project); final Change change = changeManager.getChange(path); if (change != null && change.getType() == Change.Type.MOVED) { diff --git a/plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java b/plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java index 6e4557f2d756..63a6ba293af4 100644 --- a/plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java +++ b/plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java @@ -908,13 +908,15 @@ public class GitLogUI implements Disposable { @Override protected void customizeCellRenderer(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) { - setBackground(getLogicBackground(selected, row)); + //setBackground(getLogicBackground(selected, row)); if (BigTableTableModel.LOADING == value) { return; } final String text = value.toString(); myUsualAttributesForRun = isCurrentUser(row, text) ? - SimpleTextAttributes.merge(myUsualAttributes, SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES) : myUsualAttributes; + SimpleTextAttributes.merge(myUsualAttributes, SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES) : + new SimpleTextAttributes(myUsualAttributes.getBgColor(), myUsualAttributes.getFgColor(), + myUsualAttributes.getWaveColor(), myUsualAttributes.getStyle()); if (myWorker.isEmpty()) { append(text, myUsualAttributesForRun); return; @@ -942,7 +944,7 @@ public class GitLogUI implements Disposable { @Override protected void customizeCellRenderer(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) { - setBackground(getLogicBackground(selected, row)); + //setBackground(getLogicBackground(selected, row)); if (BigTableTableModel.LOADING == value) { if (myShowLoading) { append("Loading..."); @@ -1021,7 +1023,7 @@ public class GitLogUI implements Disposable { private void addOneIcon(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column, Icon icon) { myCurrentWidth = icon.getIconWidth(); myPanel.removeAll(); - myPanel.setBackground(getLogicBackground(isSelected, row)); + //myPanel.setBackground(getLogicBackground(isSelected, row)); myPanel.add(new JLabel(icon)); myInner.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); myPanel.add(myInner); @@ -1043,7 +1045,7 @@ public class GitLogUI implements Disposable { } @Override protected void customizeCellRenderer(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) { - setBackground(getLogicBackground(selected, row)); + //setBackground(getLogicBackground(selected, row)); if (value instanceof GitCommit) { final GitCommit gitCommit = (GitCommit)value; myIssueLinkRenderer.appendTextWithLinks(gitCommit.getDescription(), SimpleTextAttributes.REGULAR_ATTRIBUTES, myConsumer);