# HG changeset patch # User Frank Benoit # Date 1208112955 -7200 # Node ID 9ff9b8f7284b8c06f1c4a527bdfc7fe12957748c # Parent fc7a8f537871043d399ee881e2ad1fc78ffed058 FileTreeViewer now work on windows without error dialog. diff -r fc7a8f537871 -r 9ff9b8f7284b .hgignore --- a/.hgignore Sun Apr 13 17:19:38 2008 +0200 +++ b/.hgignore Sun Apr 13 20:55:55 2008 +0200 @@ -5,6 +5,7 @@ *.map *.exe *.bak +*.rf syntax: regexp ^build.sh$ @@ -16,8 +17,8 @@ ^dwtexamples/addressbook/AddressBook$ ^dwtexamples/controlexample/ControlExample$ ^dwtexamples/controlexample/CustomControlExample$ +^dwtexamples/texteditor/TextEditor$ ^dwtsnippets/.*/Snippet[0-9]*$ - ^user/torhu_synctest$ ^user/drawingboard/DrawingBoard$ ^user/dragdrop/texttolabel$ diff -r fc7a8f537871 -r 9ff9b8f7284b jface/FileTreeViewer.d --- a/jface/FileTreeViewer.d Sun Apr 13 17:19:38 2008 +0200 +++ b/jface/FileTreeViewer.d Sun Apr 13 20:55:55 2008 +0200 @@ -41,7 +41,7 @@ import tango.util.collection.model.Seq; import tango.util.collection.ArraySeq; - +import tango.text.convert.Utf; void main(){ auto hw = new FileTree; @@ -129,6 +129,10 @@ Object[] res; foreach( root; FileRoots.list()){ + // ignore floppy drives, they bring up strange error messages + if( root == `A:\`|| root == `B:\` ){ + continue; + } res ~= new FilePath( root ); } @@ -169,14 +173,20 @@ } public override Image getImage(Object arg0){ - return (cast(FilePath)arg0).isFolder() ? dir : file; + auto fp = cast(FilePath)arg0; + // is a root + if( fp.name.length is 0 ){ + return dir; + } + return fp.isFolder() ? dir : file; } public override char[] getText(Object arg0){ - auto text = (cast(FilePath)arg0).name(); + auto fp = cast(FilePath)arg0; + auto text = fp.name(); if( text.length is 0 ){ // now take all info, it will be drive or the root folder - text = (cast(FilePath)arg0).toString(); + text = fp.toString(); } return preserveCase ? text : text.toUpperCase(); } diff -r fc7a8f537871 -r 9ff9b8f7284b jface/Librarian.d --- a/jface/Librarian.d Sun Apr 13 17:19:38 2008 +0200 +++ b/jface/Librarian.d Sun Apr 13 20:55:55 2008 +0200 @@ -57,12 +57,6 @@ version(JIVE) import jive.stacktrace; -/++ - Known Problem: - Blocks in Save Method - Not prepared for windows. -++/ - /** * The application entry point * @@ -361,8 +355,8 @@ } } /** - * Creates a new file - */ + * Creates a new file + */ public void newFile() { if (checkOverwrite()) { library = new Library(); @@ -371,8 +365,8 @@ } /** - * Saves the current file - */ + * Saves the current file + */ public void saveFile() { String fileName = library.getFileName(); if (fileName is null) { @@ -385,10 +379,10 @@ } /** - * Saves the current file using the specified file name - * - * @param fileName the file name - */ + * Saves the current file using the specified file name + * + * @param fileName the file name + */ public void saveFileAs(String fileName) { // Disable the actions, so user can't change file while it's saving enableActions(false); @@ -433,7 +427,7 @@ // Repack the columns for (int i = 0, n = viewer.getTable().getColumnCount(); i < n; i++) { - viewer.getTable().getColumn(i).pack(); + viewer.getTable().getColumn(i).pack(); } getStatusLineManager().setMessage(