From 7ec609c4edcdcaee1c8bbe9cefd9535821f1211b Mon Sep 17 00:00:00 2001 From: "mcmullen%netscape.com" Date: Wed, 9 Jun 1999 20:44:04 +0000 Subject: [PATCH] Support the -pref command-line option. git-svn-id: svn://10.0.0.236/trunk@34485 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpfe/bootstrap/nsAppRunner.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/mozilla/xpfe/bootstrap/nsAppRunner.cpp b/mozilla/xpfe/bootstrap/nsAppRunner.cpp index a99b13b578a..71618720690 100644 --- a/mozilla/xpfe/bootstrap/nsAppRunner.cpp +++ b/mozilla/xpfe/bootstrap/nsAppRunner.cpp @@ -33,6 +33,7 @@ #include "nsCRT.h" #include "nsFileSpec.h" #include "nsIFileLocator.h" +#include "nsIPrefWindow.h" #include "nsFileLocations.h" #include "nsFileStream.h" #include "nsSpecialSystemDirectory.h" @@ -513,7 +514,27 @@ int main(int argc, char* argv[]) /* End of mailhack */ /* ********************************************************************* */ - /* Kick off appcores */ + // Support the "-pref" command-line option, which just puts up the pref window, so that + // apprunner becomes a "control panel". The "OK" and "Cancel" buttons will quit + // the application. + rv = cmdLineArgs->GetCmdLineValue("-pref", &cmdResult); + if (NS_SUCCEEDED(rv) && cmdResult && (strcmp("1",cmdResult) == 0)) + { + nsIPrefWindow* prefWindow; + rv = nsComponentManager::CreateInstance( + NS_PREFWINDOW_PROGID, + nsnull, + nsIPrefWindow::GetIID(), + (void **)&prefWindow); + if (NS_SUCCEEDED(rv)) + { + prefWindow->Init(nsString("Apprunner::main()").GetUnicode()); + prefWindow->ShowWindow(nsnull); + } + goto done; + } + + // Kick off appcores rv = nsServiceManager::GetService(kAppCoresManagerCID, kIDOMAppCoresManagerIID, (nsISupports**)&appCoresManager);