Changeset 200
- Timestamp:
- 12/26/06 01:44:41 (2 years ago)
- Files:
-
- trunk/src/leds/CodeView.d (modified) (1 diff)
- trunk/src/leds/CompilerBox.d (modified) (12 diffs)
- trunk/src/leds/ExecConsole.d (modified) (2 diffs)
- trunk/src/leds/LanguageD.d (modified) (3 diffs)
- trunk/src/leds/Project.d (modified) (22 diffs)
- trunk/src/leds/ProjectError.d (modified) (3 diffs)
- trunk/src/leds/SystemConsole.d (modified) (8 diffs)
- trunk/src/leds/Workspace.d (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/leds/CodeView.d
r191 r200 2838 2838 } 2839 2839 break; 2840 case CodeCommand.FIND: workspace.getFindAndReplace().show(); break; 2840 case CodeCommand.FIND: workspace.quickFind(); processed = true; break; 2841 //workspace.getFindAndReplace().show(); break; 2841 2842 case CodeCommand.CLOSE_BUFFER: workspace.closeView(); return true; break; 2842 2843 case CodeCommand.FIND_NEXT: findText(codeEdit.getSelected(),false); break; trunk/src/leds/CompilerBox.d
r187 r200 47 47 private import gtk.TreeModel; 48 48 private import gtk.TreeIter; 49 private import gtk.TreeIterError; 49 50 private import gtk.TreePath; 50 51 private import gtk.TreeViewColumn; … … 69 70 class CompilerBox : VBox 70 71 { 71 TextView compilerView; 72 TextView linkerView; 72 TextView rawTextCommands; 73 73 TreeView compilerMessages; 74 74 TreeView linkerMessages; 75 75 ListStore compilerModel; 76 ListStore linkerModel;77 76 78 77 Toolbar toolbar; … … 86 85 //Paned panedLinker; 87 86 88 Notebook notebook;89 90 87 MetaTupleIF compilerHeader; 91 MetaTupleIF linkerHeader;92 88 93 89 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 { 98 94 super(false, 3); 99 writefln("CompilerBox.this 2");100 95 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 */ 107 110 void clearAll() 108 111 { 109 compilerView.getBuffer().setText("");112 rawTextCommands.getBuffer().setText(""); 110 113 compilerModel.clear(); 111 linkerView.getBuffer().setText("");112 linkerModel.clear();113 notebook.setCurrentPage(1);114 114 currErrorButton.setSensitive(false); 115 115 prevErrorButton.setSensitive(false); 116 116 nextErrorButton.setSensitive(false); 117 117 } 118 119 /** 120 * Adds the raw compiler command to the raw input / output commands window 121 * Params: 122 * compilerCommand = 123 */ 118 124 void addCompilerCommand(String compilerCommand) 119 125 { 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 */ 123 134 void addLinkerCommand(String linkerCommand) 124 135 { 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 */ 128 144 void addCompilerError(ProjectError error) 129 145 { 146 130 147 currErrorButton.setSensitive(true); 131 148 prevErrorButton.setSensitive(true); … … 156 173 } 157 174 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) 159 196 { 160 197 if ( compilerHeader is null ) … … 162 199 compilerHeader = getDMDCompilerHeader(); 163 200 } 164 if ( linkerHeader is null )165 {166 linkerHeader = getGCCLinkerHeader();167 }168 201 169 202 this.compilerHeader = compilerHeader; 170 this.linkerHeader = linkerHeader;171 203 172 204 compilerModel = createModel(compilerHeader); 173 linkerModel = createModel(linkerHeader); 174 175 compilerView = new TextView(); 176 linkerView = new TextView(); 205 206 rawTextCommands = new TextView(); 177 207 178 208 compilerMessages = createTreeView(compilerHeader, compilerModel); … … 180 210 compilerMessages.addOnButtonRelease(&mouseButtonReleaseCallback); 181 211 182 linkerMessages = createTreeView(linkerHeader, linkerModel);183 184 writefln("CompilerBox.setup 1");185 212 removeAll(); 186 writefln("CompilerBox.setup 1.1");187 213 188 214 toolbar = setupToolbar(); 189 writefln("CompilerBox.setup 1.2");190 215 191 216 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 203 218 ScrolledWindow scm = new ScrolledWindow(); 204 219 scm.setPolicy(PolicyType.AUTOMATIC, PolicyType.AUTOMATIC); 205 220 scm.add(compilerMessages); 206 221 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 */ 229 230 Toolbar setupToolbar() 230 231 { … … 241 242 } 242 243 243 //addButton(Stock.QUIT,"Close", &quit);244 245 244 currErrorButton = cast(Button)toolbar.insertButton(StockID.JUMP_TO,"Current Error","",-1); 246 245 currErrorButton.addOnClicked(&gotoCurrError); … … 259 258 } 260 259 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); 265 261 266 262 return toolbar; 267 263 268 }269 270 void quit(Button button)271 {272 264 } 273 265 … … 303 295 } 304 296 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 322 302 CompilerBox setCompileCommand(String compileCommand) 323 303 { … … 337 317 } 338 318 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 */ 351 322 TreeView createTreeView(MetaTupleIF header, TreeModel model) 352 323 { … … 371 342 } 372 343 344 /** 345 * Creates the model for the errors list 346 * Params: 347 * header = 348 * Returns: 349 * ListStore 350 */ 373 351 ListStore createModel(MetaTupleIF header) 374 352 { … … 396 374 } 397 375 376 /** 377 * Opens the source code that generated the error 378 * Params: 379 * iter = 380 */ 398 381 void gotoSourceCode(TreeIter iter) 399 382 { 400 383 if ( iter !is null ) 401 384 { 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 405 386 { 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 } 407 411 } 408 FileView fileView = workspace.openFile(modulePath, project, false); 409 if ( fileView !is null ) 412 catch ( TreeIterError tie ) 410 413 { 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 422 415 } 423 416 } trunk/src/leds/ExecConsole.d
r187 r200 60 60 // } 61 61 62 Widget getWidget()63 {64 return this;65 }66 67 62 Menu getTabMenu() 68 63 { … … 82 77 * detrimines if a close button shoud be visible 83 78 */ 84 b itallowCloseButton()79 bool allowCloseButton() 85 80 { 86 81 return false; 87 82 } 88 83 89 bit allowClose() 90 { 91 return !executing; 92 } 93 94 bit allowClose(bit askUser) 84 bit allowClose(bit askUser=false) 95 85 { 96 86 if ( executing ) trunk/src/leds/LanguageD.d
r199 r200 642 642 " enum double dchar short int long ifloat idouble ireal float" 643 643 //); 644 //s end(SCI_SETKEYWORDS, 1, cast(sptr_t)(char*)644 //scintilla.send(SCI_SETKEYWORDS, 1, cast(sptr_t)cast(char*) 645 645 " 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" 647 647 //); 648 //s end(SCI_SETKEYWORDS, DLexTypes.ERROR, cast(sptr_t)(char*)648 //scintilla.send(SCI_SETKEYWORDS, SCE_C_WORD2/*scintilla.DLexTypes.ERROR*/, cast(sptr_t)cast(char*) 649 649 " throw try assert catch finally true false null" 650 650 //); 651 //s end(SCI_SETKEYWORDS, DLexTypes.HEADER, cast(sptr_t)(char*)651 //scintilla.send(SCI_SETKEYWORDS, DLexTypes.HEADER, cast(sptr_t)(char*) 652 652 " const alias module export import extern debug align asm version" 653 653 //); 654 //s end(SCI_SETKEYWORDS, DLexTypes.FLOW, cast(sptr_t)(char*)654 //scintilla.send(SCI_SETKEYWORDS, DLexTypes.FLOW, cast(sptr_t)(char*) 655 655 " body break continue case default do else if switch for foreach return goto while with" 656 656 //); 657 //s end(SCI_SETKEYWORDS, DLexTypes.INHER, cast(sptr_t)(char*)657 //scintilla.send(SCI_SETKEYWORDS, DLexTypes.INHER, cast(sptr_t)(char*) 658 658 " delegate function this super new delete override " 659 659 ); … … 664 664 } 665 665 666 void setDColors(Scintilla scintilla )666 void setDColors(Scintilla scintilla ) 667 667 { 668 668 //SCE_C_DEFAULT=0; … … 729 729 //printf("setDLex 4\n"); 730 730 731 732 //scintilla.send(SCI_STYLESETFORE, 1 , 0x800000); 733 731 734 //printf("setDLex 5\n"); 732 735 //send(SCI_STYLESETFORE, DLexTypes.TYPES , 0x800000); trunk/src/leds/Project.d
r199 r200 38 38 private import leds.Leds; 39 39 private import leds.Workspace; 40 private import leds. ExecConsole;40 private import leds.BuildConsole; 41 41 private import leds.Docker; 42 42 private import leds.SystemConsole; … … 238 238 public void addCompileErrors(String moduleName) 239 239 { 240 compileErrors[moduleName ] = true;240 compileErrors[moduleName.dup] = true; 241 241 if ( compileErrors.length == 1 ) 242 242 { … … 567 567 ProjectTarget target; 568 568 569 ExecConsole execConsole;569 BuildConsole buildConsole; 570 570 CompilerBox compilerBox; 571 571 … … 576 576 target.setNativeTargetPlatform(); 577 577 578 execConsole = project.workspace.getConsole( 578 buildConsole = project.workspace.getBuildConsole( 579 project, 579 580 new String("build ")~target.getTarget(), 580 581 &mouseReleaseOnConsole 581 582 ); 582 execConsole.clearWidget();583 buildConsole.clearWidget(); 583 584 Path.chdir(project.getBaseDir()); 584 585 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 // } 592 593 } 593 594 … … 626 627 gdkThreadsEnter(); 627 628 628 writefln("TargetBuilder.compOutputReader 1 >>>%s<<<", inLine);629 629 String line = new String(inLine); 630 630 if( line.strip().length > 0 ) … … 634 634 projectError = new ProjectError( 635 635 project, 636 modulePath ,636 modulePath.dup, 637 637 lineNumber, 638 638 line, 639 639 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 // } 644 644 if ( lineNumber > 0 ) 645 645 { 646 646 if ( modulePath.length>0 ) 647 647 { 648 project.addProjectError(projectError); 648 bool added = project.addProjectError(projectError); 649 if ( added && buildConsole !is null ) 650 { 651 buildConsole.append(projectError); 652 } 649 653 } 650 654 } … … 659 663 { 660 664 gdkThreadsEnter(); 661 662 writefln("TargetBuilder.compErrorReader 1 >>>%s<<<", line);663 665 664 666 Gdk.flush(); … … 730 732 private void setupCompiler(ProjectTarget target) 731 733 { 732 writefln("Project.TragerBuilder_compd compiling with compd");733 734 compiler = new Compiler(); 734 735 char[] baseSrc = target.getBaseDir.toString(); … … 785 786 public bool execute(char[] compilerCommand, void delegate(int) executionEnded) 786 787 { 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( 793 793 project.getBaseDir(), 794 794 new String(compilerCommand), … … 803 803 executionEnded(execStatus); 804 804 } 805 execStatus = execConsole.exitStatus;806 return execConsole.exitStatus == 0;805 execStatus = buildConsole.exitStatus; 806 return buildConsole.exitStatus == 0; 807 807 } 808 808 … … 868 868 String compCom = target.getCompilerCommand(); 869 869 870 execConsole.exec(870 buildConsole.exec( 871 871 target.getBaseDirSrc(), 872 872 compCom, … … 888 888 bool linkTarget(Spawn spawn) 889 889 { 890 writefln("Project.linkTarget entry");891 890 gdkThreadsEnter(); 892 891 … … 894 893 { 895 894 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 // } 900 899 Path.chdir(project.getBaseDir()); 901 execConsole.exec(target.getBaseDirObj(), linkCom,900 buildConsole.exec(target.getBaseDirObj(), linkCom, 902 901 true, 903 902 &endLink, … … 905 904 &linkErrorReader 906 905 ); 907 // execConsole.exec(new String("."), linkCom, true);906 //buildConsole.exec(new String("."), linkCom, true); 908 907 } 909 908 //if ( lastP_OpenExitStatus != 0 ) 910 909 { 911 project.workspace.refreshDockableLabel( execConsole);910 project.workspace.refreshDockableLabel(buildConsole); 912 911 project.workspace.getProjectView().setProjectStatus(project); 913 912 } … … 949 948 ProjectError projectError; 950 949 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 // } 955 954 foreach ( String line ; grabOutput.splitLines() ) 956 955 { … … 961 960 projectError = new ProjectError( 962 961 this, 963 modulePath ,962 modulePath.dup, 964 963 lineNumber, 965 964 line, 966 965 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 // } 971 970 if ( lineNumber > 0 ) 972 971 { … … 1002 1001 if ( target.exec ) 1003 1002 { 1004 1005 writefln("Project.getRunMenu %s %s ", target.getTarget(), target.getRunParameters());1006 1007 1003 popupMenu.append( 1008 1004 new MenuItem( … … 1033 1029 if ( target !is null ) 1034 1030 { 1035 run(target.getRunParameters(), true, new String("run ")~target.targetName);1031 run(target.getRunParameters(), Leds.leds.getPropValue("newOnRun", false), new String("run ")~target.targetName); 1036 1032 } 1037 1033 } … … 1196 1192 public void build(bit newConsole) 1197 1193 { 1194 1195 writefln("- Project.build"); 1198 1196 //if ( getCurrTarget(props.get("lastTarget","")) !is null ) 1199 1197 //{ … … 1223 1221 int exitStatus; 1224 1222 //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 // } 1232 1230 if ( newConsole ) 1233 1231 { 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( 1237 1235 getBaseDir(), 1238 1236 buildCommand … … 1355 1353 } 1356 1354 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 } 1359 1400 ProjectError[] moduleErrors; 1360 1401 String fileName = projectError.getFileName(); … … 1370 1411 projectErrors[fileName] = moduleErrors; 1371 1412 } 1413 return true; 1372 1414 } 1373 1415 trunk/src/leds/ProjectError.d
r74 r200 21 21 private import dool.String; 22 22 private import leds.Project; 23 23 24 private import std.stdio; 25 24 26 public enum ProjErrorType 25 27 { … … 44 46 { 45 47 this.project = project; 46 this.fileName = fileName ;48 this.fileName = fileName.dup; 47 49 this.lineNumber = lineNumber; 48 50 this.message = message; … … 62 64 public String getFileName() 63 65 { 64 return fileName ;66 return fileName.dup; 65 67 } 66 68 trunk/src/leds/SystemConsole.d
r199 r200 72 72 73 73 void delegate(String)[] mouseActionButtonListeners; 74 74 75 75 76 /** … … 80 81 { 81 82 this.workspace = workspace; 83 setPolicy(PolicyType.AUTOMATIC, PolicyType.AUTOMATIC); 82 84 tabName = new String("output"); 83 setPolicy(PolicyType.AUTOMATIC, PolicyType.AUTOMATIC); 85 setup(); 86 showAll(); 87 } 88 89 protected void setup() 90 { 84 91 textView = new TextView(); 85 setBGColor(Leds.leds.getPropValue("d.background",0x 000000));92 setBGColor(Leds.leds.getPropValue("d.background",0xF0F0F0)); 86 93 setFont(); 87 94 add(textView); 88 95 //textView.addOnButtonPress(&onMouseButtonPress); 89 96 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 93 109 int onMouseButtonPress(GdkEventButton* event, Widget widget) 94 110 { 95 char[] textLine = textView.getLineTextAt(cast(int)event.y);111 char[] textLine = getSelectedLine(event); 96 112 if ( event.button == 1 && Event.isDoubleClick(event, 1) ) 97 113 { … … 105 121 int onMouseButtonRelease(GdkEventButton* event, Widget widget) 106 122 { 107 char[] textLine = textView.getLineTextAt(cast(int)event.y);123 char[] textLine = getSelectedLine(event); 108 124 if ( event.button == 2 ) 109 125 { … … 132 148 workspace.refreshDockableLabel(this); 133 149 } 134 }135 136 String getLineTextAt(int y)137 {138 return new String(textView.getLineTextAt(y));139 150 } 140 151 … … 278 289 { 279 290 //writefln("%s", text); 280 textView.appendText(text); 291 if ( textView !is null ) 292 { 293 textView.appendText(text); 294 } 281 295 } 282 296 … … 286 300 } 287 301 302 public void appendCommand(String command) 303 { 304 append(command); 305 } 306 288 307 // public int exec(String workDir, String command, bit async = false) 289 308 // { … … 343 362 Path.chdir(workDir); 344 363 command = expandCommand(command); 345 append ("\n> ("~Path.getcwd()~") Executing >(after)>\n"~command~"\n");364 appendCommand("\n> ("~Path.getcwd()~") Executing >(after)>\n"~command~"\n"); 346 365 char[][] commArgs; 347 366 foreach ( String str ; command.split()) … … 503 522 } 504 523 505 } ;524 } trunk/src/leds/Workspace.d
r199 r200 37 37 private import leds.SystemConsole; 38 38 private import leds.ExecConsole; 39 private import leds.BuildConsole; 39 40 private import leds.Docker; 40 41 private import leds.DockerFiles; … … 719 720 findTextCombo = new ComboBoxEntry(); 720 721 findTextCombo.maxCount = 16; 721 findTextCombo.addOnKeyRelease(&keyRelease); 722 findTextCombo.addOnKeyPress(&findComboBoxKeyPress); 723 findTextCombo.addOnKeyRelease(&findComboBoxKeyRelease); 722 724 } 723 725 ToolItem toolItem = new ToolItem(); … … 764 766 if ( fileName != "" ) 765 767 { 766 writefln("Workspace.MakeNow 1");767 768 ExecConsole execConsole = new ExecConsole(this,"dmd "~fileName.toString()); 768 writefln("Workspace.MakeNow 2");769 769 addConsole(execConsole); 770 writefln("Workspace.MakeNow 3");771 770 execConsole.exec(Path.getcwd(),fileName.dup.prepend("dmd ")~" -I~/dmd/src/phobos"); 772 writefln("Workspace.MakeNow 4");773 771 } 774 772 } … … 844 842 public int makeSelectTarget(GdkEventButton* event, Widget widget) 845 843 { 846 writefln("Workspace.makeSelectTarget 1");847 844 Project project = getProjectView().getCurrentProject(); 848 writefln("Workspace.makeSelectTarget 2");849 845 switch ( event.button ) 850 846 { 851 847 case 1: 852 writefln("Workspace.makeSelectTarget 3");853 848 //project.build(true); 854 849 makeNow(project); … … 856 851 857 852 case 3: 858 writefln("Workspace.makeSelectTarget 4");859 853 //if ( project !is null ) 860 854 { … … 863 857
