Changeset 73:9ff9b8f7284b

Show
Ignore:
Timestamp:
04/13/08 14:55:55 (6 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

FileTreeViewer? now work on windows without error dialog.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • .hgignore

    r66 r73  
    66*.exe 
    77*.bak 
     8*.rf 
    89 
    910syntax: regexp 
     
    1718^dwtexamples/controlexample/ControlExample$ 
    1819^dwtexamples/controlexample/CustomControlExample$ 
     20^dwtexamples/texteditor/TextEditor$ 
    1921^dwtsnippets/.*/Snippet[0-9]*$ 
    20  
    2122^user/torhu_synctest$ 
    2223^user/drawingboard/DrawingBoard$ 
  • jface/FileTreeViewer.d

    r70 r73  
    4242import tango.util.collection.model.Seq; 
    4343import tango.util.collection.ArraySeq; 
    44  
     44import tango.text.convert.Utf; 
    4545 
    4646void main(){ 
     
    130130 
    131131        foreach( root; FileRoots.list()){ 
     132            // ignore floppy drives, they bring up strange error messages 
     133            if( root == `A:\`|| root == `B:\` ){ 
     134                continue; 
     135            } 
    132136            res ~= new FilePath( root ); 
    133137        } 
     
    170174 
    171175    public override Image getImage(Object arg0){ 
    172         return (cast(FilePath)arg0).isFolder() ? dir : file; 
     176        auto fp = cast(FilePath)arg0; 
     177        // is a root 
     178        if( fp.name.length is 0 ){ 
     179            return dir; 
     180        } 
     181        return fp.isFolder() ? dir : file; 
    173182    } 
    174183 
    175184    public override char[] getText(Object arg0){ 
    176         auto text = (cast(FilePath)arg0).name(); 
     185        auto fp = cast(FilePath)arg0; 
     186        auto text = fp.name(); 
    177187        if( text.length is 0 ){ 
    178188            // now take all info, it will be drive or the root folder 
    179             text = (cast(FilePath)arg0).toString(); 
     189            text = fp.toString(); 
    180190        } 
    181191        return preserveCase ? text : text.toUpperCase(); 
  • jface/Librarian.d

    r72 r73  
    5858version(JIVE) import jive.stacktrace; 
    5959 
    60 /++ 
    61     Known Problem: 
    62         Blocks in Save Method 
    63         Not prepared for windows. 
    64 ++/ 
    65  
    6660/** 
    6761 * The application entry point 
     
    362356    } 
    363357    /** 
    364     * Creates a new file 
    365     */ 
     358    * Creates a new file 
     359    */ 
    366360    public void newFile() { 
    367361        if (checkOverwrite()) { 
     
    372366 
    373367    /** 
    374     * Saves the current file 
    375     */ 
     368    * Saves the current file 
     369    */ 
    376370    public void saveFile() { 
    377371        String fileName = library.getFileName(); 
     
    386380 
    387381    /** 
    388     * Saves the current file using the specified file name 
    389    
    390     * @param fileName the file name 
    391     */ 
     382    * Saves the current file using the specified file name 
     383   
     384    * @param fileName the file name 
     385    */ 
    392386    public void saveFileAs(String fileName) { 
    393387        // Disable the actions, so user can't change file while it's saving 
     
    434428        // Repack the columns 
    435429        for (int i = 0, n = viewer.getTable().getColumnCount(); i < n; i++) { 
    436         viewer.getTable().getColumn(i).pack(); 
     430            viewer.getTable().getColumn(i).pack(); 
    437431        } 
    438432