Changeset 200

Show
Ignore:
Timestamp:
12/26/06 01:44:41 (2 years ago)
Author:
Ant
Message:

catch DMD output to create and show list of error

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/leds/CodeView.d

    r191 r200  
    28382838                } 
    28392839                break; 
    2840             case CodeCommand.FIND: workspace.getFindAndReplace().show();    break; 
     2840            case CodeCommand.FIND: workspace.quickFind(); processed = true; break; 
     2841                                    //workspace.getFindAndReplace().show(); break; 
    28412842            case CodeCommand.CLOSE_BUFFER: workspace.closeView(); return true;  break; 
    28422843            case CodeCommand.FIND_NEXT: findText(codeEdit.getSelected(),false); break; 
  • trunk/src/leds/CompilerBox.d

    r187 r200  
    4747private import gtk.TreeModel; 
    4848private import gtk.TreeIter; 
     49private import gtk.TreeIterError; 
    4950private import gtk.TreePath; 
    5051private import gtk.TreeViewColumn; 
     
    6970class CompilerBox : VBox 
    7071{    
    71     TextView compilerView; 
    72     TextView linkerView; 
     72    TextView rawTextCommands; 
    7373    TreeView compilerMessages; 
    7474    TreeView linkerMessages; 
    7575    ListStore compilerModel; 
    76     ListStore linkerModel; 
    7776 
    7877    Toolbar toolbar; 
     
    8685    //Paned panedLinker; 
    8786     
    88     Notebook notebook; 
    89      
    9087    MetaTupleIF compilerHeader; 
    91     MetaTupleIF linkerHeader; 
    9288     
    9389    Workspace workspace; 
    94      
    95     this(Workspace workspace, MetaTupleIF compilerHeader=null, MetaTupleIF linkerHeader=null) 
    96     { 
    97        writefln("CompilerBox.this 1"); 
     90    Project project; 
     91     
     92    this(Workspace workspace, Project project, MetaTupleIF compilerHeader=null) 
     93    { 
    9894        super(false, 3); 
    99         writefln("CompilerBox.this 2"); 
    10095        this.workspace = workspace; 
    101         writefln("CompilerBox.this 3"); 
    102         setup(compilerHeader, linkerHeader); 
    103         writefln("CompilerBox.this 4"); 
    104     } 
    105      
    106      
     96        this.project = project; 
     97        setup(compilerHeader); 
     98    } 
     99 
     100    public void setProject(Project project) 
     101    { 
     102        this.project = project; 
     103    } 
     104     
     105 
     106 
     107    /** 
     108     * Sets all the errors and buffer to empty 
     109     */ 
    107110    void clearAll() 
    108111    { 
    109         compilerView.getBuffer().setText(""); 
     112        rawTextCommands.getBuffer().setText(""); 
    110113        compilerModel.clear(); 
    111         linkerView.getBuffer().setText(""); 
    112         linkerModel.clear(); 
    113         notebook.setCurrentPage(1); 
    114114        currErrorButton.setSensitive(false); 
    115115        prevErrorButton.setSensitive(false); 
    116116        nextErrorButton.setSensitive(false); 
    117117    } 
     118     
     119    /** 
     120     * Adds the raw compiler command to the raw input / output commands window 
     121     * Params: 
     122     *      compilerCommand =    
     123     */ 
    118124    void addCompilerCommand(String compilerCommand) 
    119125    { 
    120         compilerView.getBuffer().setText(compilerCommand.toString()); 
    121     } 
    122      
     126        rawTextCommands.getBuffer().setText(compilerCommand.toString()); 
     127    } 
     128     
     129    /** 
     130     * Adds the raw link command to the raw input / output commands window 
     131     * Params: 
     132     *      linkerCommand =      
     133     */ 
    123134    void addLinkerCommand(String linkerCommand) 
    124135    { 
    125         linkerView.getBuffer().setText(linkerCommand.toString()); 
    126     } 
    127      
     136        rawTextCommands.appendText(linkerCommand.toString()); 
     137    } 
     138     
     139    /** 
     140     * Adds and error that was already formated to the list model 
     141     * Params: 
     142     *      error =      
     143     */ 
    128144    void addCompilerError(ProjectError error) 
    129145    { 
     146         
    130147        currErrorButton.setSensitive(true); 
    131148        prevErrorButton.setSensitive(true); 
     
    156173    } 
    157174     
    158     protected void setup(MetaTupleIF compilerHeader=null, MetaTupleIF linkerHeader=null) 
     175    void addOuputLine(char[] line) 
     176    { 
     177        rawTextCommands.appendText(line); 
     178         
     179//      ProjectError error = new ProjectError( 
     180//                  project,  
     181//                  new String(),       //modulePath,  
     182//                  1,      //lineNumber,  
     183//                  new String(line),  
     184//                  ProjErrorType.ERROR 
     185//          ); 
     186//      addCompilerError(error); 
     187    } 
     188 
     189    /** 
     190     * Creates our components and builds the UI 
     191     * Params: 
     192     *      compilerHeader =     
     193     *      linkerHeader =   
     194     */ 
     195    protected void setup(MetaTupleIF compilerHeader=null) 
    159196    { 
    160197        if ( compilerHeader is null ) 
     
    162199            compilerHeader = getDMDCompilerHeader(); 
    163200        } 
    164         if ( linkerHeader is null ) 
    165         { 
    166             linkerHeader = getGCCLinkerHeader(); 
    167         } 
    168201 
    169202        this.compilerHeader = compilerHeader; 
    170         this.linkerHeader = linkerHeader; 
    171203         
    172204        compilerModel = createModel(compilerHeader); 
    173         linkerModel = createModel(linkerHeader); 
    174          
    175         compilerView = new TextView(); 
    176         linkerView = new TextView(); 
     205         
     206        rawTextCommands = new TextView(); 
    177207         
    178208        compilerMessages = createTreeView(compilerHeader, compilerModel); 
     
    180210        compilerMessages.addOnButtonRelease(&mouseButtonReleaseCallback); 
    181211 
    182         linkerMessages = createTreeView(linkerHeader, linkerModel); 
    183          
    184         writefln("CompilerBox.setup 1"); 
    185212        removeAll(); 
    186         writefln("CompilerBox.setup 1.1"); 
    187213         
    188214        toolbar = setupToolbar(); 
    189         writefln("CompilerBox.setup 1.2"); 
    190215         
    191216        packStart(toolbar, false, false, 0); 
    192         writefln("CompilerBox.setup 1.3"); 
    193  
    194         notebook = new Notebook(); 
    195         writefln("CompilerBox.setup 1.4"); 
    196         notebook.setTabPos(PositionType.LEFT); 
    197          
    198         writefln("CompilerBox.setup 2"); 
    199         ScrolledWindow scw = new ScrolledWindow(); 
    200         scw.setPolicy(PolicyType.AUTOMATIC, PolicyType.AUTOMATIC); 
    201         scw.add(compilerView); 
    202          
     217 
    203218        ScrolledWindow scm = new ScrolledWindow(); 
    204219        scm.setPolicy(PolicyType.AUTOMATIC, PolicyType.AUTOMATIC); 
    205220        scm.add(compilerMessages); 
    206221 
    207         notebook.appendPage(scw,"Comp in"); 
    208          
    209         notebook.appendPage(scm,"Comp out"); 
    210          
    211          
    212         ScrolledWindow slw = new ScrolledWindow(); 
    213         slw.setPolicy(PolicyType.AUTOMATIC, PolicyType.AUTOMATIC); 
    214         slw.add(linkerView); 
    215          
    216         ScrolledWindow slm = new ScrolledWindow(); 
    217         slm.setPolicy(PolicyType.AUTOMATIC, PolicyType.AUTOMATIC); 
    218         slm.add(linkerMessages); 
    219          
    220         writefln("CompilerBox.setup 3"); 
    221         notebook.appendPage(slw,"Link in"); 
    222         notebook.appendPage(slm,"Link out"); 
    223  
    224         packStart(notebook,true, true, 0); 
    225          
    226         writefln("CompilerBox.setup 4"); 
    227     } 
    228  
     222        packStart(scm,true, true, 0); 
     223    } 
     224 
     225    /** 
     226     * Creates the user tools 
     227     * Returns:  
     228     *          Toolbar 
     229     */ 
    229230    Toolbar setupToolbar() 
    230231    { 
     
    241242        } 
    242243             
    243         //addButton(Stock.QUIT,"Close", &quit); 
    244          
    245244        currErrorButton = cast(Button)toolbar.insertButton(StockID.JUMP_TO,"Current Error","",-1); 
    246245        currErrorButton.addOnClicked(&gotoCurrError); 
     
    259258        } 
    260259             
    261         //addButton(StockID.DIALOG_INFO,"Show compiler command", &showCompilerCommand); 
    262         //addButton(StockID.DIALOG_INFO,"Show compiler messages", &showCompilerMessages); 
    263         //addButton(StockID.DIALOG_INFO,"Show linker command", &showLinkerCommand); 
    264         //addButton(StockID.DIALOG_INFO,"Show linker messages", &showLinkerMessages); 
     260        addButton(StockID.DIALOG_INFO,"Show show raw input/output", &showRawCommands); 
    265261         
    266262        return toolbar; 
    267263         
    268     } 
    269      
    270     void quit(Button button) 
    271     { 
    272264    } 
    273265     
     
    303295    } 
    304296     
    305     void showCompilerCommand(Button button) 
    306     { 
    307     } 
    308      
    309     void showCompilerMessages(Button button) 
    310     { 
    311     } 
    312      
    313     void showLinkerCommand(Button button) 
    314     { 
    315     } 
    316      
    317     void showLinkerMessages(Button button) 
    318     { 
    319     } 
    320      
    321  
     297    void showRawCommands(Button button) 
     298    { 
     299        // todo popup a simple text window with all the input and output text 
     300    } 
     301     
    322302    CompilerBox setCompileCommand(String compileCommand) 
    323303    { 
     
    337317    } 
    338318 
    339     MetaTupleIF getGCCLinkerHeader() 
    340     { 
    341         MetaTuple header = new MetaTuple(); 
    342         header.addColumn(new String("Type"), SQLType.TEXT); 
    343         header.addColumn(new String("Project"), SQLType.TEXT); 
    344         header.addColumn(new String("Package"), SQLType.TEXT); 
    345         header.addColumn(new String("Source"), SQLType.TEXT); 
    346         header.addColumn(new String("Error"), SQLType.TEXT); 
    347         return header; 
    348     } 
    349  
    350      
     319    /** 
     320     * Creates the tree view for the errors list 
     321     */ 
    351322    TreeView createTreeView(MetaTupleIF header, TreeModel model) 
    352323    { 
     
    371342    } 
    372343     
     344    /** 
     345     * Creates the model for the errors list 
     346     * Params: 
     347     *      header =     
     348     * Returns:  
     349     *      ListStore 
     350     */ 
    373351    ListStore createModel(MetaTupleIF header) 
    374352    { 
     
    396374    } 
    397375 
     376    /** 
     377     * Opens the source code that generated the error 
     378     * Params: 
     379     *      iter =   
     380     */ 
    398381    void gotoSourceCode(TreeIter iter) 
    399382    { 
    400383        if ( iter !is null ) 
    401384        { 
    402             Project project = workspace.getProjectView().getProject(new String(iter.getValueString(1))); 
    403             String modulePath = Path.join(iter.getValueString(2),iter.getValueString(3)); 
    404             if ( project !is null ) 
     385            try 
    405386            { 
    406                 modulePath = Path.join(project.getBaseDirSrc(),modulePath); 
     387                Project project = workspace.getProjectView().getProject(new String(iter.getValueString(1))); 
     388                String modulePath = Path.join(iter.getValueString(2),iter.getValueString(3)); 
     389                if ( modulePath !is null && modulePath.length > 0 ) 
     390                { 
     391                    if ( project !is null ) 
     392                    { 
     393                        modulePath = Path.join(project.getBaseDirSrc(),modulePath); 
     394                    } 
     395                    FileView fileView = workspace.openFile(modulePath, project, false); 
     396                    if ( fileView !is null ) 
     397                    { 
     398                        try 
     399                        { 
     400                            int line = Integer.toInt(iter.getValueString(4)); 
     401                            printf("CompilerBox.mouseClickAction line number %d =  \n", line); 
     402                            fileView.gotoLine(line); 
     403                        } 
     404                        catch ( NumberError ne ) 
     405                        { 
     406                            // ignore 
     407                        } 
     408                        fileView.grabFocus(); 
     409                    } 
     410                } 
    407411            } 
    408             FileView fileView = workspace.openFile(modulePath, project, false); 
    409             if ( fileView !is null ) 
     412            catch ( TreeIterError tie ) 
    410413            { 
    411                 try 
    412                 { 
    413                     int line = Integer.toInt(iter.getValueString(4)); 
    414                     printf("CompilerBox.mouseClickAction line number %d =  \n", line); 
    415                     fileView.gotoLine(line); 
    416                 } 
    417                 catch ( NumberError ne ) 
    418                 { 
    419                     // ignore 
    420                 } 
    421                 fileView.grabFocus(); 
     414                // just don't jump 
    422415            } 
    423416        } 
  • trunk/src/leds/ExecConsole.d

    r187 r200  
    6060//  } 
    6161     
    62     Widget getWidget() 
    63     { 
    64         return this; 
    65     } 
    66      
    6762    Menu getTabMenu() 
    6863    { 
     
    8277     * detrimines if a close button shoud be visible 
    8378     */ 
    84     bit allowCloseButton() 
     79    bool allowCloseButton() 
    8580    { 
    8681        return false; 
    8782    } 
    8883 
    89     bit allowClose() 
    90     { 
    91         return !executing; 
    92     } 
    93      
    94     bit allowClose(bit askUser) 
     84    bit allowClose(bit askUser=false) 
    9585    { 
    9686        if ( executing ) 
  • trunk/src/leds/LanguageD.d

    r199 r200  
    642642            " enum double dchar short int long ifloat idouble ireal float" 
    643643        //); 
    644         //send(SCI_SETKEYWORDS, 1, cast(sptr_t)(char*) 
     644        //scintilla.send(SCI_SETKEYWORDS, 1, cast(sptr_t)cast(char*) 
    645645            " typedef abstract auto deprecated final struct interface class synchronized" 
    646             " cast in out inout static private protected public volatile invariant
     646            " cast in out inout static private protected public volatile invariant template mixin
    647647        //); 
    648         //send(SCI_SETKEYWORDS, DLexTypes.ERROR, cast(sptr_t)(char*) 
     648        //scintilla.send(SCI_SETKEYWORDS, SCE_C_WORD2/*scintilla.DLexTypes.ERROR*/, cast(sptr_t)cast(char*) 
    649649            " throw try assert catch finally true false null" 
    650650        //); 
    651         //send(SCI_SETKEYWORDS, DLexTypes.HEADER, cast(sptr_t)(char*) 
     651        //scintilla.send(SCI_SETKEYWORDS, DLexTypes.HEADER, cast(sptr_t)(char*) 
    652652            " const alias module export import extern debug align asm version" 
    653653        //); 
    654         //send(SCI_SETKEYWORDS, DLexTypes.FLOW, cast(sptr_t)(char*) 
     654        //scintilla.send(SCI_SETKEYWORDS, DLexTypes.FLOW, cast(sptr_t)(char*) 
    655655            " body break continue case default do else if switch for foreach return goto while with" 
    656656        //); 
    657         //send(SCI_SETKEYWORDS, DLexTypes.INHER, cast(sptr_t)(char*) 
     657        //scintilla.send(SCI_SETKEYWORDS, DLexTypes.INHER, cast(sptr_t)(char*) 
    658658            " delegate function  this super new delete override " 
    659659        ); 
     
    664664    } 
    665665 
    666     void setDColors(Scintilla scintilla
     666    void setDColors(Scintilla scintilla
    667667    { 
    668668        //SCE_C_DEFAULT=0; 
     
    729729        //printf("setDLex 4\n"); 
    730730 
     731         
     732        //scintilla.send(SCI_STYLESETFORE, 1 , 0x800000); 
     733         
    731734        //printf("setDLex 5\n"); 
    732735        //send(SCI_STYLESETFORE, DLexTypes.TYPES , 0x800000); 
  • trunk/src/leds/Project.d

    r199 r200  
    3838private import leds.Leds; 
    3939private import leds.Workspace; 
    40 private import leds.ExecConsole; 
     40private import leds.BuildConsole; 
    4141private import leds.Docker; 
    4242private import leds.SystemConsole; 
     
    238238    public void addCompileErrors(String moduleName) 
    239239    { 
    240         compileErrors[moduleName] = true; 
     240        compileErrors[moduleName.dup] = true; 
    241241        if ( compileErrors.length == 1 ) 
    242242        { 
     
    567567        ProjectTarget target; 
    568568         
    569         ExecConsole execConsole; 
     569        BuildConsole buildConsole; 
    570570        CompilerBox compilerBox; 
    571571         
     
    576576            target.setNativeTargetPlatform(); 
    577577             
    578             execConsole = project.workspace.getConsole( 
     578            buildConsole = project.workspace.getBuildConsole( 
     579                project, 
    579580                new String("build ")~target.getTarget(), 
    580581                &mouseReleaseOnConsole 
    581582                ); 
    582             execConsole.clearWidget(); 
     583            buildConsole.clearWidget(); 
    583584            Path.chdir(project.getBaseDir()); 
    584585 
    585           if ( Leds.leds.getPropValue("popupBuildOutput",true) ) 
    586           { 
    587               project.compilerWindow = project.workspace.getCompilerWindow(); 
    588               compilerBox = project.compilerWindow.getCompilerBox(); 
    589               compilerBox.clearAll(); 
    590               //compilerBox.addCompilerCommand(compCom); 
    591           } 
     586//            if ( Leds.leds.getPropValue("popupBuildOutput",true) ) 
     587//            { 
     588//                project.compilerWindow = project.workspace.getCompilerWindow(); 
     589//                compilerBox = project.compilerWindow.getCompilerBox(); 
     590//                compilerBox.clearAll(); 
     591//                //compilerBox.addCompilerCommand(compCom); 
     592//            } 
    592593        } 
    593594 
     
    626627            gdkThreadsEnter(); 
    627628             
    628             writefln("TargetBuilder.compOutputReader 1 >>>%s<<<", inLine); 
    629629            String line = new String(inLine); 
    630630            if( line.strip().length > 0 ) 
     
    634634                projectError = new ProjectError( 
    635635                    project,  
    636                     modulePath,  
     636                    modulePath.dup,  
    637637                    lineNumber,  
    638638                    line,  
    639639                    ProjErrorType.ERROR); 
    640               if ( Leds.leds.getPropValue("popupBuildOutput",true) ) 
    641               { 
    642                   compilerBox.addCompilerError(projectError); 
    643               } 
     640//                if ( Leds.leds.getPropValue("popupBuildOutput",true) ) 
     641//                { 
     642//                    compilerBox.addCompilerError(projectError); 
     643//                } 
    644644                if ( lineNumber > 0 ) 
    645645                { 
    646646                    if ( modulePath.length>0 ) 
    647647                    { 
    648                         project.addProjectError(projectError); 
     648                        bool added = project.addProjectError(projectError); 
     649                        if ( added && buildConsole !is null ) 
     650                        { 
     651                            buildConsole.append(projectError); 
     652                        } 
    649653                    } 
    650654                } 
     
    659663        { 
    660664            gdkThreadsEnter(); 
    661              
    662             writefln("TargetBuilder.compErrorReader 1 >>>%s<<<", line); 
    663665             
    664666            Gdk.flush(); 
     
    730732        private void setupCompiler(ProjectTarget target) 
    731733        { 
    732             writefln("Project.TragerBuilder_compd compiling with compd"); 
    733734            compiler = new Compiler(); 
    734735            char[] baseSrc = target.getBaseDir.toString(); 
     
    785786        public bool execute(char[] compilerCommand, void delegate(int) executionEnded) 
    786787        { 
    787             writefln("\nPeojectTargetBuilder_compd target)=\n%s\n", compilerCommand); 
    788             if ( Leds.leds.getPropValue("popupBuildOutput",true) ) 
    789             { 
    790                 compilerBox.addCompilerCommand(new String(compilerCommand)); 
    791             } 
    792             execConsole.exec( 
     788//          if ( Leds.leds.getPropValue("popupBuildOutput",true) ) 
     789//          { 
     790//              compilerBox.addCompilerCommand(new String(compilerCommand)); 
     791//          } 
     792            buildConsole.exec( 
    793793                project.getBaseDir(),  
    794794                new String(compilerCommand), 
     
    803803                executionEnded(execStatus); 
    804804            } 
    805             execStatus = execConsole.exitStatus; 
    806             return execConsole.exitStatus == 0; 
     805            execStatus = buildConsole.exitStatus; 
     806            return buildConsole.exitStatus == 0; 
    807807        } 
    808808         
     
    868868                String compCom = target.getCompilerCommand(); 
    869869     
    870                 execConsole.exec( 
     870                buildConsole.exec( 
    871871                    target.getBaseDirSrc(),  
    872872                    compCom, 
     
    888888        bool linkTarget(Spawn spawn) 
    889889        { 
    890             writefln("Project.linkTarget entry"); 
    891890            gdkThreadsEnter(); 
    892891             
     
    894893            { 
    895894                String linkCom = target.getLinkCommand(); 
    896               if ( Leds.leds.getPropValue("popupBuildOutput",true) ) 
    897               { 
    898                   compilerBox.addLinkerCommand(linkCom); 
    899               } 
     895//                if ( Leds.leds.getPropValue("popupBuildOutput",true) ) 
     896//                { 
     897//                    compilerBox.addLinkerCommand(linkCom); 
     898//                } 
    900899                Path.chdir(project.getBaseDir()); 
    901                 execConsole.exec(target.getBaseDirObj(), linkCom, 
     900                buildConsole.exec(target.getBaseDirObj(), linkCom, 
    902901                    true, 
    903902                    &endLink, 
     
    905904                    &linkErrorReader 
    906905                    ); 
    907                 //execConsole.exec(new String("."), linkCom, true); 
     906                //buildConsole.exec(new String("."), linkCom, true); 
    908907            } 
    909908            //if ( lastP_OpenExitStatus != 0 ) 
    910909            { 
    911                 project.workspace.refreshDockableLabel(execConsole); 
     910                project.workspace.refreshDockableLabel(buildConsole); 
    912911                project.workspace.getProjectView().setProjectStatus(project); 
    913912            } 
     
    949948        ProjectError projectError; 
    950949        CompilerBox compilerBox; 
    951       if ( Leds.leds.getPropValue("popupBuildOutput",true) ) 
    952       { 
    953           compilerBox = compilerWindow.getCompilerBox(); 
    954       } 
     950//        if ( Leds.leds.getPropValue("popupBuildOutput",true) ) 
     951//        { 
     952//            compilerBox = compilerWindow.getCompilerBox(); 
     953//        } 
    955954        foreach ( String line ; grabOutput.splitLines() ) 
    956955        { 
     
    961960                projectError = new ProjectError( 
    962961                    this,  
    963                     modulePath,  
     962                    modulePath.dup,  
    964963                    lineNumber,  
    965964                    line,  
    966965                    ProjErrorType.ERROR); 
    967               if ( Leds.leds.getPropValue("popupBuildOutput",true) ) 
    968               { 
    969                   compilerBox.addCompilerError(projectError); 
    970               } 
     966//                if ( Leds.leds.getPropValue("popupBuildOutput",true) ) 
     967//                { 
     968//                    compilerBox.addCompilerError(projectError); 
     969//                } 
    971970                if ( lineNumber > 0 ) 
    972971                { 
     
    10021001            if ( target.exec ) 
    10031002            { 
    1004                  
    1005                 writefln("Project.getRunMenu %s %s ", target.getTarget(), target.getRunParameters()); 
    1006                  
    10071003                popupMenu.append( 
    10081004                    new MenuItem( 
     
    10331029        if ( target !is null ) 
    10341030        { 
    1035             run(target.getRunParameters(), true, new String("run ")~target.targetName); 
     1031            run(target.getRunParameters(), Leds.leds.getPropValue("newOnRun", false), new String("run ")~target.targetName); 
    10361032        } 
    10371033    } 
     
    11961192    public void build(bit newConsole) 
    11971193    { 
     1194         
     1195        writefln("- Project.build"); 
    11981196        //if ( getCurrTarget(props.get("lastTarget","")) !is null ) 
    11991197        //{ 
     
    12231221                int exitStatus; 
    12241222                //workspace.getErrorPane().drawNow(); 
    1225               if ( Leds.leds.getPropValue("popupBuildOutput",true) ) 
    1226               { 
    1227                   compilerWindow = workspace.getCompilerWindow(); 
    1228                   CompilerBox compilerBox = compilerWindow.getCompilerBox(); 
    1229                   compilerBox.clearAll(); 
    1230                   compilerBox.addCompilerCommand(buildCommand); 
    1231               } 
     1223//                if ( Leds.leds.getPropValue("popupBuildOutput",true) ) 
     1224//                { 
     1225//                    compilerWindow = workspace.getCompilerWindow(); 
     1226//                    CompilerBox compilerBox = compilerWindow.getCompilerBox(); 
     1227//                    compilerBox.clearAll(); 
     1228//                    compilerBox.addCompilerCommand(buildCommand); 
     1229//                } 
    12321230                if ( newConsole ) 
    12331231                { 
    1234                     ExecConsole execConsole = new ExecConsole(workspace,buildCommand); 
    1235                     workspace.addConsole(execConsole); 
    1236                     execConsole.exec( 
     1232                    BuildConsole buildConsole = new BuildConsole(workspace,this, buildCommand); 
     1233                    workspace.addConsole(buildConsole); 
     1234                    buildConsole.exec( 
    12371235                        getBaseDir(), 
    12381236                        buildCommand 
     
    13551353    } 
    13561354 
    1357     public void addProjectError(ProjectError projectError) 
    1358     { 
     1355    /** 
     1356     * Finds if the error already exists 
     1357     * Params: 
     1358     *      projectError =   
     1359     */ 
     1360    public bool findError(ProjectError projectError) 
     1361    { 
     1362        bool found = false; 
     1363        String fileName = projectError.getFileName(); 
     1364         
     1365        Project project = projectError.project; 
     1366         
     1367        if ( (fileName in projectErrors) !is null ) 
     1368        { 
     1369            int lineNumber = projectError.lineNumber; 
     1370            String message = projectError.message; 
     1371            int errorType = projectError.errorType; 
     1372             
     1373            foreach ( ProjectError error ; projectErrors[fileName] ) 
     1374            { 
     1375                if ( error.getFileName() == fileName  
     1376                     && error.lineNumber == lineNumber 
     1377                     && error.message == message 
     1378                     && error.errorType == errorType 
     1379                    ) 
     1380                { 
     1381                    found = true; 
     1382                    break; 
     1383                } 
     1384            } 
     1385        } 
     1386        else 
     1387        { 
     1388        } 
     1389         
     1390        return found; 
     1391    } 
     1392     
     1393    public bool addProjectError(ProjectError projectError) 
     1394    { 
     1395         
     1396        if ( findError(projectError) ) 
     1397        { 
     1398            return false; 
     1399        } 
    13591400        ProjectError[] moduleErrors; 
    13601401        String fileName = projectError.getFileName(); 
     
    13701411            projectErrors[fileName] = moduleErrors; 
    13711412        } 
     1413        return true; 
    13721414    } 
    13731415     
  • trunk/src/leds/ProjectError.d

    r74 r200  
    2121private import dool.String; 
    2222private import leds.Project; 
    23      
     23 
     24private import std.stdio; 
     25 
    2426public enum ProjErrorType 
    2527{ 
     
    4446    { 
    4547        this.project = project; 
    46         this.fileName = fileName
     48        this.fileName = fileName.dup
    4749        this.lineNumber = lineNumber; 
    4850        this.message = message; 
     
    6264    public String getFileName() 
    6365    { 
    64         return fileName
     66        return fileName.dup
    6567    } 
    6668     
  • trunk/src/leds/SystemConsole.d

    r199 r200  
    7272 
    7373    void delegate(String)[] mouseActionButtonListeners; 
     74     
    7475 
    7576    /** 
     
    8081    { 
    8182        this.workspace = workspace; 
     83        setPolicy(PolicyType.AUTOMATIC, PolicyType.AUTOMATIC); 
    8284        tabName = new String("output"); 
    83         setPolicy(PolicyType.AUTOMATIC, PolicyType.AUTOMATIC); 
     85        setup(); 
     86        showAll(); 
     87    } 
     88     
     89    protected void setup() 
     90    { 
    8491        textView = new TextView(); 
    85         setBGColor(Leds.leds.getPropValue("d.background",0x000000)); 
     92        setBGColor(Leds.leds.getPropValue("d.background",0xF0F0F0)); 
    8693        setFont(); 
    8794        add(textView); 
    8895        //textView.addOnButtonPress(&onMouseButtonPress); 
    8996        textView.addOnButtonRelease(&onMouseButtonRelease); 
    90         showAll(); 
    91     } 
    92  
     97    } 
     98 
     99    String getLineTextAt(int y) 
     100    { 
     101        return new String(textView.getLineTextAt(y)); 
     102    } 
     103     
     104    protected char[] getSelectedLine(GdkEventButton* event) 
     105    { 
     106        return textView.getLineTextAt(cast(int)event.y); 
     107    } 
     108     
    93109    int onMouseButtonPress(GdkEventButton* event, Widget widget) 
    94110    { 
    95         char[] textLine = textView.getLineTextAt(cast(int)event.y); 
     111        char[] textLine = getSelectedLine(event); 
    96112        if ( event.button == 1 && Event.isDoubleClick(event, 1) ) 
    97113        { 
     
    105121    int onMouseButtonRelease(GdkEventButton* event, Widget widget) 
    106122    { 
    107         char[] textLine = textView.getLineTextAt(cast(int)event.y); 
     123        char[] textLine = getSelectedLine(event); 
    108124        if ( event.button == 2 ) 
    109125        { 
     
    132148            workspace.refreshDockableLabel(this); 
    133149        } 
    134     } 
    135      
    136     String getLineTextAt(int y) 
    137     { 
    138         return new String(textView.getLineTextAt(y)); 
    139150    } 
    140151     
     
    278289    { 
    279290        //writefln("%s", text); 
    280         textView.appendText(text); 
     291        if ( textView !is null ) 
     292        { 
     293            textView.appendText(text); 
     294        } 
    281295    } 
    282296     
     
    286300    } 
    287301 
     302    public void appendCommand(String command) 
     303    { 
     304        append(command); 
     305    } 
     306     
    288307//  public int exec(String workDir, String command, bit async = false) 
    289308//  { 
     
    343362        Path.chdir(workDir); 
    344363        command = expandCommand(command); 
    345         append("\n> ("~Path.getcwd()~") Executing >(after)>\n"~command~"\n"); 
     364        appendCommand("\n> ("~Path.getcwd()~") Executing >(after)>\n"~command~"\n"); 
    346365        char[][] commArgs; 
    347366        foreach ( String str ; command.split()) 
     
    503522    } 
    504523 
    505 }; 
     524} 
  • trunk/src/leds/Workspace.d

    r199 r200  
    3737private import leds.SystemConsole; 
    3838private import leds.ExecConsole; 
     39private import leds.BuildConsole; 
    3940private import leds.Docker; 
    4041private import leds.DockerFiles; 
     
    719720            findTextCombo = new ComboBoxEntry(); 
    720721            findTextCombo.maxCount = 16; 
    721             findTextCombo.addOnKeyRelease(&keyRelease); 
     722            findTextCombo.addOnKeyPress(&findComboBoxKeyPress); 
     723            findTextCombo.addOnKeyRelease(&findComboBoxKeyRelease); 
    722724        } 
    723725        ToolItem toolItem = new ToolItem(); 
     
    764766            if ( fileName != "" ) 
    765767            { 
    766                 writefln("Workspace.MakeNow 1"); 
    767768                ExecConsole execConsole = new ExecConsole(this,"dmd "~fileName.toString()); 
    768                 writefln("Workspace.MakeNow 2"); 
    769769                addConsole(execConsole); 
    770                 writefln("Workspace.MakeNow 3"); 
    771770                execConsole.exec(Path.getcwd(),fileName.dup.prepend("dmd ")~" -I~/dmd/src/phobos"); 
    772                 writefln("Workspace.MakeNow 4"); 
    773771            } 
    774772        } 
     
    844842    public int makeSelectTarget(GdkEventButton*  event, Widget widget) 
    845843    { 
    846         writefln("Workspace.makeSelectTarget 1"); 
    847844        Project project = getProjectView().getCurrentProject(); 
    848         writefln("Workspace.makeSelectTarget 2"); 
    849845        switch ( event.button ) 
    850846        { 
    851847            case 1: 
    852         writefln("Workspace.makeSelectTarget 3"); 
    853848                //project.build(true); 
    854849                makeNow(project); 
     
    856851             
    857852            case 3: 
    858         writefln("Workspace.makeSelectTarget 4"); 
    859853                //if ( project  !is  null ) 
    860854                { 
     
    863857