mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[log] IDEA-117920 Remember 'show long edges' setting between refreshes & restarts
Persist the setting, restore it after each DataPack update.
This commit is contained in:
@@ -41,6 +41,7 @@ public class VcsLogUiProperties implements PersistentStateComponent<VcsLogUiProp
|
||||
|
||||
public static class State {
|
||||
public boolean SHOW_DETAILS = true;
|
||||
public boolean LONG_EDGES_VISIBLE = false;
|
||||
public Deque<UserGroup> RECENTLY_FILTERED_USER_GROUPS = new ArrayDeque<UserGroup>();
|
||||
public Deque<UserGroup> RECENTLY_FILTERED_BRANCH_GROUPS = new ArrayDeque<UserGroup>();
|
||||
}
|
||||
@@ -108,6 +109,14 @@ public class VcsLogUiProperties implements PersistentStateComponent<VcsLogUiProp
|
||||
});
|
||||
}
|
||||
|
||||
public boolean areLongEdgesVisible() {
|
||||
return myState.LONG_EDGES_VISIBLE;
|
||||
}
|
||||
|
||||
public void setLongEdgesVisibility(boolean visible) {
|
||||
myState.LONG_EDGES_VISIBLE = visible;
|
||||
}
|
||||
|
||||
public static class UserGroup {
|
||||
public List<String> users = new ArrayList<String>();
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ public class VcsLogUiImpl implements VcsLogUi, Disposable {
|
||||
@NotNull private final VcsLogColorManager myColorManager;
|
||||
@NotNull private final VcsLogFilterer myFilterer;
|
||||
@NotNull private final VcsLog myLog;
|
||||
@NotNull private final VcsLogUiProperties myUiProperties;
|
||||
|
||||
@NotNull private final Collection<VcsLogFilterChangeListener> myFilterChangeListeners = ContainerUtil.newArrayList();
|
||||
|
||||
@@ -53,6 +54,7 @@ public class VcsLogUiImpl implements VcsLogUi, Disposable {
|
||||
myLogDataHolder = logDataHolder;
|
||||
myProject = project;
|
||||
myColorManager = manager;
|
||||
myUiProperties = uiProperties;
|
||||
myDataPack = initialDataPack;
|
||||
Disposer.register(logDataHolder, this);
|
||||
|
||||
@@ -152,6 +154,7 @@ public class VcsLogUiImpl implements VcsLogUi, Disposable {
|
||||
|
||||
public void setLongEdgeVisibility(boolean visibility) {
|
||||
handleAnswer(myDataPack.getGraphFacade().performAction(LongEdgesAction.valueOf(visibility)));
|
||||
myUiProperties.setLongEdgesVisibility(visibility);
|
||||
}
|
||||
|
||||
public boolean areLongEdgesHidden() {
|
||||
@@ -288,6 +291,7 @@ public class VcsLogUiImpl implements VcsLogUi, Disposable {
|
||||
myDataPack = dataPack;
|
||||
setModel(newModel, myDataPack, previouslySelected);
|
||||
myMainFrame.updateDataPack(myDataPack);
|
||||
setLongEdgeVisibility(myUiProperties.areLongEdgesVisible());
|
||||
fireFilterChangeEvent();
|
||||
repaintUI();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user