ide: add -debug-hide-ide command line switch.
authorRejean Loyer <redj@ecere.com>
Mon, 15 Sep 2014 06:25:29 +0000 (02:25 -0400)
committerRejean Loyer <redj@ecere.com>
Mon, 16 Mar 2015 05:31:38 +0000 (01:31 -0400)
   allow debugging a program with an hidden ide.
   the ide will hide when execution starts.
   it will reappear when execution stops.

ide/src/ide.ec
ide/src/project/Workspace.ec

index e1200b8..87b9ef0 100755 (executable)
@@ -1639,6 +1639,7 @@ class IDEWorkSpace : Window
 
    bool noParsing;
    bool debugStart;
+   bool debugHideIDE;
 
 #ifdef GDB_DEBUG_GUI
    GDBDialog gdbDialog
@@ -3142,6 +3143,8 @@ class IDEWorkSpace : Window
             ide.noParsing = true;
          else if(!strcmp(app.argv[c], "-debug-start"))
             ide.debugStart = true;
+         else if(!strcmp(app.argv[c], "-debug-hide-ide"))
+            ide.debugHideIDE = true;
          else if(!strcmp(app.argv[c], "-debug-work-dir"))
             debugWorkDir = true;
          else if(!strcmp(app.argv[c], "-@"))
@@ -3159,7 +3162,7 @@ class IDEWorkSpace : Window
             GetExtension(app.argv[c], ext);
             isProject = !openAsText && !strcmpi(ext, "epj");
 
-            if(isProject && c > 1 + (ide.debugStart ? 1 : 0)) continue;
+            if(isProject && c > 1 + (ide.debugStart ? 1 : 0) + (ide.debugHideIDE ? 1 : 0)) continue;
 
             // Create directory for projects (only)
             if(((dirAttribs = FileExists(parentPath)) && dirAttribs.isDirectory) || isProject)
@@ -3727,6 +3730,7 @@ class IDEApp : GuiApplication
             else if(!strcmp(app.argv[c], "-t"));
             else if(!strcmp(app.argv[c], "-no-parsing"));
             else if(!strcmp(app.argv[c], "-debug-start"));
+            else if(!strcmp(app.argv[c], "-debug-hide-ide"));
             else if(!strcmp(app.argv[c], "-debug-work-dir"))
                debugWorkDir = true;
             else if(!strcmp(app.argv[c], "-@"))
index 8e3d56e..57876ae 100644 (file)
@@ -148,6 +148,16 @@ public:
             ide.MenuDebugStart(ide.debugStartResumeItem, 0);
             ide.debugStart = false;
          }
+         else if(ide.debugHideIDE)
+         {
+            bool visible = ide.debugger.state != running;
+            if(ideMainFrame.visible != visible)
+            {
+               ideMainFrame.visible = visible;
+               if(visible)
+                  ideMainFrame.Activate();
+            }
+         }
          return true;
       }
    };