Commit 8b8605fe authored by dianesun%netscape.com's avatar dianesun%netscape.com
Browse files

Fix for bug 80581, r=hwaara, sr=sspitzer

parent cd200472
Loading
Loading
Loading
Loading
+0 −48
Original line number Diff line number Diff line
var gPrefs;

function doYesButton()
{
	var alwaysAskForDownload = document.getElementById("offline.downloadMessages").checked;
    if (!gPrefs) GetPrefsService();

	if(alwaysAskForDownload) gPrefs.SetIntPref("offline.download.download_messages", 0);

	window.arguments[0].result = 1;
	window.close();
}

function doNoButton()
{
	var alwaysAskForDownload = document.getElementById("offline.downloadMessages").checked;
    if (!gPrefs) GetPrefsService();

	if(alwaysAskForDownload) gPrefs.SetIntPref("offline.download.download_messages", 0);

	window.arguments[0].result = 2;
	window.close();
}

function doCancelButton()
{
	window.arguments[0].result = 3;
	window.close();
}

function GetPrefsService()
{
   // Store the prefs object
   try {
		var prefsService = Components.classes["@mozilla.org/preferences;1"];
		if (prefsService)
		prefsService = prefsService.getService();
		if (prefsService)
		gPrefs = prefsService.QueryInterface(Components.interfaces.nsIPref);

		if (!gPrefs)
		dump("failed to get prefs service!\n");
   }
   catch(ex) {
		 dump("failed to get prefs service!\n");
   }
}
+0 −47
Original line number Diff line number Diff line
<?xml version="1.0"?> 
<!--
The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/

Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
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 Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
 Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
--> 

<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>

<!DOCTYPE window SYSTEM "chrome://messenger/locale/downloadMsgs.dtd">

<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        class="dialog"
		title="&downloadMsgsWindow.title;"
        orient="vertical">

	<script type="application/x-javascript" src="chrome://messenger/content/downloadMsgs.js"/>
	<keyset id="keyset"/>
	<spring flex="100%"/>

	<text class="label" value="&downloadMessages.label;" flex="100%"/>
	<checkbox  id="offline.downloadMessages" wsm_persist="true" label="&alwaysAsk.check.label;" />

	<spring flex="100%"/>
	<hbox autostretch="never">
		 <spring flex="100%"/>
		 <button id="buttonClicked:yes" class="dialog" label="&yesButton.label;"  onclick="doYesButton()" /> 
		 <button id="buttonClicked:no" class="dialog" label="&noButton.label;" onclick="doNoButton()" />
		 <button id="buttonClicked:cancel" class="dialog" label="&cancelButton.label;" onclick="doCancelButton()" /> 
		 <spring flex="100%"/>
	</hbox>
</window>
+0 −47
Original line number Diff line number Diff line
var gPrefs;

function doYesButton()
{
	var alwaysAskForSend = document.getElementById("offline.sendUnsentMessages").checked;
    if (!gPrefs) GetPrefsService();

	if(alwaysAskForSend) gPrefs.SetIntPref("offline.send.unsent_messages", 0);

	window.arguments[0].result = 1;
	window.close();
}

function doNoButton()
{
	var alwaysAskForSend = document.getElementById("offline.sendUnsentMessages").checked;
    if (!gPrefs) GetPrefsService();

	if(alwaysAskForSend) gPrefs.SetIntPref("offline.send.unsent_messages", 0);

	window.arguments[0].result = 2;
	window.close();
}

function doCancelButton()
{
	window.arguments[0].result = 3;
	window.close();
}

function GetPrefsService()
{
   // Store the prefs object
   try {
		var prefsService = Components.classes["@mozilla.org/preferences;1"];
		if (prefsService)
		prefsService = prefsService.getService();
		if (prefsService)
		gPrefs = prefsService.QueryInterface(Components.interfaces.nsIPref);

		if (!gPrefs)
		dump("failed to get prefs service!\n");
   }
   catch(ex) {
		 dump("failed to get prefs service!\n");
   }
}
 No newline at end of file
+0 −46
Original line number Diff line number Diff line
<?xml version="1.0"?> 
<!--
The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/

Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
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 Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
 Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.

--> 
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://messenger/locale/sendMsgs.dtd">

<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 
        class="dialog" 
		title="&sendUnsentMsgsWindow.title;"
		orient="vertical">

	<script type="application/x-javascript" src="chrome://messenger/content/sendMsgs.js"/>
	<keyset id="keyset"/>
	<spring flex="100%"/>

	<text class="label" value="&sendUnsentMessages.label;" flex="100%"/>
	<checkbox  wsm_persist="true" id="offline.sendUnsentMessages" label="&alwaysAsk.check.label;" />
	<spring flex="100%"/>

	<hbox autostretch="never">
		 <spring flex="100%"/>
		 <button id="buttonClicked:yes" class="dialog" label="&yesButton.label;"  onclick="doYesButton()" /> 
		 <button id="buttonClicked:no" class="dialog" label="&noButton.label;" onclick="doNoButton()" />
		 <button id="buttonClicked:cancel" class="dialog" label="&cancelButton.label;" onclick="doCancelButton()" /> 
		 <spring flex="100%"/>
	</hbox>
</window>