mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 05:30:29 +00:00
use the title unless empty then use URL instead. And change
the progress dialog to display title intead of url Bug 156305 r=dcone sr=waterson
This commit is contained in:
parent
703c294a0e
commit
9ad7dc90a0
@ -541,7 +541,6 @@ public:
|
||||
enum eDocTitleDefault {
|
||||
eDocTitleDefNone,
|
||||
eDocTitleDefBlank,
|
||||
eDocTitleDefDocument,
|
||||
eDocTitleDefURLDoc
|
||||
};
|
||||
|
||||
@ -2995,9 +2994,6 @@ DocumentViewerImpl::GetDisplayTitleAndURL(PrintObject* aPO,
|
||||
case eDocTitleDefBlank: *aTitle = ToNewUnicode(NS_LITERAL_STRING(""));
|
||||
break;
|
||||
|
||||
case eDocTitleDefDocument: if (aBrandName) *aTitle = nsCRT::strdup(aBrandName);
|
||||
break;
|
||||
|
||||
case eDocTitleDefURLDoc:
|
||||
if (*aURLStr) {
|
||||
*aTitle = nsCRT::strdup(*aURLStr);
|
||||
@ -6653,7 +6649,7 @@ DocumentViewerImpl::SetDocAndURLIntoProgress(PrintObject* aPO,
|
||||
PRUnichar * docTitleStr;
|
||||
PRUnichar * docURLStr;
|
||||
GetDisplayTitleAndURL(aPO, mPrt->mPrintSettings, mPrt->mBrandName,
|
||||
&docTitleStr, &docURLStr, eDocTitleDefDocument);
|
||||
&docTitleStr, &docURLStr, eDocTitleDefURLDoc);
|
||||
|
||||
// Make sure the URLS don't get too long for the progress dialog
|
||||
if (docURLStr && nsCRT::strlen(docURLStr) > kTitleLength) {
|
||||
|
@ -541,7 +541,6 @@ public:
|
||||
enum eDocTitleDefault {
|
||||
eDocTitleDefNone,
|
||||
eDocTitleDefBlank,
|
||||
eDocTitleDefDocument,
|
||||
eDocTitleDefURLDoc
|
||||
};
|
||||
|
||||
@ -2995,9 +2994,6 @@ DocumentViewerImpl::GetDisplayTitleAndURL(PrintObject* aPO,
|
||||
case eDocTitleDefBlank: *aTitle = ToNewUnicode(NS_LITERAL_STRING(""));
|
||||
break;
|
||||
|
||||
case eDocTitleDefDocument: if (aBrandName) *aTitle = nsCRT::strdup(aBrandName);
|
||||
break;
|
||||
|
||||
case eDocTitleDefURLDoc:
|
||||
if (*aURLStr) {
|
||||
*aTitle = nsCRT::strdup(*aURLStr);
|
||||
@ -6653,7 +6649,7 @@ DocumentViewerImpl::SetDocAndURLIntoProgress(PrintObject* aPO,
|
||||
PRUnichar * docTitleStr;
|
||||
PRUnichar * docURLStr;
|
||||
GetDisplayTitleAndURL(aPO, mPrt->mPrintSettings, mPrt->mBrandName,
|
||||
&docTitleStr, &docURLStr, eDocTitleDefDocument);
|
||||
&docTitleStr, &docURLStr, eDocTitleDefURLDoc);
|
||||
|
||||
// Make sure the URLS don't get too long for the progress dialog
|
||||
if (docURLStr && nsCRT::strlen(docURLStr) > kTitleLength) {
|
||||
|
@ -73,13 +73,15 @@ var progressListener = {
|
||||
{
|
||||
var docTitleStr = progressParams.docTitle;
|
||||
if (docTitleStr != docTitle) {
|
||||
SetTitle(docTitleStr);
|
||||
docTitle = docTitleStr;
|
||||
dialog.status.value = docTitle;
|
||||
}
|
||||
var docURLStr = progressParams.docURL;
|
||||
if (docURLStr != docURL && dialog.status != null) {
|
||||
dialog.status.value = docURLStr;
|
||||
docURL = docURLStr;
|
||||
if (docTitle == "") {
|
||||
dialog.status.value = docURLStr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -195,7 +197,7 @@ function onLoad() {
|
||||
dialog.progressText = document.getElementById("dialog.progressText");
|
||||
dialog.cancel = document.getElementById("cancel");
|
||||
|
||||
dialog.status.value = docURL;
|
||||
dialog.status.value = docTitle;
|
||||
|
||||
// Set up dialog button callbacks.
|
||||
var object = this;
|
||||
@ -207,9 +209,6 @@ function onLoad() {
|
||||
// set our web progress listener on the helper app launcher
|
||||
printProgress.registerListener(progressListener);
|
||||
moveToAlertPosition();
|
||||
|
||||
//We need to delay the set title else dom will overwrite it
|
||||
window.setTimeout(SetTitle, 0, docTitle);
|
||||
}
|
||||
|
||||
function onUnload()
|
||||
@ -226,12 +225,6 @@ function onUnload()
|
||||
}
|
||||
}
|
||||
|
||||
function SetTitle(str)
|
||||
{
|
||||
var prefix = getString("titlePrefixPrint");
|
||||
window.title = prefix + " " + str;
|
||||
}
|
||||
|
||||
// If the user presses cancel, tell the app launcher and close the dialog...
|
||||
function onCancel ()
|
||||
{
|
||||
|
@ -48,7 +48,6 @@ Contributor(s):
|
||||
-->
|
||||
|
||||
<data id="dialog.strings.dialogCloseLabel">&dialogClose.label;</data>
|
||||
<data id="dialog.strings.titlePrefixPrint">&titlePrefixPrint;</data>
|
||||
<data id="dialog.strings.printComplete">&printComplete;</data>
|
||||
<data id="dialog.strings.progressText">&percentPrint;</data>
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
<!--LOCALIZATION NOTE sendprogress.dtd Main UI for Send Message Progress Dialog -->
|
||||
<!ENTITY printWindow.title "Printing">
|
||||
<!ENTITY titlePrefixPrint "Printing -">
|
||||
<!ENTITY status "URL:">
|
||||
<!ENTITY status "Title:">
|
||||
<!ENTITY progress "Progress:">
|
||||
|
||||
<!ENTITY keepProgressDialogUpMsg.label "Keep this window open after the message is successfully sent.">
|
||||
|
Loading…
x
Reference in New Issue
Block a user