diff --git a/mozilla/extensions/sroaming/plan.txt b/mozilla/extensions/sroaming/plan.txt index 2f6db11cdde..9426c7aafe0 100644 --- a/mozilla/extensions/sroaming/plan.txt +++ b/mozilla/extensions/sroaming/plan.txt @@ -3,7 +3,7 @@ todo: - license headers - nsresult for internal functions, clean up interfaces - warn before saving pw -- alert() -> nsiprompt or dialog +- experimental warning - remove printfs - XXXs - firebird/thunderbird extension @@ -18,8 +18,14 @@ don't care (for now): - problem: cancel by user in progress dialog: xpconnect errors solution: prevent dialog closure (even if cancel pressed) until we're done. - listing progressmeter doesn't work +- If one file is missing on both server and client and we didn't upload, but + there is no conflict, we still show one. That's due to that commented-out + check in compareFiles(). Mind the warning there and fix it. +- no preselection in conflict dialog +- not using statusText for FTP errors (file not readable in this case) Enhance +- better error dialog - protocols - HTTPS - LDAP (already done by Sun?) diff --git a/mozilla/extensions/sroaming/resources/content/transfer/conflictCheck.js b/mozilla/extensions/sroaming/resources/content/transfer/conflictCheck.js index c79a12b8ff7..a8d8cae2dc2 100644 --- a/mozilla/extensions/sroaming/resources/content/transfer/conflictCheck.js +++ b/mozilla/extensions/sroaming/resources/content/transfer/conflictCheck.js @@ -299,7 +299,7 @@ function download(transfer, remoteListing) // avoid conflicts for files which don't exist on server or locally var conflicts = substractFiles(comparisonStep2aa.mismatches, - missingRemote.concat(missingLocal)); + addFiles(missingRemote, missingLocal)); if (conflicts.length > 0) { @@ -315,7 +315,7 @@ function download(transfer, remoteListing) onCancel(); return; } - keepLocalVersionFiles = keepLocalVersionFiles.concat(answer.local); + keepLocalVersionFiles =addFiles(keepLocalVersionFiles, answer.local); } } } @@ -398,7 +398,7 @@ function upload(transfer, remoteListing) // avoid conflicts for files which don't exist on server or locally var conflicts = substractFiles(comparisonStep2a.mismatches, - missingRemote.concat(missingLocal)); + addFiles(missingRemote, missingLocal)); if (conflicts.length == 0) { @@ -423,7 +423,7 @@ function upload(transfer, remoteListing) return; } uploadStep4(transfer, localFiles, remoteListing, - missingLocal.concat(answer.server)); + addFiles(missingLocal, answer.server)); } }, false); } @@ -444,7 +444,8 @@ function uploadStep4(transfer, localFiles, remoteFiles, keepServerVersionFiles) ddump("Step 5: Generating listing file based on facts"); var filesDone = extractFiles(transfer.filesWithStatus("done"), localFiles); - createListingFile(filesDone.concat(substractFiles(remoteFiles, filesDone)), + createListingFile(addFiles(filesDone, + substractFiles(remoteFiles, filesDone)), kListingTransferFilename); ddump("Step 6: Uploading listing file to server"); @@ -530,7 +531,7 @@ function compareFiles(filesList, files1, files2) var matches = (f1 && f2 && f1.size == f2.size && f1.lastModified == f2.lastModified); - //if (!f1 && !f2) needed? Would break current conflict logic + //if (!f1 && !f2) needed? Would break current conflict logic (|missing*|) // matches = true; ddump(filename + (matches ? " matches" : " doesn't match")); @@ -598,6 +599,20 @@ function substractFiles(files1, filesList) return result; } +/* + Returns files1 + files2, i.e. returns all entries of files1 and + all entries of files2. It is *not* garanteed that every entry appears + only once in the result. + + @param files1 FilesList + @param files2 FilesList + @result FilesStats Superset of files1 and files2 +*/ +function addFiles(files1, files2) +{ + return files1.concat(files2); +} + /* Returns |files|'s entry which matches |filename|. diff --git a/mozilla/extensions/sroaming/resources/content/transfer/progressDialog.js b/mozilla/extensions/sroaming/resources/content/transfer/progressDialog.js index d2d9bdb8c65..af963d5343c 100644 --- a/mozilla/extensions/sroaming/resources/content/transfer/progressDialog.js +++ b/mozilla/extensions/sroaming/resources/content/transfer/progressDialog.js @@ -48,7 +48,6 @@ function Startup() ddump("In sroaming/transfer/progressDialog::Startup()"); gDialog.FileList = document.getElementById("FileList"); - gDialog.FinalStatusMessage = document.getElementById("FinalStatusMessage"); gDialog.StatusMessage = document.getElementById("StatusMessage"); gDialog.ListingProgress = document.getElementById("ListingProgress"); gDialog.Close = document.documentElement.getButton("cancel"); @@ -63,7 +62,7 @@ function Startup() /* All kinds of exceptions should end up here, esp. from init, meaning this is the main last backstop for unexpected or fatal errors, esp. those not related to a certain file. */ - SetGlobalStatusMessage(ErrorMessageForException(e)); + GlobalError(ErrorMessageForException(e)); return; } @@ -247,7 +246,7 @@ function SetProgressStatus(filenr) gDialog.FileList.appendChild(listitem); } - CheckDone(false); + // CheckDone(false); -- already called from conflictCheck.js return found; } @@ -347,14 +346,13 @@ function CleanUpDialog() clearTimeout(gTimerID); gTimerID = null; } - if (!gFinished) + if (!gFinished && gTransfer) { gTransfer.cancel(); } PassBackParams(); } - // UI stuff // Sets the text in the prominent center of the dialog @@ -363,14 +361,15 @@ function SetStatusMessage(message) if (!message) message = ""; if (!gTransferFailed) - gDialog.FinalStatusMessage.value = message; + gDialog.StatusMessage.value = message; } // For fatal errors like unexpected exceptions. Bail and go home. function GlobalError(message) { - alert(message); // XXX - CloseDialog(); // XXX + GetPromptService().alert(window, GetString("FatalError"), + message); + CloseDialog(); } /* @@ -387,7 +386,8 @@ function addFileStatus(file) //XXX hack function showErrors() { - alert(gResults); + GetPromptService().alert(window, GetString("TransferErrorsTitle"), + gResults); } // set to on, if a listing.xml file is being transferred (and off afterwards) diff --git a/mozilla/extensions/sroaming/resources/content/transfer/progressDialog.xul b/mozilla/extensions/sroaming/resources/content/transfer/progressDialog.xul index 1c7161627d2..2d998295049 100644 --- a/mozilla/extensions/sroaming/resources/content/transfer/progressDialog.xul +++ b/mozilla/extensions/sroaming/resources/content/transfer/progressDialog.xul @@ -10,8 +10,7 @@ - implied. See the License for the specific language governing - rights and limitations under the License. - - - The Original Code is Mozilla Communicator client code, released - - March 31, 1998. + - The Original Code is Mozilla Communicator client code. - - The Initial Developer of the Original Code is Netscape - Communications Corporation. Portions created by Netscape are @@ -19,7 +18,8 @@ - Rights Reserved. - - Contributor(s): - - Charles Manxke (cmanske@netscape.com) + - Charles Manske + - Ben Bucksch of Beonex --> @@ -31,9 +31,8 @@ - - -