Changeset 199

Show
Ignore:
Timestamp:
12/25/06 01:33:53 (2 years ago)
Author:
Ant
Message:

recover lost usability functionalities

Files:

Legend:

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

    r198 r199  
    318318                , false); 
    319319          
    320         menuLabel.setJustify(Justification.Y_LEFT); 
     320        menuLabel.setJustify(Justification.JUSTIFY_LEFT); 
    321321        menuLabel.setAlignment(0, 0); 
    322322        menuLabel.setPadding(2, 2); 
     
    361361        //notebook.setTabLabelText(dockable.getWidget(), labelText); 
    362362        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 
    371368 
    372369    /** 
    373370     *  
    374371     */ 
    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); 
    377375        if ( tabLabel is null ) 
    378376        { 
     
    391389            labelText = labelText[1..labelText.length]; 
    392390            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); 
    393397            tabLabel.packStart(image, false, false, 0); 
    394398        } 
     
    681685        for (int i=0;i<getNDocks();i++) { 
    682686            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                ) 
    684692            { 
    685693                return d; 
  • trunk/src/leds/LanguageD.d

    r193 r199  
    638638        scintilla.send(SCI_SETLEXER, SCLEX_CPP, 0); 
    639639        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" 
    641641            " cfloat cdouble creal real void auto" 
    642642            " enum double dchar short int long ifloat idouble ireal float" 
  • trunk/src/leds/Project.d

    r187 r199  
    548548    public void buildTarget() 
    549549    { 
    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            } 
    557560        } 
    558561    } 
     
    720723        { 
    721724            super(project, target); 
     725            project.lastBuildTarget = target; 
    722726            setupCompiler(target); 
    723727            compiler.compile(); 
     
    9981002            if ( target.exec ) 
    9991003            { 
     1004                 
     1005                writefln("Project.getRunMenu %s %s ", target.getTarget(), target.getRunParameters()); 
     1006                 
    10001007                popupMenu.append( 
    10011008                    new MenuItem( 
    10021009                        &runSelectedTarget, 
    10031010                        target.getTarget().toString(), 
    1004                         target.getTarget().toString() 
     1011                        target.getRunParameters().toString() 
    10051012                    ) 
    10061013                ); 
     
    10221029    public void runSelectedTarget(MenuItem item) 
    10231030    { 
    1024         ProjectTarget target = getCurrTarget(new String(item.getActionName())); 
     1031 
     1032        ProjectTarget target = getCurrTarget(new String(item.getName())); 
    10251033        if ( target !is null ) 
    10261034        { 
    1027             run(target.targetName, true, new String("run ")~target.targetName); 
     1035            run(target.getRunParameters(), true, new String("run ")~target.targetName); 
    10281036        } 
    10291037    } 
     
    12011209        { 
    12021210            String buildCommand = getPropValue("makeCommand",""); 
    1203             // \todo how do we clear an associatie array? 
     1211            // \todo how do we clear an associative array? 
    12041212            ProjectError[][String] t; 
    12051213            projectErrors = t; 
     
    14571465    public void run(String command, bit newConsole, String tabTitle) 
    14581466    { 
    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         
    14711470    } 
    14721471     
  • trunk/src/leds/ProjectTarget.d

    r187 r199  
    489489    } 
    490490     
     491    public String getRunParameters() 
     492    { 
     493        return runParms; 
     494    } 
     495     
    491496    /** 
    492497     * Gets the compiler flags for this target 
  • trunk/src/leds/Scintilla.d

    r187 r199  
    13511351 Dynamically load scintilla.dll GTK+ version on windows 
    13521352 *********************************************************************************/ 
    1353   
     1353 
    13541354private import lib.Loader; 
    13551355 
     
    19291929     * @see release() 
    19301930     * can't release it : it will segfault as it will release 
    1931      * rresources befire the not book is done with them (I think that's why???) 
     1931     * resources before the notebook is done with them (I think that's why???) 
    19321932     */ 
    19331933    //~this() 
  • trunk/src/leds/SystemConsole.d

    r187 r199  
    169169    String getTabName() 
    170170    { 
     171        if ( tabName == "output") 
     172        { 
     173            return tabName.dup; 
     174        } 
     175        String currTabName = tabName.dup; 
    171176        if ( exitStatus == 0 ) 
    172177        { 
    173178            if ( executing ) 
    174179            { 
    175                 return tabName.dup.prepend("! "); 
     180                return currTabName.prepend("! "); 
    176181            } 
    177             return tabName.dup
     182            return currTabName.prepend("+ ")
    178183        } 
    179184        else 
    180185        { 
    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("+ ")
    184189    } 
    185190 
     
    383388    bool childEnd(Spawn spawn) 
    384389    { 
     390        this.exitStatus = spawn.exitStatus; 
    385391        setExecuting(false); 
    386         this.exitStatus = spawn.exitStatus; 
    387         writefln("SystemConsole.childEnd (calling queue)"); 
     392        writefln("SystemConsole.childEnd (calling queue) for %s", getTabName()); 
    388393        childQueue.push(spawn); 
     394         
    389395        return false; 
    390396    } 
  • trunk/src/leds/Workspace.d

    r187 r199  
    698698        mtb.setMenu(new Menu()); 
    699699        mtb.addOnShowMenu(&makeButtonShowMenu); 
     700        mtb.addOnClicked(&makeButtonClicked); 
    700701         
    701702        mtb = new MenuToolButton(StockID.APPLY); 
     
    705706        mtb.setMenu(new Menu()); 
    706707        mtb.addOnShowMenu(&toolButtonRunMenu); 
     708        mtb.addOnClicked(&runButtonClicked); 
    707709 
    708710        addButton(StockID.STOP,"nothing for now (stop)","toolbar.stop"); 
     
    893895    } 
    894896 
     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     
    895922    public void toolButtonRunMenu(MenuToolButton toolButton) 
    896923    { 
     
    919946         
    920947    } 
    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     
    9421016     
    9431017    /** 
     
    17191793    public void refreshDockableLabel(Dockable dockable) 
    17201794    { 
     1795        writefln("Workspace.refreshDockableLabel"); 
    17211796        dockBottom.setDockedLabelText(dockable, dockable.getTabName()); 
    17221797    }