[3.2] C#: Hide Build button if there's no solution to build
Same as we do with the bottom panel. Mainly to avoid bothering if the project is not using C#.
This commit is contained in:
parent
939ed5dd5b
commit
2bb251f628
|
@ -31,6 +31,7 @@ namespace GodotTools
|
||||||
private CheckBox aboutDialogCheckBox;
|
private CheckBox aboutDialogCheckBox;
|
||||||
|
|
||||||
private ToolButton bottomPanelBtn;
|
private ToolButton bottomPanelBtn;
|
||||||
|
private ToolButton toolBarButton;
|
||||||
|
|
||||||
public GodotIdeManager GodotIdeManager { get; private set; }
|
public GodotIdeManager GodotIdeManager { get; private set; }
|
||||||
|
|
||||||
|
@ -76,7 +77,7 @@ namespace GodotTools
|
||||||
{
|
{
|
||||||
Guid = guid,
|
Guid = guid,
|
||||||
PathRelativeToSolution = name + ".csproj",
|
PathRelativeToSolution = name + ".csproj",
|
||||||
Configs = new List<string> { "Debug", "ExportDebug", "ExportRelease" }
|
Configs = new List<string> {"Debug", "ExportDebug", "ExportRelease"}
|
||||||
};
|
};
|
||||||
|
|
||||||
solution.AddNewProject(name, projectInfo);
|
solution.AddNewProject(name, projectInfo);
|
||||||
|
@ -127,6 +128,7 @@ namespace GodotTools
|
||||||
{
|
{
|
||||||
menuPopup.RemoveItem(menuPopup.GetItemIndex((int)MenuOptions.CreateSln));
|
menuPopup.RemoveItem(menuPopup.GetItemIndex((int)MenuOptions.CreateSln));
|
||||||
bottomPanelBtn.Show();
|
bottomPanelBtn.Show();
|
||||||
|
toolBarButton.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void _ShowAboutDialog()
|
private void _ShowAboutDialog()
|
||||||
|
@ -508,6 +510,15 @@ namespace GodotTools
|
||||||
aboutVBox.AddChild(aboutDialogCheckBox);
|
aboutVBox.AddChild(aboutDialogCheckBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toolBarButton = new ToolButton
|
||||||
|
{
|
||||||
|
Text = "Build",
|
||||||
|
HintTooltip = "Build solution",
|
||||||
|
FocusMode = Control.FocusModeEnum.None
|
||||||
|
};
|
||||||
|
toolBarButton.Connect("pressed", this, nameof(_BuildSolutionPressed));
|
||||||
|
AddControlToContainer(CustomControlContainer.Toolbar, toolBarButton);
|
||||||
|
|
||||||
if (File.Exists(GodotSharpDirs.ProjectSlnPath) && File.Exists(GodotSharpDirs.ProjectCsProjPath))
|
if (File.Exists(GodotSharpDirs.ProjectSlnPath) && File.Exists(GodotSharpDirs.ProjectCsProjPath))
|
||||||
{
|
{
|
||||||
ApplyNecessaryChangesToSolution();
|
ApplyNecessaryChangesToSolution();
|
||||||
|
@ -515,20 +526,12 @@ namespace GodotTools
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bottomPanelBtn.Hide();
|
bottomPanelBtn.Hide();
|
||||||
|
toolBarButton.Hide();
|
||||||
menuPopup.AddItem("Create C# solution".TTR(), (int)MenuOptions.CreateSln);
|
menuPopup.AddItem("Create C# solution".TTR(), (int)MenuOptions.CreateSln);
|
||||||
}
|
}
|
||||||
|
|
||||||
menuPopup.Connect("id_pressed", this, nameof(_MenuOptionPressed));
|
menuPopup.Connect("id_pressed", this, nameof(_MenuOptionPressed));
|
||||||
|
|
||||||
var buildButton = new ToolButton
|
|
||||||
{
|
|
||||||
Text = "Build",
|
|
||||||
HintTooltip = "Build solution",
|
|
||||||
FocusMode = Control.FocusModeEnum.None
|
|
||||||
};
|
|
||||||
buildButton.Connect("pressed", this, nameof(_BuildSolutionPressed));
|
|
||||||
AddControlToContainer(CustomControlContainer.Toolbar, buildButton);
|
|
||||||
|
|
||||||
// External editor settings
|
// External editor settings
|
||||||
EditorDef("mono/editor/external_editor", ExternalEditorId.None);
|
EditorDef("mono/editor/external_editor", ExternalEditorId.None);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue