Changeset 199
- Timestamp:
- 12/25/06 01:33:53 (2 years ago)
- Files:
-
- trunk/src/leds/Docker.d (modified) (4 diffs)
- trunk/src/leds/LanguageD.d (modified) (1 diff)
- trunk/src/leds/Project.d (modified) (6 diffs)
- trunk/src/leds/ProjectTarget.d (modified) (1 diff)
- trunk/src/leds/Scintilla.d (modified) (2 diffs)
- trunk/src/leds/SystemConsole.d (modified) (2 diffs)
- trunk/src/leds/Workspace.d (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/leds/Docker.d
r198 r199 318 318 , false); 319 319 320 menuLabel.setJustify(Justification. Y_LEFT);320 menuLabel.setJustify(Justification.JUSTIFY_LEFT); 321 321 menuLabel.setAlignment(0, 0); 322 322 menuLabel.setPadding(2, 2); … … 361 361 //notebook.setTabLabelText(dockable.getWidget(), labelText); 362 362 HBox tabLabel = cast(HBox)notebook.getTabLabel(dockable.getWidget()); 363 setTabWidget(dockable, labelText, tabLabel); 364 } 365 366 367 Box setTabWidget(Dockable dockable, String labelText) 368 { 369 return setTabWidget(dockable, labelText, null); 370 } 363 Box box = setTabWidget(dockable, labelText, tabLabel); 364 notebook.setTabLabel(dockable.getWidget(), box); 365 366 } 367 371 368 372 369 /** 373 370 * 374 371 */ 375 Box setTabWidget(Dockable dockable, String labelText, Box tabLabel) 376 { 372 Box setTabWidget(Dockable dockable, String labelText, Box tabLabel=null) 373 { 374 writefln("Docker.setTabWidget labelText = %s ", labelText); 377 375 if ( tabLabel is null ) 378 376 { … … 391 389 labelText = labelText[1..labelText.length]; 392 390 Image image = new Image(StockID.DIALOG_WARNING, IconSize.MENU); 391 tabLabel.packStart(image, false, false, 0); 392 } 393 else if ( labelText[0] == '+' ) 394 { 395 labelText = labelText[1..labelText.length]; 396 Image image = new Image(StockID.APPLY, IconSize.MENU); 393 397 tabLabel.packStart(image, false, false, 0); 394 398 } … … 681 685 for (int i=0;i<getNDocks();i++) { 682 686 auto d = getDockable(i); 683 if ( d.getTabName() == name ) 687 String tabName = d.getTabName(); 688 if ( tabName == name 689 || ( tabName.startsWith("* ") && tabName[2..tabName.length] == name ) 690 || ( tabName.startsWith("+ ") && tabName[2..tabName.length] == name ) 691 ) 684 692 { 685 693 return d; trunk/src/leds/LanguageD.d
r193 r199 638 638 scintilla.send(SCI_SETLEXER, SCLEX_CPP, 0); 639 639 scintilla.send(SCI_SETKEYWORDS, 0, cast(sptr_t)cast(char*) 640 " int bit char byte cent ubyte ucent uint ulong union ushort wchar"640 " int bit bool char byte cent ubyte ucent uint ulong union ushort wchar" 641 641 " cfloat cdouble creal real void auto" 642 642 " enum double dchar short int long ifloat idouble ireal float" trunk/src/leds/Project.d
r187 r199 548 548 public void buildTarget() 549 549 { 550 version(compd) 551 { 552 new TargetBuilder_compd(this, lastBuildTarget); 553 } 554 else 555 { 556 new TargetBuilder(this, lastBuildTarget); 550 if ( lastBuildTarget !is null ) 551 { 552 version(compd) 553 { 554 new TargetBuilder_compd(this, lastBuildTarget); 555 } 556 else 557 { 558 new TargetBuilder(this, lastBuildTarget); 559 } 557 560 } 558 561 } … … 720 723 { 721 724 super(project, target); 725 project.lastBuildTarget = target; 722 726 setupCompiler(target); 723 727 compiler.compile(); … … 998 1002 if ( target.exec ) 999 1003 { 1004 1005 writefln("Project.getRunMenu %s %s ", target.getTarget(), target.getRunParameters()); 1006 1000 1007 popupMenu.append( 1001 1008 new MenuItem( 1002 1009 &runSelectedTarget, 1003 1010 target.getTarget().toString(), 1004 target.get Target().toString()1011 target.getRunParameters().toString() 1005 1012 ) 1006 1013 ); … … 1022 1029 public void runSelectedTarget(MenuItem item) 1023 1030 { 1024 ProjectTarget target = getCurrTarget(new String(item.getActionName())); 1031 1032 ProjectTarget target = getCurrTarget(new String(item.getName())); 1025 1033 if ( target !is null ) 1026 1034 { 1027 run(target. targetName, true, new String("run ")~target.targetName);1035 run(target.getRunParameters(), true, new String("run ")~target.targetName); 1028 1036 } 1029 1037 } … … 1201 1209 { 1202 1210 String buildCommand = getPropValue("makeCommand",""); 1203 // \todo how do we clear an associati e array?1211 // \todo how do we clear an associative array? 1204 1212 ProjectError[][String] t; 1205 1213 projectErrors = t; … … 1457 1465 public void run(String command, bit newConsole, String tabTitle) 1458 1466 { 1459 if ( newConsole ) 1460 { 1461 ExecConsole execConsole = new ExecConsole(workspace,tabTitle); 1462 workspace.addConsole(execConsole); 1463 execConsole.exec(getBaseDir(), command, true); 1464 } 1465 else 1466 { 1467 ExecConsole execConsole = workspace.getConsole(tabTitle); 1468 execConsole.clearWidget(); 1469 execConsole.exec(getBaseDir(), command, true); 1470 } 1467 1468 workspace.execRunCommand(getBaseDir(), command, newConsole, tabTitle); 1469 1471 1470 } 1472 1471 trunk/src/leds/ProjectTarget.d
r187 r199 489 489 } 490 490 491 public String getRunParameters() 492 { 493 return runParms; 494 } 495 491 496 /** 492 497 * Gets the compiler flags for this target trunk/src/leds/Scintilla.d
r187 r199 1351 1351 Dynamically load scintilla.dll GTK+ version on windows 1352 1352 *********************************************************************************/ 1353 1353 1354 1354 private import lib.Loader; 1355 1355 … … 1929 1929 * @see release() 1930 1930 * can't release it : it will segfault as it will release 1931 * r resources befire the notbook is done with them (I think that's why???)1931 * resources before the notebook is done with them (I think that's why???) 1932 1932 */ 1933 1933 //~this() trunk/src/leds/SystemConsole.d
r187 r199 169 169 String getTabName() 170 170 { 171 if ( tabName == "output") 172 { 173 return tabName.dup; 174 } 175 String currTabName = tabName.dup; 171 176 if ( exitStatus == 0 ) 172 177 { 173 178 if ( executing ) 174 179 { 175 return tabName.dup.prepend("! ");180 return currTabName.prepend("! "); 176 181 } 177 return tabName.dup;182 return currTabName.prepend("+ "); 178 183 } 179 184 else 180 185 { 181 return tabName.dup.prepend("* ");182 } 183 return (exitStatus!=0)? tabName.dup.prepend("* ") : tabName.dup;186 return currTabName.prepend("* "); 187 } 188 return (exitStatus!=0)? currTabName.prepend("* ") : currTabName.prepend("+ ") ; 184 189 } 185 190 … … 383 388 bool childEnd(Spawn spawn) 384 389 { 390 this.exitStatus = spawn.exitStatus; 385 391 setExecuting(false); 386 this.exitStatus = spawn.exitStatus; 387 writefln("SystemConsole.childEnd (calling queue)"); 392 writefln("SystemConsole.childEnd (calling queue) for %s", getTabName()); 388 393 childQueue.push(spawn); 394 389 395 return false; 390 396 } trunk/src/leds/Workspace.d
r187 r199 698 698 mtb.setMenu(new Menu()); 699 699 mtb.addOnShowMenu(&makeButtonShowMenu); 700 mtb.addOnClicked(&makeButtonClicked); 700 701 701 702 mtb = new MenuToolButton(StockID.APPLY); … … 705 706 mtb.setMenu(new Menu()); 706 707 mtb.addOnShowMenu(&toolButtonRunMenu); 708 mtb.addOnClicked(&runButtonClicked); 707 709 708 710 addButton(StockID.STOP,"nothing for now (stop)","toolbar.stop"); … … 893 895 } 894 896 897 public void makeButtonClicked(ToolButton toolButton) 898 { 899 Project project; 900 901 if ( getCurrentFileView() !is null ) 902 { 903 project = getCurrentFileView().getProject(); 904 } 905 906 if ( project is null ) 907 { 908 project = getProjectView().getCurrentProject(); 909 } 910 911 if ( project !is null ) 912 { 913 project.buildTarget(); 914 } 915 } 916 917 public void runButtonClicked(ToolButton toolButton) 918 { 919 repeatCommand(prevRunCommand); 920 } 921 895 922 public void toolButtonRunMenu(MenuToolButton toolButton) 896 923 { … … 919 946 920 947 } 921 922 public int runSelectTarget(GdkEventButton* event, Widget widget) 923 { 924 switch ( event.button ) 925 { 926 case 1: 927 Project project = getProjectView().getCurrentProject(); 928 runNow(project); 929 break; 930 931 case 3: 932 Project project = getProjectView().getCurrentProject(); 933 if ( project !is null ) 934 { 935 project.selectAndRunTarget(event); 936 } 937 default: 938 break; 939 } 940 return true; 941 } 948 949 // todo add a list a recent run and make commands to the run and make drop down menus 950 951 /** 952 * Stores all the information necessary to run a system command on a console 953 */ 954 struct RepeatableCommand 955 { 956 String baseDir; 957 String command; 958 bool newConsole; 959 String tabTitle; 960 } 961 962 /// the previous make command 963 private RepeatableCommand prevMakeCommand; 964 /// the previous run command 965 private RepeatableCommand prevRunCommand; 966 967 /** 968 * Execute a repeatable run command 969 */ 970 public void execRunCommand(String baseDir, String command, bit newConsole, String tabTitle) 971 { 972 repeatCommand(prevRunCommand, baseDir, command, newConsole, tabTitle); 973 } 974 975 // /** 976 // * Execute a repeatable make command 977 // */ 978 // public void execMakeCommand(String baseDir, String command, bit newConsole, String tabTitle) 979 // { 980 // } 981 982 /** 983 * Execute a new command and save it as to be repeated 984 */ 985 void repeatCommand(inout RepeatableCommand repeatableCommand, 986 String baseDir, String command, bit newConsole, String tabTitle) 987 { 988 repeatableCommand.baseDir = baseDir.dup; 989 repeatableCommand.command = command.dup; 990 repeatableCommand.newConsole = newConsole; 991 repeatableCommand.tabTitle = tabTitle.dup; 992 993 repeatCommand(repeatableCommand); 994 } 995 996 public void repeatCommand(RepeatableCommand repeatableCommand ) 997 { 998 999 if ( repeatableCommand.command !is null ) 1000 { 1001 if ( repeatableCommand.newConsole ) 1002 { 1003 ExecConsole execConsole = new ExecConsole(this,repeatableCommand.tabTitle); 1004 addConsole(execConsole); 1005 execConsole.exec(repeatableCommand.baseDir, repeatableCommand.command, true); 1006 } 1007 else 1008 { 1009 ExecConsole execConsole = getConsole(repeatableCommand.tabTitle); 1010 execConsole.clearWidget(); 1011 execConsole.exec(repeatableCommand.baseDir, repeatableCommand.command, true); 1012 } 1013 } 1014 } 1015 942 1016 943 1017 /** … … 1719 1793 public void refreshDockableLabel(Dockable dockable) 1720 1794 { 1795 writefln("Workspace.refreshDockableLabel"); 1721 1796 dockBottom.setDockedLabelText(dockable, dockable.getTabName()); 1722 1797 }
