Bug 274280: preference for sending unsent messages disregarded on startup: always asks, patch by Magnus Melin <mkmelin+mozilla@iki.fi>, r+sr=bienvenu

This commit is contained in:
gavin%gavinsharp.com 2006-08-07 22:34:28 +00:00
parent 3ad309b247
commit 02228dfc50
2 changed files with 11 additions and 5 deletions

View File

@ -996,19 +996,22 @@ function loadStartFolder(initialUri)
InitPrompts();
InitServices();
if (gPromptService)
var sendUnsentWhenGoingOnlinePref = pref.getIntPref("offline.send.unsent_messages");
if(gPromptService && sendUnsentWhenGoingOnlinePref == 0) // pref is "ask"
{
var buttonPressed = gPromptService.confirmEx(window,
gOfflinePromptsBundle.getString('sendMessagesOfflineWindowTitle'),
gOfflinePromptsBundle.getString('sendMessagesLabel'),
gPromptService.BUTTON_TITLE_IS_STRING * (gPromptService.BUTTON_POS_0 +
gPromptService.BUTTON_POS_1),
gPromptService.BUTTON_POS_1),
gOfflinePromptsBundle.getString('sendMessagesSendButtonLabel'),
gOfflinePromptsBundle.getString('sendMessagesNoSendButtonLabel'),
null, null, {value:0});
if (buttonPressed == 0)
if (buttonPressed == 0)
SendUnsentMessages();
}
else if(sendUnsentWhenGoingOnlinePref == 1) // pref is "yes"
SendUnsentMessages();
}
}
}

View File

@ -862,7 +862,8 @@ function loadStartFolder(initialUri)
InitPrompts();
InitServices();
if (gPromptService)
var sendUnsentWhenGoingOnlinePref = pref.getIntPref("offline.send.unsent_messages");
if(gPromptService && sendUnsentWhenGoingOnlinePref == 0) // pref is "ask"
{
var buttonPressed = gPromptService.confirmEx(window,
gOfflinePromptsBundle.getString('sendMessagesOfflineWindowTitle'),
@ -872,9 +873,11 @@ function loadStartFolder(initialUri)
gOfflinePromptsBundle.getString('sendMessagesSendButtonLabel'),
gOfflinePromptsBundle.getString('sendMessagesNoSendButtonLabel'),
null, null, {value:0});
if (buttonPressed == 0)
if (buttonPressed == 0)
SendUnsentMessages();
}
else if(sendUnsentWhenGoingOnlinePref == 1) // pref is "yes"
SendUnsentMessages();
}
}
}