Search
j0ke.net Open Build Service
>
Projects
>
mozilla
>
mozilla-xulrunner190
> mozilla-network-status.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File mozilla-network-status.patch of Package mozilla-xulrunner190 (Revision 10)
Currently displaying revision
10
,
show latest
From: Wolfgang Rosenauer Subject: Make it possible to ignore NetworkManager status References: https://bugzilla.mozilla.org/show_bug.cgi?id=424626 Index: toolkit/system/dbus/nsNetworkManagerListener.cpp =================================================================== RCS file: /cvsroot/mozilla/toolkit/system/dbus/nsNetworkManagerListener.cpp,v retrieving revision 1.2 diff -u -p -6 -r1.2 nsNetworkManagerListener.cpp --- toolkit/system/dbus/nsNetworkManagerListener.cpp 8 Jul 2007 07:08:45 -0000 1.2 +++ toolkit/system/dbus/nsNetworkManagerListener.cpp 26 May 2008 22:12:41 -0000 @@ -42,12 +42,14 @@ #include "nsNetworkManagerListener.h" #include "nsNetCID.h" #include "nsServiceManagerUtils.h" #include "nsIObserverService.h" #include "nsStringAPI.h" +#include "nsIPrefBranch2.h" +#include "nsIPrefService.h" // Define NetworkManager API constants. This avoids a dependency on // NetworkManager-devel. #define NM_DBUS_SERVICE "org.freedesktop.NetworkManager" #define NM_DBUS_PATH "/org/freedesktop/NetworkManager" #define NM_DBUS_INTERFACE "org.freedesktop.NetworkManager" @@ -184,13 +187,23 @@ nsNetworkManagerListener::HandleMessage( void nsNetworkManagerListener::UpdateNetworkStatus(DBusMessage* msg) { PRInt32 result; if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_UINT32, &result, DBUS_TYPE_INVALID)) return; - + + // Don't update status if disabled by pref + nsCOMPtr<nsIPrefBranch2> prefs = + do_GetService(NS_PREFSERVICE_CONTRACTID); + if (prefs) { + PRBool ignore = PR_FALSE; + prefs->GetBoolPref("toolkit.networkmanager.disable", &ignore); + if (ignore) + return; + } + mNetworkManagerActive = PR_TRUE; PRBool wasUp = mLinkUp; mLinkUp = result == NM_STATE_CONNECTED; if (wasUp == mLinkUp) return; Index: modules/libpref/src/init/all.js =================================================================== RCS file: /cvsroot/mozilla/modules/libpref/src/init/all.js,v retrieving revision 3.758 diff -u -p -6 -r3.758 all.js --- modules/libpref/src/init/all.js 2 May 2008 06:27:27 -0000 3.758 +++ modules/libpref/src/init/all.js 29 May 2008 13:06:01 -0000 @@ -2247,12 +2247,15 @@ pref("autocomplete.grab_during_popup", t pref("autocomplete.ungrab_during_mode_switch", true); // Default to using the system filepicker if possible, but allow // toggling to use the XUL filepicker pref("ui.allow_platform_file_picker", true); +// should NetworkManager be authoritative for online/offline status? +pref("toolkit.networkmanager.disable", false); + pref("helpers.global_mime_types_file", "/etc/mime.types"); pref("helpers.global_mailcap_file", "/etc/mailcap"); pref("helpers.private_mime_types_file", "~/.mime.types"); pref("helpers.private_mailcap_file", "~/.mailcap"); pref("java.global_java_version_file", "/etc/.java/versions"); pref("java.private_java_version_file", "~/.java/versions");