From d9ec8520f9db342927b6757b1154ea8ae4d021e3 Mon Sep 17 00:00:00 2001 From: "caillon%returnzero.com" Date: Fri, 16 Aug 2002 05:23:47 +0000 Subject: [PATCH] 128801 - downloading dialog has "-1%" in titlebar Patched by Aaron Kaluszka r=law sr=bryner --- .../progressDlg/locale/en-US/nsProgressDialog.dtd | 7 ++++++- .../components/ui/progressDlg/nsProgressDialog.js | 15 +++++++++++---- .../ui/progressDlg/nsProgressDialog.xul | 3 +++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/embedding/components/ui/progressDlg/locale/en-US/nsProgressDialog.dtd b/embedding/components/ui/progressDlg/locale/en-US/nsProgressDialog.dtd index efe9b9a0ae1..dd81aa068dd 100644 --- a/embedding/components/ui/progressDlg/locale/en-US/nsProgressDialog.dtd +++ b/embedding/components/ui/progressDlg/locale/en-US/nsProgressDialog.dtd @@ -19,7 +19,8 @@ - the Initial Developer. All Rights Reserved. - - Contributor(s): - - Bill Law + - Bill Law + - Aaron Kaluszka - - Alternatively, the contents of this file may be used under the terms of - either the GNU General Public License Version 2 or later (the "GPL"), or @@ -52,6 +53,10 @@ + + + + diff --git a/embedding/components/ui/progressDlg/nsProgressDialog.js b/embedding/components/ui/progressDlg/nsProgressDialog.js index 1dd62e26ca3..d521b16b439 100644 --- a/embedding/components/ui/progressDlg/nsProgressDialog.js +++ b/embedding/components/ui/progressDlg/nsProgressDialog.js @@ -19,7 +19,8 @@ * the Initial Developer. All Rights Reserved. * * Contributor(s): - * Bill Law + * Bill Law + * Aaron Kaluszka * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -493,13 +494,19 @@ nsProgressDialog.prototype = { // Set the dialog title. setTitle: function() { // Start with saving/opening template. - var title = this.saving ? this.getString( "savingTitle" ) : this.getString( "openingTitle" ); + // If percentage is not known (-1), use alternate template + var title = this.saving + ? ( this.percent != -1 ? this.getString( "savingTitle" ) : this.getString( "unknownSavingTitle" ) ) + : ( this.percent != -1 ? this.getString( "openingTitle" ) : this.getString( "unknownOpeningTitle" ) ); + // Use file name as insert 1. title = this.replaceInsert( title, 1, this.fileName() ); - // Use percentage as insert 2. - title = this.replaceInsert( title, 2, this.percent ); + // Use percentage as insert 2 (if known). + if ( this.percent != -1 ) { + title = this.replaceInsert( title, 2, this.percent ); + } // Set 's title attribute. if ( this.dialog ) { diff --git a/embedding/components/ui/progressDlg/nsProgressDialog.xul b/embedding/components/ui/progressDlg/nsProgressDialog.xul index 9f192b4bcf5..90de6671107 100644 --- a/embedding/components/ui/progressDlg/nsProgressDialog.xul +++ b/embedding/components/ui/progressDlg/nsProgressDialog.xul @@ -25,6 +25,7 @@ - Contributor(s): - Scott MacGregor - Bill Law + - Aaron Kaluszka - - Alternatively, the contents of this file may be used under the terms of - either the GNU General Public License Version 2 or later (the "GPL"), or @@ -94,6 +95,8 @@ &openingTitle; &openingSource; &openingTarget; + &unknownSavingTitle; + &unknownOpeningTitle; &pause; &resume;