ide; show stop build feature in menus including ProjectView's right-click menu. fix...
authorRejean Loyer <rejean.loyer@gmail.com>
Sun, 10 Mar 2013 01:24:28 +0000 (20:24 -0500)
committerJerome St-Louis <jerome@ecere.com>
Sun, 10 Mar 2013 05:02:30 +0000 (00:02 -0500)
ide/src/ide.ec
ide/src/project/ProjectView.ec

index 9c152f2..790e885 100644 (file)
@@ -1802,7 +1802,7 @@ class IDEWorkSpace : Window
          {
             menu.disabled = false;
             menu.text   = unavailable ? $"Stop Build" : $"Build";
-            menu.accelerator = unavailable ? f7 : Key { pauseBreak, ctrl = true };
+            menu.accelerator = unavailable ? Key { pauseBreak, ctrl = true } : f7;
          }
 
          menu = projectView.popupMenu.menu.FindItem(ProjectView::ProjectLink, 0);              if(menu) menu.disabled = unavailable;
index a9892f7..96c7aac 100644 (file)
@@ -217,9 +217,9 @@ class ProjectView : Window
                {
                   //if(node == ((Project)workspace.projects.first).topNode)
                   {
-                     MenuItem { popupContent, $"Build", b, NotifySelect = ProjectBuild }.disabled = buildMenuUnavailable;
+                     MenuItem { popupContent, $"Build", b, f7, NotifySelect = ProjectBuild }.disabled = buildMenuUnavailable;
                      MenuItem { popupContent, $"Relink", l, NotifySelect = ProjectLink }.disabled = buildMenuUnavailable;
-                     MenuItem { popupContent, $"Rebuild", r, NotifySelect = ProjectRebuild }.disabled = buildMenuUnavailable;
+                     MenuItem { popupContent, $"Rebuild", r, shiftF7, NotifySelect = ProjectRebuild }.disabled = buildMenuUnavailable;
                      MenuItem { popupContent, $"Clean", c, NotifySelect = ProjectClean }.disabled = buildMenuUnavailable;
                      MenuItem { popupContent, $"Real Clean", d, NotifySelect = ProjectRealClean }.disabled = buildMenuUnavailable;
                      MenuItem { popupContent, $"Regenerate Makefile", m, NotifySelect = ProjectRegenerate }.disabled = buildMenuUnavailable;
@@ -322,6 +322,7 @@ class ProjectView : Window
                   }
                };
                popupMenu.Create();
+               ide.AdjustPopupBuildMenus();
             }
          }
          return true;
@@ -808,27 +809,32 @@ class ProjectView : Window
 
    bool ProjectBuild(MenuItem selection, Modifiers mods)
    {
-      Project prj = project;
-      CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
-      ProjectConfig config;
-      if(selection || !ide.activeClient)
+      if(buildInProgress == none)
       {
-         DataRow row = fileList.currentRow;
-         ProjectNode node = row ? (ProjectNode)row.tag : null;
-         if(node) prj = node.project;
+         Project prj = project;
+         CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+         ProjectConfig config;
+         if(selection || !ide.activeClient)
+         {
+            DataRow row = fileList.currentRow;
+            ProjectNode node = row ? (ProjectNode)row.tag : null;
+            if(node) prj = node.project;
+         }
+         else
+         {
+            ProjectNode node = GetNodeFromWindow(ide.activeClient, null, false);
+            if(node)
+               prj = node.project;
+         }
+         config = prj.config;
+         if(/*prj != project || */!prj.GetConfigIsInDebugSession(config) || !ide.DontTerminateDebugSession($"Project Build"))
+         {
+            BuildInterrim(prj, build, compiler, config, mods.ctrl && mods.shift);
+         }
+         delete compiler;
       }
       else
-      {
-         ProjectNode node = GetNodeFromWindow(ide.activeClient, null, false);
-         if(node)
-            prj = node.project;
-      }
-      config = prj.config;
-      if(/*prj != project || */!prj.GetConfigIsInDebugSession(config) || !ide.DontTerminateDebugSession($"Project Build"))
-      {
-         BuildInterrim(prj, build, compiler, config, mods.ctrl && mods.shift);
-      }
-      delete compiler;
+         stopBuild = true;
       return true;
    }