Offline mode support on Mac was fixed
authorEugene Ostroukhov <eugeneo@symbian.org>
Fri, 26 Mar 2010 16:42:30 -0700
changeset 285 bf9d8e184dd0
parent 284 5a06888861c3
child 286 bb5a56737bfb
Offline mode support on Mac was fixed
org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/preview/MozillaPreviewPage.java
org.symbian.tools.wrttools.product/launch/WRT IDE Product (Mac OS X).launch
--- a/org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/preview/MozillaPreviewPage.java	Fri Mar 26 10:25:30 2010 -0700
+++ b/org.symbian.tools.wrttools.previewer/src/org/symbian/tools/wrttools/previewer/preview/MozillaPreviewPage.java	Fri Mar 26 16:42:30 2010 -0700
@@ -12,6 +12,8 @@
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.browser.Browser;
 import org.eclipse.swt.widgets.Composite;
+import org.mozilla.interfaces.nsIIOService;
+import org.mozilla.interfaces.nsIIOService2;
 import org.mozilla.interfaces.nsIPrefBranch;
 import org.mozilla.interfaces.nsIServiceManager;
 import org.mozilla.xpcom.Mozilla;
@@ -97,6 +99,7 @@
 				// Mozilla. We don't want to pollute the error log with this
 				return;
 			}
+
 			
 			mozillaPrefs = (nsIPrefBranch) servMgr.getServiceByContractID(
 											"@mozilla.org/preferences-service;1", 
@@ -137,6 +140,14 @@
 			String location = "http://" + WebappManager.getHost() + ":" + WebappManager.getPort();
 			mozillaPrefs.setCharPref("capability.principal.codebase.p0.id", location);
 			mozillaPrefs.setBoolPref("security.fileuri.strict_origin_policy", 0);
+			// start JavaXPCOM section
+			nsIIOService ioService =
+				(nsIIOService)servMgr.getServiceByContractID("@mozilla.org/network/io-service;1", nsIIOService.NS_IIOSERVICE_IID);
+			nsIIOService2 ioService2 =
+				(nsIIOService2)ioService.queryInterface(nsIIOService2.NS_IIOSERVICE2_IID);
+			ioService2.setManageOfflineStatus(false);
+			ioService.setOffline(false);
+			// end JavaXPCOM section
 		} catch (Exception e) {
 			PreviewerPlugin.log("Error getting preferences", e);
 		}
--- a/org.symbian.tools.wrttools.product/launch/WRT IDE Product (Mac OS X).launch	Fri Mar 26 10:25:30 2010 -0700
+++ b/org.symbian.tools.wrttools.product/launch/WRT IDE Product (Mac OS X).launch	Fri Mar 26 16:42:30 2010 -0700
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench">
 <booleanAttribute key="append.args" value="true"/>
 <booleanAttribute key="askclear" value="true"/>