mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-26164 "Show Variables" pane should not be displayed by default
This commit is contained in:
@@ -55,6 +55,14 @@ public class PyConsoleOptions implements PersistentStateComponent<PyConsoleOptio
|
||||
myState.myShowDebugConsoleByDefault = showDebugConsoleByDefault;
|
||||
}
|
||||
|
||||
public boolean isShowVariableByDefault() {
|
||||
return myState.myShowVariablesByDefault;
|
||||
}
|
||||
|
||||
public void setShowVariablesByDefault(boolean showVariableByDefault) {
|
||||
myState.myShowVariablesByDefault = showVariableByDefault;
|
||||
}
|
||||
|
||||
public boolean isIpythonEnabled(){
|
||||
return myState.myIpythonEnabled;
|
||||
}
|
||||
@@ -75,6 +83,7 @@ public class PyConsoleOptions implements PersistentStateComponent<PyConsoleOptio
|
||||
@Override
|
||||
public void loadState(State state) {
|
||||
myState.myShowDebugConsoleByDefault = state.myShowDebugConsoleByDefault;
|
||||
myState.myShowVariablesByDefault = state.myShowVariablesByDefault;
|
||||
myState.myPythonConsoleState = state.myPythonConsoleState;
|
||||
myState.myIpythonEnabled = state.myIpythonEnabled;
|
||||
}
|
||||
@@ -83,6 +92,7 @@ public class PyConsoleOptions implements PersistentStateComponent<PyConsoleOptio
|
||||
public PyConsoleSettings myPythonConsoleState = new PyConsoleSettings();
|
||||
|
||||
public boolean myShowDebugConsoleByDefault = false;
|
||||
public boolean myShowVariablesByDefault = true;
|
||||
public boolean myIpythonEnabled = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<grid id="b4377" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="b4377" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
@@ -34,7 +34,7 @@
|
||||
</component>
|
||||
<vspacer id="c732">
|
||||
<constraints>
|
||||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<component id="cccd6" class="com.intellij.ui.components.JBCheckBox" binding="myIpythonEnabledCheckbox">
|
||||
@@ -45,6 +45,14 @@
|
||||
<text value="Use IPython if available"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="65b83" class="com.intellij.ui.components.JBCheckBox" binding="myShowsVariablesByDefault">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Shows console variables by default"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
<hspacer id="4135">
|
||||
|
||||
@@ -162,6 +162,7 @@ public class PyConsoleOptionsConfigurable extends SearchableConfigurable.Parent.
|
||||
private JPanel myWholePanel;
|
||||
private JBCheckBox myShowDebugConsoleByDefault;
|
||||
private JBCheckBox myIpythonEnabledCheckbox;
|
||||
private JBCheckBox myShowsVariablesByDefault;
|
||||
private PyConsoleOptions myOptionsProvider;
|
||||
|
||||
public JPanel createPanel(PyConsoleOptions optionsProvider) {
|
||||
@@ -172,17 +173,20 @@ public class PyConsoleOptionsConfigurable extends SearchableConfigurable.Parent.
|
||||
|
||||
public void apply() {
|
||||
myOptionsProvider.setShowDebugConsoleByDefault(myShowDebugConsoleByDefault.isSelected());
|
||||
myOptionsProvider.setShowVariablesByDefault(myShowsVariablesByDefault.isSelected());
|
||||
myOptionsProvider.setIpythonEnabled(myIpythonEnabledCheckbox.isSelected());
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
myShowDebugConsoleByDefault.setSelected(myOptionsProvider.isShowDebugConsoleByDefault());
|
||||
myShowsVariablesByDefault.setSelected(myOptionsProvider.isShowVariableByDefault());
|
||||
myIpythonEnabledCheckbox.setSelected(myOptionsProvider.isIpythonEnabled());
|
||||
}
|
||||
|
||||
public boolean isModified() {
|
||||
return myShowDebugConsoleByDefault.isSelected() != myOptionsProvider.isShowDebugConsoleByDefault() ||
|
||||
myIpythonEnabledCheckbox.isSelected() != myOptionsProvider.isIpythonEnabled();
|
||||
myIpythonEnabledCheckbox.isSelected() != myOptionsProvider.isIpythonEnabled() ||
|
||||
myShowsVariablesByDefault.isSelected() != myOptionsProvider.isShowVariableByDefault();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public class PythonConsoleView extends LanguageConsoleImpl implements Observable
|
||||
|
||||
private XStandaloneVariablesView mySplitView;
|
||||
private ActionCallback myInitialized = new ActionCallback();
|
||||
private boolean isShowVars = true;
|
||||
private boolean isShowVars;
|
||||
|
||||
/**
|
||||
* @param testMode this console will be used to display test output and should support TC messages
|
||||
@@ -105,7 +105,7 @@ public class PythonConsoleView extends LanguageConsoleImpl implements Observable
|
||||
public PythonConsoleView(final Project project, final String title, final Sdk sdk, final boolean testMode) {
|
||||
super(project, title, PythonLanguage.getInstance());
|
||||
myTestMode = testMode;
|
||||
|
||||
isShowVars = PyConsoleOptions.getInstance(project).isShowVariableByDefault();
|
||||
getVirtualFile().putUserData(LanguageLevel.KEY, PythonSdkType.getLanguageLevelForSdk(sdk));
|
||||
// Mark editor as console one, to prevent autopopup completion
|
||||
getConsoleEditor().putUserData(PythonConsoleAutopopupBlockingHandler.REPL_KEY, new Object());
|
||||
|
||||
Reference in New Issue
Block a user