ide: removed redundant activation of output view during build and other actions....
authorRejean Loyer <rejean.loyer@gmail.com>
Sat, 31 Mar 2012 07:27:00 +0000 (03:27 -0400)
committerRejean Loyer <rejean.loyer@gmail.com>
Sat, 31 Mar 2012 16:56:52 +0000 (12:56 -0400)
ide/src/dialogs/NewProjectDialog.ec
ide/src/ide.ec
ide/src/project/ProjectView.ec

index 91faeab..756bb9a 100644 (file)
@@ -192,6 +192,7 @@ class NewProjectDialog : Window
          {
             CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
             ProjectConfig config = project.config;
+            projectWindow.ShowOutputBuildLog(true);
             projectWindow.ProjectPrepareMakefile(project, force, true, true, compiler, config);
             delete compiler;
          }
@@ -503,6 +504,7 @@ class QuickProjectDialog : Window
          {
             CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
             ProjectConfig config = project.config;
+            projectWindow.ShowOutputBuildLog(true);
             projectWindow.ProjectPrepareMakefile(project, force, true, true, compiler, config);
             delete compiler;
          }
index 638fd23..fd33f37 100644 (file)
@@ -1530,11 +1530,12 @@ class IDEWorkSpace : Window
    {
       if(workspace)
       {
+         CompilerConfig compiler = ideSettings.GetCompilerConfig(workspace.compiler);
+         projectView.ShowOutputBuildLog(true);
+         projectView.DisplayCompiler(compiler, false);
          for(prj : workspace.projects)
-         {
-            bool first = prj == workspace.projects.firstIterator.data;
-            projectView.ProjectUpdateMakefileForAllConfigs(prj, first, first);
-         }
+            projectView.ProjectUpdateMakefileForAllConfigs(prj);
+         delete compiler;
       }
    }
 
@@ -1898,13 +1899,17 @@ class IDEWorkSpace : Window
                   prj = LoadProject(filePath);
                   if(prj)
                   {
+                     CompilerConfig compiler = ideSettings.GetCompilerConfig(workspace.compiler);
                      workspace.projects.Add(prj);
                      if(projectView)
                         projectView.AddNode(prj.topNode, null);
                      workspace.modified = true;
                      workspace.Save();
                      findInFilesDialog.AddProjectItem(prj);
-                     projectView.ProjectUpdateMakefileForAllConfigs(prj, true, true);
+                     projectView.ShowOutputBuildLog(true);
+                     projectView.DisplayCompiler(compiler, false);
+                     projectView.ProjectUpdateMakefileForAllConfigs(prj);
+                     delete compiler;
 
                      {
                         char location[MAX_LOCATION];
index 237af3f..647db89 100644 (file)
@@ -475,7 +475,9 @@ class ProjectView : Window
       {
          if(prj.topNode.modified && prj.Save(prj.filePath))
          {
-            // ProjectUpdateMakefileForAllConfigs(prj, true, true);
+            // ShowOutputBuildLog(true);
+            // DisplayCompiler(compiler, false);
+            // ProjectUpdateMakefileForAllConfigs(prj);
             prj.topNode.modified = false;
          }
       }
@@ -533,7 +535,6 @@ class ProjectView : Window
    //  ************************************************************************
    bool DisplayCompiler(CompilerConfig compiler, bool cleanLog)
    {
-      ShowOutputBuildLog(cleanLog);
       ide.outputView.buildBox.Logf($"%s Compiler\n", compiler ? compiler.name : $"{problem with compiler selection}");
    }
 
@@ -561,8 +562,6 @@ class ProjectView : Window
       bool exists;
       LogBox logBox = ide.outputView.buildBox;
       
-      ShowOutputBuildLog(cleanLog);
-
       if(displayCompiler)
          DisplayCompiler(compiler, false);
 
@@ -912,6 +911,7 @@ class ProjectView : Window
    {
       Project prj = project;
       CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+      ShowOutputBuildLog(true);
       if(selection || !ide.activeClient)
       {
          DataRow row = fileList.currentRow;
@@ -1105,14 +1105,10 @@ class ProjectView : Window
       return true;
    }
 
-   bool ProjectUpdateMakefileForAllConfigs(Project project, bool cleanLog, bool displayCompiler)
+   bool ProjectUpdateMakefileForAllConfigs(Project project)
    {
       CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
-      ShowOutputBuildLog(cleanLog);
 
-      if(displayCompiler)
-         DisplayCompiler(compiler, false);
-      
       for(config : project.configurations)
       {
          ProjectPrepareMakefile(project, forceExists, false, false,
@@ -1140,9 +1136,13 @@ class ProjectView : Window
       incref compilerDialog;
       if(compilerDialog.Modal() == ok && strcmp(compilerDialog.workspaceActiveCompiler, ide.workspace.compiler))
       {
+         CompilerConfig compiler = ideSettings.GetCompilerConfig(compilerDialog.workspaceActiveCompiler);
          ide.workspace.compiler = compilerDialog.workspaceActiveCompiler;
+         ide.projectView.ShowOutputBuildLog(true);
+         ide.projectView.DisplayCompiler(compiler, false);
          for(prj : ide.workspace.projects)
-            ide.projectView.ProjectUpdateMakefileForAllConfigs(prj, true, true);
+            ide.projectView.ProjectUpdateMakefileForAllConfigs(prj);
+         delete compiler;
       }
       delete compilerDialog;
       return true;
@@ -1482,7 +1482,9 @@ class ProjectView : Window
       {
          if(prj.Save(prj.filePath))
          {
-            // ProjectUpdateMakefileForAllConfigs(prj, true, true);
+            // ShowOutputBuildLog(true);
+            // DisplayCompiler(compiler, false);
+            // ProjectUpdateMakefileForAllConfigs(prj);
             prj.topNode.modified = false;
             prj = null;
             for(p : ide.workspace.projects)