From 12fdd38641ff2a586ae866cb607e9969f09552c9 Mon Sep 17 00:00:00 2001 From: Rejean Loyer Date: Sun, 10 Mar 2013 07:16:43 -0400 Subject: [PATCH] ide; fixed toolbar quick compiler does not reflect reloaded settings. - fixed toolbar/menus including quick config/compiler not disabled when no project/workspace loaded and on project close. - fixed changes in global settings compilers would interrupt build log and compiler name would be displayed even if active compiler didn't change. - fixed selecting first configuration if active configuration was deleted by project settings dialog - fixed quick config not updated when closing project settings dialog --- ide/src/ProjectSettings.ec | 2 ++ ide/src/dialogs/GlobalSettingsDialog.ec | 5 ----- ide/src/ide.ec | 29 ++++++++++++++++------------- ide/src/project/Project.ec | 1 + ide/src/project/ProjectView.ec | 2 +- 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/ide/src/ProjectSettings.ec b/ide/src/ProjectSettings.ec index fcdafb2..9d2f0f5 100644 --- a/ide/src/ProjectSettings.ec +++ b/ide/src/ProjectSettings.ec @@ -1765,6 +1765,8 @@ class BuildTab : Tab } } } + if(!project.config && project.topNode.configurations.count) + project.config = project.topNode.configurations[0]; } void RevertChanges() diff --git a/ide/src/dialogs/GlobalSettingsDialog.ec b/ide/src/dialogs/GlobalSettingsDialog.ec index e6c75c5..b0354a5 100644 --- a/ide/src/dialogs/GlobalSettingsDialog.ec +++ b/ide/src/dialogs/GlobalSettingsDialog.ec @@ -88,7 +88,6 @@ class GlobalSettingsDialog : Window if(compilersTab.modifiedDocument) { - bool foundActive = false; Workspace workspace = ide.workspace; if(strcmp(compilersTab.compilerConfigsDir.path, ideSettings.compilerConfigsDir)) ideSettings.compilerConfigsDir = compilersTab.compilerConfigsDir.path; @@ -96,11 +95,7 @@ class GlobalSettingsDialog : Window for(compiler : compilersTab.compilerConfigs) { ideSettings.compilerConfigs.Add(compiler.Copy()); - if(!foundActive && workspace && workspace.compiler && !strcmp(workspace.compiler, compiler.name)) - foundActive = true; } - if(workspace && !foundActive) - workspace.compiler = defaultCompilerName; compilerSettingsChanged = true; } diff --git a/ide/src/ide.ec b/ide/src/ide.ec index a9b3fb2..958736e 100644 --- a/ide/src/ide.ec +++ b/ide/src/ide.ec @@ -169,7 +169,7 @@ GlobalSettingsDialog globalSettingsDialog break; case compilerSettings: { - ide.UpdateCompilerConfigs(); + ide.UpdateCompilerConfigs(true); break; } } @@ -275,7 +275,7 @@ class IDEToolbar : ToolBar DropBox activeConfig { - this, toolTip = $"Active Configuration(s)", size = { 160 }; + this, toolTip = $"Active Configuration(s)", size = { 160 }, disabled = true; bool NotifySelect(DropBox dropBox, DataRow row, Modifiers mods) { if(row) @@ -302,10 +302,10 @@ class IDEToolbar : ToolBar DropBox activeCompiler { - this, toolTip = $"Active Compiler", size = { 160 }; + this, toolTip = $"Active Compiler", size = { 160 }, disabled = true; bool NotifySelect(DropBox dropBox, DataRow row, Modifiers mods) { - if(row && strcmp(row.string, ide.workspace.compiler)) + if(ide.workspace && ide.projectView && row && strcmp(row.string, ide.workspace.compiler)) { bool silent = ide.projectView.buildInProgress == none ? false : true; CompilerConfig compiler = ideSettings.GetCompilerConfig(row.string); @@ -952,6 +952,7 @@ class IDEWorkSpace : Window findInFilesDialog.currentDirectory = workingDir; ideMainFrame.text = titleECEREIDE; } + ide.AdjustMenus(); } } return true; @@ -1643,16 +1644,20 @@ class IDEWorkSpace : Window } } - void UpdateCompilerConfigs() + void UpdateCompilerConfigs(bool mute) { UpdateToolBarActiveCompilers(); if(workspace) { + bool silent = mute || (ide.projectView.buildInProgress == none ? false : true); CompilerConfig compiler = ideSettings.GetCompilerConfig(workspace.compiler); - projectView.ShowOutputBuildLog(true); - projectView.DisplayCompiler(compiler, false); + if(!silent) + { + projectView.ShowOutputBuildLog(true); + projectView.DisplayCompiler(compiler, false); + } for(prj : workspace.projects) - projectView.ProjectPrepareCompiler(prj, compiler, false); + projectView.ProjectPrepareCompiler(prj, compiler, silent); delete compiler; } } @@ -1666,9 +1671,8 @@ class IDEWorkSpace : Window if(workspace && workspace.compiler && !strcmp(compiler.name, workspace.compiler)) toolBar.activeCompiler.currentRow = row; } - if(!toolBar.activeCompiler.currentRow) - toolBar.activeCompiler.currentRow = toolBar.activeCompiler.firstRow; - toolBar.activeCompiler.disabled = workspace == null; + if(!toolBar.activeCompiler.currentRow && toolBar.activeCompiler.firstRow) + toolBar.activeCompiler.SelectRow(toolBar.activeCompiler.firstRow); } void UpdateToolBarActiveConfigs(bool selectionOnly) @@ -1744,7 +1748,6 @@ class IDEWorkSpace : Window toolBar.activeConfig.Sort(null, 0); if(!commonSelected) toolBar.activeConfig.currentRow = row; - toolBar.activeConfig.disabled = workspace == null; } void AdjustMenus() @@ -2058,7 +2061,7 @@ class IDEWorkSpace : Window ide.projectView.DisplayCompiler(compiler, false); delete compiler; } - UpdateCompilerConfigs(); + UpdateCompilerConfigs(false); UpdateMakefiles(); { char newWorkingDir[MAX_LOCATION]; diff --git a/ide/src/project/Project.ec b/ide/src/project/Project.ec index 08d2749..a4e9e22 100644 --- a/ide/src/project/Project.ec +++ b/ide/src/project/Project.ec @@ -46,6 +46,7 @@ IDESettingsContainer settingsContainer #ifndef MAKEFILE_GENERATOR globalSettingsDialog.ideSettings = settings; ide.UpdateRecentMenus(); + ide.UpdateCompilerConfigs(true); #endif } }; diff --git a/ide/src/project/ProjectView.ec b/ide/src/project/ProjectView.ec index 0451a9b..71c7012 100644 --- a/ide/src/project/ProjectView.ec +++ b/ide/src/project/ProjectView.ec @@ -1281,7 +1281,7 @@ class ProjectView : Window Project prj = node ? node.project : project; projectSettingsDialog = ProjectSettings { master = parent, project = prj, projectNode = node }; projectSettingsDialog.Modal(); - + ide.UpdateToolBarActiveConfigs(false); Update(null); ide.AdjustMenus(); return true; -- 1.8.3.1