Revision: 7badac256d79 Author: francois.ouellette01@xxxxxxxxx Date: Thu Jul 26 15:12:02 2012 Log: BB can now Open XML files.Save is prompted if opening an existing file and doing a Translate withuot changing the text.
http://code.google.com/p/brailleblaster/source/detail?r=7badac256d79 Modified: /src/main/org/brailleblaster/wordprocessor/DocumentManager.java =======================================--- /src/main/org/brailleblaster/wordprocessor/DocumentManager.java Thu Jul 26 05:27:55 2012 +++ /src/main/org/brailleblaster/wordprocessor/DocumentManager.java Thu Jul 26 15:12:02 2012
@@ -315,7 +315,7 @@ * Clean up before closing the document. */ void finish() { - if (daisyHasChanged) { + if (daisyHasChanged || brailleHasChanged) { //FO YesNoChoice ync = new YesNoChoice(lh.localValue("hasChanged") ); if (ync.result == SWT.YES) { fileSave(); @@ -351,7 +351,7 @@ case WP.DocumentClosed: returnReason = reason; //FO - if ((daisy.view.getCharCount() == 0) || (! daisyHasChanged)) {+ if ((daisy.view.getCharCount() == 0) || (! daisyHasChanged) || (! brailleHasChanged)) {
returnReason = WP.BBClosed; } break; @@ -432,8 +432,8 @@ Shell shell = new Shell (display, SWT.DIALOG_TRIM); FileDialog dialog = new FileDialog (shell, SWT.OPEN); String filterPath = "/"; - String [] filterNames = new String [] {"UTDML file"}; - String [] filterExtensions = new String [] {"*.utd"}; + String [] filterNames = new String [] {"UTDML file","XML file"}; + String [] filterExtensions = new String [] {"*.utd","*.xml"}; String platform = SWT.getPlatform(); if (platform.equals("win32") || platform.equals("wpf")) { @@ -675,6 +675,7 @@ } } daisyHasChanged = false; + brailleHasChanged = false; } void fileSaveAs () { @@ -750,6 +751,7 @@ if (saveUtdml) statusBar.setText(lh.localValue("fileSaved")) ; daisyHasChanged = false; + brailleHasChanged = false; } void showBraille() { @@ -879,6 +881,7 @@ } metaContent = true; + brailleHasChanged = true; if (display) { if (BBIni.useUtd()) {