Make sidebar display in the event that the windows integration dialog appeared.

b = 119975; r = law; sr = dveditz
This commit is contained in:
sgehani%netscape.com 2002-01-26 19:59:42 +00:00
parent eec81fb952
commit 3a7d390ded
4 changed files with 25 additions and 5 deletions

View File

@ -1399,13 +1399,21 @@ function URLBarKeyupHandler(aEvent)
function checkForDefaultBrowser()
{
const NS_WINHOOKS_CONTRACTID = "@mozilla.org/winhooks;1";
var dialogShown = false;
if (NS_WINHOOKS_CONTRACTID in Components.classes) {
try {
Components.classes[NS_WINHOOKS_CONTRACTID]
.getService(Components.interfaces.nsIWindowsHooks)
.checkSettings(window);
dialogShown = Components.classes[NS_WINHOOKS_CONTRACTID]
.getService(Components.interfaces.nsIWindowsHooks)
.checkSettings(window);
} catch(e) {
}
if (dialogShown)
{
// Force the sidebar to build since the windows
// integration dialog may have come up.
SidebarRebuild();
}
}
}

View File

@ -861,6 +861,12 @@ function SidebarStopPanelLoad(header) {
function SidebarReload() {
sidebarObj.panels.refresh();
}
function SidebarRebuild() {
var panels = document.getElementById("sidebar-panels");
panels.builder.rebuild();
sidebar_open_default_panel(100, 0);
}
// Set up a lame hack to avoid opening two customize
// windows on a double click.

View File

@ -167,7 +167,8 @@ interface nsIWindowsHooks : nsISupports {
// service is called.
// aParent - parent window for any dialogs that
// will appear
void checkSettings( in nsIDOMWindowInternal aParent );
// Returns true if the windows integration dialog was shown
boolean checkSettings( in nsIDOMWindowInternal aParent );
/**
* Returns true if the "(appname) QuickLaunch" value is in the

View File

@ -273,8 +273,10 @@ static PRBool isAccessRestricted() {
// Implementation of method that checks settings versus registry and prompts user
// if out of synch.
NS_IMETHODIMP
nsWindowsHooks::CheckSettings( nsIDOMWindowInternal *aParent ) {
nsWindowsHooks::CheckSettings( nsIDOMWindowInternal *aParent,
PRBool *_retval ) {
nsresult rv = NS_OK;
*_retval = PR_FALSE;
// Only do this once!
static PRBool alreadyChecked = PR_FALSE;
@ -407,6 +409,9 @@ nsWindowsHooks::CheckSettings( nsIDOMWindowInternal *aParent ) {
nsnull, nsnull, nsnull, labelArg, &showDialog, &dlgResult);
if ( NS_SUCCEEDED( rv ) ) {
// Dialog was shown
*_retval = PR_TRUE;
// Did they say go ahead?
switch ( dlgResult ) {
case 0: