Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Add GetDefaultConfiguration behaviour #1196

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hach-que
Copy link
Contributor

Follow up from #1157 targeting the master branch instead.

In Protobuild, we use project configurations as targetable platforms, instead of Debug / Release. This is because there's no way for an add-in to add more drop-down menus to the toolbar.

By default MonoDevelop picks the first entry in the configuration in the list when opening a solution, which for Protobuild projects will be Android (because it's alphabetically sorted). However, we actually want to default the configuration to the current host platform.

This adds a virtual method that allows MonoDevelop to query the current solutions to see if they have a preferred default configuration.

@hach-que hach-que force-pushed the roslyn-defaultconfig branch from cc6ff22 to 8ea3a78 Compare December 29, 2015 06:22
@@ -315,6 +315,15 @@ void SelectActiveConfiguration ()
var confs = ToolbarView.ConfigurationModel.ToList ();
if (confs.Count > 0) {
string defaultConfig = ToolbarView.ActiveConfiguration != null ? ToolbarView.ActiveConfiguration.OriginalId : confs[0].OriginalId;

foreach (Solution sol in IdeApp.Workspace.GetAllSolutions()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This second call is necessary (in addition to GetBestDefaultConfiguration) because this is called when the solution is first loaded, while GetBestDefaultConfiguration is not. They trigger under different scenarios, so adding the logic in both places is required.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT GetBestDefaultConfiguration is always called, event when the solution is first loaded. In which case it isn't called?

@slluis slluis self-assigned this Jan 22, 2016
Base automatically changed from master to main March 9, 2021 14:17
@directhex directhex requested a review from slluis as a code owner March 9, 2021 14:17
@akoeplinger akoeplinger changed the base branch from main to master March 15, 2021 17:02
Base automatically changed from master to main March 15, 2021 17:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants