Adding pref for modeless pref window, still modal by default (21698)

git-svn-id: svn://10.0.0.236/trunk@56561 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mcafee%netscape.com
1999-12-28 06:09:18 +00:00
parent 71ef7d05b6
commit cf935b7f9c
2 changed files with 22 additions and 13 deletions

View File

@@ -92,6 +92,7 @@ pref("browser.custom_text_color", false);
pref("browser.use_document_colors", true);
pref("browser.ldapfile_location", "");
pref("browser.print_background", false);
pref("browser.prefs_window.modeless", false);
pref("browser.prefs_window_rect", "-1,-1,-1,-1");
pref("browser.find_window_rect", "-1,-1,-1,-1");
pref("browser.bookmark_window_rect", "-1,-1,-1,-1");

View File

@@ -215,19 +215,27 @@ NS_IMETHODIMP nsPrefWindow::ShowWindow(
DOMWindowToWebShellWindow(currentFrontWin, &parent);
#if defined(MODELESS_PREF_DIALOG)||defined(DEBUG_mcafee)||defined(DEBUG_akkana)||defined(DEBUG_pavlov)
// testing modeless pref window. -mcafee
nsIWebShellWindow *foo = nsnull;
// pass 0 for the height and width because we want to leave the size up to the xul (see prefs.xul for the window size)
rv = appShell->CreateTopLevelWindow(parent, urlObj, PR_TRUE, PR_TRUE,
NS_CHROME_ALL_CHROME | NS_CHROME_OPEN_AS_DIALOG,
cb, 0, 0, &foo);
#else
// pass 0 for the height and width because we want to leave the size up to the xul (see prefs.xul for the window size)
rv = appShell->RunModalDialog(nsnull, parent, urlObj,
NS_CHROME_ALL_CHROME | NS_CHROME_OPEN_AS_DIALOG,
cb, 0, 0);
#endif
static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID);
NS_WITH_SERVICE(nsIPref, prefs, kPrefServiceCID, &rv);
PRBool modelessPrefWindow = PR_FALSE;
if(NS_SUCCEEDED(rv))
prefs->GetBoolPref("browser.prefs_window.modeless", &modelessPrefWindow);
else
; // Assume false.
if(modelessPrefWindow) {
nsIWebShellWindow *foo = nsnull;
// pass 0 for the height and width because we want to leave the size up to the xul (see prefs.xul for the window size)
rv = appShell->CreateTopLevelWindow(parent, urlObj, PR_TRUE, PR_TRUE,
NS_CHROME_ALL_CHROME | NS_CHROME_OPEN_AS_DIALOG,
cb, 0, 0, &foo);
} else {
// pass 0 for the height and width because we want to leave the size up to the xul (see prefs.xul for the window size)
rv = appShell->RunModalDialog(nsnull, parent, urlObj,
NS_CHROME_ALL_CHROME | NS_CHROME_OPEN_AS_DIALOG,
cb, 0, 0);
}
return rv;
} // nsPrefWindow::ShowWindow()