[vcs] "Filter update info by scope" action fixes

* Remember the filter state in the settings.
* Let it show (but disable) even if filtering is turned off.
* Set action description.
This commit is contained in:
Kirill Likhodedov
2013-02-07 15:21:06 +04:00
parent 6e87ed828a
commit 84fca015ee
2 changed files with 6 additions and 4 deletions
@@ -145,6 +145,7 @@ public final class VcsConfiguration implements PersistentStateComponent<Element>
public String ACTIVE_VCS_NAME;
public boolean UPDATE_GROUP_BY_PACKAGES = false;
public boolean UPDATE_GROUP_BY_CHANGELIST = false;
public boolean UPDATE_FILTER_BY_SCOPE = false;
public boolean SHOW_FILE_HISTORY_AS_TREE = false;
public float FILE_HISTORY_SPLITTER_PROPORTION = 0.6f;
private static final int MAX_STORED_MESSAGES = 25;
@@ -115,6 +115,8 @@ public class UpdateInfoTree extends PanelWithActionsAndCloseButton implements Di
myProject = project;
myUpdatedFiles = updatedFiles;
myRootName = rootName;
myShowOnlyFilteredItems = VcsConfiguration.getInstance(myProject).UPDATE_FILTER_BY_SCOPE;
myFileStatusManager = FileStatusManager.getInstance(myProject);
myFileStatusManager.addFileStatusListener(myFileStatusListener);
@@ -451,8 +453,7 @@ public class UpdateInfoTree extends PanelWithActionsAndCloseButton implements Di
private class FilterAction extends ToggleAction implements DumbAware {
public FilterAction() {
super("Scope Filter");
getTemplatePresentation().setIcon(AllIcons.General.Filter);
super("Scope Filter", VcsBundle.getString("settings.filter.update.project.info.by.scope"), AllIcons.General.Filter);
}
@Override
@@ -463,13 +464,13 @@ public class UpdateInfoTree extends PanelWithActionsAndCloseButton implements Di
@Override
public void setSelected(AnActionEvent e, boolean state) {
myShowOnlyFilteredItems = state;
VcsConfiguration.getInstance(myProject).UPDATE_FILTER_BY_SCOPE = myShowOnlyFilteredItems;
updateTreeModel();
}
public void update(AnActionEvent e) {
super.update(e);
e.getPresentation().setVisible(VcsConfiguration.getInstance(myProject).UPDATE_FILTER_SCOPE_NAME != null);
e.getPresentation().setEnabled(!myGroupByChangeList);
e.getPresentation().setEnabled(!myGroupByChangeList && VcsConfiguration.getInstance(myProject).UPDATE_FILTER_SCOPE_NAME != null);
}
}
}