public void NewInterpreter(IPythonInterpreterFactory factory) { bool firstInterpreter; if (firstInterpreter = !_showSettingsFor.Enabled) { // previously there were no interpreters installed _showSettingsFor.Items.Clear(); _showSettingsFor.Enabled = true; _startupScript.Enabled = true; _executionMode.Enabled = true; _completionModeGroup.Enabled = true; _promptOptionsGroup.Enabled = true; } _factories.Add(factory); _showSettingsFor.Items.Add(factory.GetInterpreterDisplay()); OptionsPage._options[factory] = OptionsPage.GetOptions(factory); if (firstInterpreter) { _showSettingsFor.SelectedIndex = 0; } RefreshOptions(); }
private bool IsSameInterpreter(IPythonInterpreterFactory interpreter, string interpreterName) { if (interpreter.GetInterpreterDisplay() == interpreterName) { return(true); } return(false); }
private void QueryStatusMethod(object sender, EventArgs args) { var oleMenu = sender as OleMenuCommand; if (_factory == null) { oleMenu.Visible = false; oleMenu.Enabled = false; oleMenu.Supported = false; } else { oleMenu.Visible = true; oleMenu.Enabled = true; oleMenu.Supported = true; oleMenu.Text = _factory.GetInterpreterDisplay() + " Interactive"; } }
internal static IReplWindow /*!*/ EnsureReplWindow(IPythonInterpreterFactory factory) { var compModel = PythonToolsPackage.ComponentModel; var provider = compModel.GetExtensions <IReplWindowProvider>().First(); string replId = PythonReplEvaluatorProvider.GetReplId(factory); var window = provider.FindReplWindow(replId); if (window == null) { window = provider.CreateReplWindow( PythonToolsPackage.Instance.ContentType, factory.GetInterpreterDisplay() + " Interactive", typeof(PythonLanguageInfo).GUID, replId ); window.SetOptionValue(ReplOptions.UseSmartUpDown, PythonToolsPackage.Instance.InteractiveOptionsPage.GetOptions(factory).ReplSmartHistory); } return(window); }