Skip to content

Commit

Permalink
Hide the copilot panel if it is not configured
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMpn committed Jul 5, 2024
1 parent b1d6087 commit 13d2e8c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions MarkMpn.Sql4Cds.XTB/SqlQueryControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ public SqlQueryControl(ConnectionDetail con, IDictionary<string, DataSource> dat
splitContainer.Panel1.Controls.SetChildIndex(_editor, 0);
Icon = _sqlIcon;

// Show/hide the copilot panel
copilotSplitContainer.Panel2Collapsed = !String.IsNullOrEmpty(Settings.Instance.OpenAIEndpoint) && !String.IsNullOrEmpty(Settings.Instance.OpenAIKey) && !String.IsNullOrEmpty(Settings.Instance.AssistantID);

Connect();

ChangeConnection(con);
Expand Down Expand Up @@ -231,6 +234,9 @@ public override void SettingsChanged()

// Update the font on the autocomplete menu as well
_autocomplete.Font = new Font(Settings.Instance.EditorFontName, Settings.Instance.EditorFontSize);

// Show/hide the copilot panel
copilotSplitContainer.Panel2Collapsed = !String.IsNullOrEmpty(Settings.Instance.OpenAIEndpoint) && !String.IsNullOrEmpty(Settings.Instance.OpenAIKey) && !String.IsNullOrEmpty(Settings.Instance.AssistantID);
}

protected override void OnClosing(CancelEventArgs e)
Expand Down

0 comments on commit 13d2e8c

Please sign in to comment.