ide; implemented when adding project to workspace, use selected config if available...
authorRejean Loyer <rejean.loyer@gmail.com>
Mon, 6 May 2013 23:11:00 +0000 (19:11 -0400)
committerRejean Loyer <rejean.loyer@gmail.com>
Mon, 20 May 2013 20:58:12 +0000 (16:58 -0400)
ide/src/ide.ec
ide/src/project/Workspace.ec

index 43b8f29..2d1f922 100644 (file)
@@ -1740,7 +1740,7 @@ class IDEWorkSpace : Window
       else
       {
          toolBar.activeConfig.Clear();
-         row = toolBar.activeConfig.AddString("(Mixed)");
+         row = toolBar.activeConfig.AddString($"(Mixed)");
          row.tag = 1;
       }
       if(workspace)
@@ -2229,9 +2229,24 @@ class IDEWorkSpace : Window
                   prj = LoadProject(filePath, null);
                   if(prj)
                   {
+                     char * activeConfigName = null;
                      CompilerConfig compiler = ideSettings.GetCompilerConfig(workspace.compiler);
                      prj.StartMonitoring();
                      workspace.projects.Add(prj);
+                     if(toolBar.activeConfig.currentRow && toolBar.activeConfig.currentRow != toolBar.activeConfig.firstRow &&
+                           toolBar.activeConfig.currentRow.string && toolBar.activeConfig.currentRow.string[0])
+                        activeConfigName = toolBar.activeConfig.currentRow.string;
+                     if(activeConfigName)
+                     {
+                        for(cfg : prj.configurations)
+                        {
+                           if(cfg.name && !strcmp(cfg.name, activeConfigName))
+                           {
+                              prj.config = cfg;
+                              break;
+                           }
+                        }
+                     }
                      if(projectView)
                         projectView.AddNode(prj.topNode, null);
                      workspace.modified = true;
index 768dc3c..0a7d3d2 100644 (file)
@@ -452,6 +452,7 @@ public:
       DropInvalidBreakpoints();
       modified = true;
       ide.findInFilesDialog.RemoveProjectItem(project);
+      ide.UpdateToolBarActiveConfigs(false);
       Save();
 
       delete project;