mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user