ide; fixed toolbar quick compiler does not reflect reloaded settings.
authorRejean Loyer <rejean.loyer@gmail.com>
Sun, 10 Mar 2013 11:16:43 +0000 (07:16 -0400)
committerJerome St-Louis <jerome@ecere.com>
Sun, 10 Mar 2013 11:16:43 +0000 (07:16 -0400)
- 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
ide/src/dialogs/GlobalSettingsDialog.ec
ide/src/ide.ec
ide/src/project/Project.ec
ide/src/project/ProjectView.ec

index fcdafb2..9d2f0f5 100644 (file)
@@ -1765,6 +1765,8 @@ class BuildTab : Tab
             }
          }
       }
+      if(!project.config && project.topNode.configurations.count)
+         project.config = project.topNode.configurations[0];
    }
 
    void RevertChanges()
index e6c75c5..b0354a5 100644 (file)
@@ -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;
             }
index a9b3fb2..958736e 100644 (file)
@@ -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];
index 08d2749..a4e9e22 100644 (file)
@@ -46,6 +46,7 @@ IDESettingsContainer settingsContainer
 #ifndef MAKEFILE_GENERATOR
       globalSettingsDialog.ideSettings = settings;
       ide.UpdateRecentMenus();
+      ide.UpdateCompilerConfigs(true);
 #endif
    }
 };
index 0451a9b..71c7012 100644 (file)
@@ -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;