From 321d55edc5e3d8926df3f6a9664ed073c0ab3e6b Mon Sep 17 00:00:00 2001 From: Oleg Shpynov Date: Wed, 10 Mar 2010 19:03:09 +0300 Subject: [PATCH] Fixed presentation of run console actions --- .../python/console/RunPythonConsoleAction.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/python/src/com/jetbrains/python/console/RunPythonConsoleAction.java b/python/src/com/jetbrains/python/console/RunPythonConsoleAction.java index ba869bf52d4c..bee472676f4e 100644 --- a/python/src/com/jetbrains/python/console/RunPythonConsoleAction.java +++ b/python/src/com/jetbrains/python/console/RunPythonConsoleAction.java @@ -33,16 +33,16 @@ public class RunPythonConsoleAction extends AnAction implements DumbAware { @Override public void update(final AnActionEvent e) { + e.getPresentation().setVisible(false); + e.getPresentation().setEnabled(false); final Project project = e.getData(LangDataKeys.PROJECT); - if (project == null){ - e.getPresentation().setVisible(false); - return; - } - for (Module module : ModuleManager.getInstance(project).getModules()) { - e.getPresentation().setVisible(true); - if (PythonSdkType.findPythonSdk(module) != null){ - e.getPresentation().setEnabled(true); - break; + if (project != null){ + for (Module module : ModuleManager.getInstance(project).getModules()) { + e.getPresentation().setVisible(true); + if (PythonSdkType.findPythonSdk(module) != null){ + e.getPresentation().setEnabled(true); + break; + } } } }