From f0c6038400be0480cf70faf4fa0218e413171bc5 Mon Sep 17 00:00:00 2001 From: "law%netscape.com" Date: Tue, 11 Jun 2002 20:06:05 +0000 Subject: [PATCH] Bug 89907; add new UI to Nav pref panel to simply making Mozilla the default browser; r=sgehanni, sr=ben --- .../resources/content/nsPrefWindow.js | 9 +- .../resources/content/pref-navigator.xul | 23 ++- .../resources/content/pref-winhooks.js | 41 +++-- .../content/win/platformPrefOverlay.xul | 174 +++++++++++++++++- xpfe/components/winhooks/nsIWindowsHooks.idl | 6 + xpfe/components/winhooks/nsWindowsHooks.cpp | 74 +++++--- .../resources/content/nsWidgetStateManager.js | 8 +- 7 files changed, 270 insertions(+), 65 deletions(-) diff --git a/xpfe/components/prefwindow/resources/content/nsPrefWindow.js b/xpfe/components/prefwindow/resources/content/nsPrefWindow.js index ff243dbc8fbc..fa342d202865 100644 --- a/xpfe/components/prefwindow/resources/content/nsPrefWindow.js +++ b/xpfe/components/prefwindow/resources/content/nsPrefWindow.js @@ -86,17 +86,16 @@ nsPrefWindow.prototype = onOK: function () { - for( var i = 0; i < hPrefWindow.okHandlers.length; i++ ) - { - hPrefWindow.okHandlers[i](); - } - var tag = document.getElementById( hPrefWindow.contentFrame ).getAttribute("tag"); if( tag == "" ) { tag = document.getElementById( hPrefWindow.contentFrame ).getAttribute("src"); } hPrefWindow.wsm.savePageData( tag ); + for( var i = 0; i < hPrefWindow.okHandlers.length; i++ ) + { + hPrefWindow.okHandlers[i](); + } hPrefWindow.savePrefs(); }, diff --git a/xpfe/components/prefwindow/resources/content/pref-navigator.xul b/xpfe/components/prefwindow/resources/content/pref-navigator.xul index 2522095d48d8..59257f7e3118 100644 --- a/xpfe/components/prefwindow/resources/content/pref-navigator.xul +++ b/xpfe/components/prefwindow/resources/content/pref-navigator.xul @@ -23,6 +23,7 @@ + @@ -43,16 +44,18 @@ ]]> - - - - - - - - - - + + + + + + + + + + + + diff --git a/xpfe/components/prefwindow/resources/content/pref-winhooks.js b/xpfe/components/prefwindow/resources/content/pref-winhooks.js index edad680b1775..c2e5df04b393 100644 --- a/xpfe/components/prefwindow/resources/content/pref-winhooks.js +++ b/xpfe/components/prefwindow/resources/content/pref-winhooks.js @@ -35,23 +35,8 @@ function dumpObject( obj, name ) { // Top-level windows integration preferences. if ( !( "winHooks" in parent ) ) { parent.winHooks = new Object; - parent.winHooks.settings = [ "isHandlingHTML", - "isHandlingJPEG", - "isHandlingGIF", - "isHandlingPNG", - "isHandlingMNG", - "isHandlingBMP", - "isHandlingICO", - "isHandlingXML", - "isHandlingXHTML", - "isHandlingXUL", - "isHandlingHTTP", - "isHandlingHTTPS", - "isHandlingFTP", - "isHandlingCHROME", - "isHandlingGOPHER", - "showDialog" ]; + parent.winHooks.settings = null; parent.winHooks.winhooks = null; parent.winHooks.prefs = null; } @@ -104,14 +89,34 @@ function Startup() { // Set globals. parent.winHooks.winhooks = winhooks; parent.winHooks.prefs = prefs; - // Register so we get called when pref window Ok is pressed. - parent.hPrefWindow.registerOKCallbackFunc( onOK ); } } catch(e) { dump( e + "\n" ); } } + if ( !settings ) { + // Set state specific to this panel (not shared with the "default browser" + // button state from the Navigator panel). + settings = parent.winHooks.settings = [ "isHandlingHTML", + "isHandlingJPEG", + "isHandlingGIF", + "isHandlingPNG", + "isHandlingMNG", + "isHandlingBMP", + "isHandlingICO", + "isHandlingXML", + "isHandlingXHTML", + "isHandlingXUL", + "isHandlingHTTP", + "isHandlingHTTPS", + "isHandlingFTP", + "isHandlingCHROME", + "isHandlingGOPHER", + "showDialog" ]; + // Register so we get called when pref window Ok is pressed. + parent.hPrefWindow.registerOKCallbackFunc( onOK ); + } // Transfer object settings to the dialog checkboxes. for( var index in settings ) { var setting = settings[ index ]; diff --git a/xpfe/components/prefwindow/resources/content/win/platformPrefOverlay.xul b/xpfe/components/prefwindow/resources/content/win/platformPrefOverlay.xul index 187ccecf8fbd..c47c233c94f1 100644 --- a/xpfe/components/prefwindow/resources/content/win/platformPrefOverlay.xul +++ b/xpfe/components/prefwindow/resources/content/win/platformPrefOverlay.xul @@ -21,9 +21,15 @@ Contributor(s): Ben Goodger + Bill Law --> - + +%brandDTD; + +%platformPrefOverlayDTD; +]> @@ -36,6 +42,172 @@ + + + + + + + + + &makeDefaultText; + + +