** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ctsim.cpp,v 1.68 2001/02/08 22:38:23 kevin Exp $
+** $Id: ctsim.cpp,v 1.73 2001/02/09 22:22:04 kevin Exp $
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
#endif
#endif
-static const char* rcsindent = "$Id: ctsim.cpp,v 1.68 2001/02/08 22:38:23 kevin Exp $";
+static const char* rcsindent = "$Id: ctsim.cpp,v 1.73 2001/02/09 22:22:04 kevin Exp $";
struct option CTSimApp::ctsimOptions[] =
{
setpriority (PRIO_PROCESS, 0, 15); // set to low scheduling priority
#endif
- m_pConfig = new wxConfig("ctsim");
+ m_pConfig = new wxConfig("ctsim", _T(""), ".ctsim", "", wxCONFIG_USE_LOCAL_FILE);
wxConfigBase::Set(m_pConfig);
g_bRunningWXWindows = true;
m_pLog = new wxTextCtrl (m_pFrame, -1, "Log Window\n", wxPoint(0, 0), wxSize(0,0), wxTE_MULTILINE | wxTE_READONLY);
#endif
wxLog::SetActiveTarget (new wxLogTextCtrl(m_pLog));
-
+
#ifdef CTSIM_WINHELP
if (! m_pFrame->getWinHelpController().Initialize("ctsim"))
*m_pLog << "Cannot initialize the Windows Help system" << "\n";
#endif
- if (! m_pFrame->getHtmlHelpController().Initialize(::wxGetCwd() + "/ctsim"))
+ wxString helpDir;
+ if (! m_pConfig->Read("HelpDir", &helpDir))
+ helpDir = ::wxGetCwd();
+ if (! m_pFrame->getHtmlHelpController().Initialize(helpDir + "/ctsim") &&
+ ! m_pFrame->getHtmlHelpController().Initialize("/usr/local/man/ctsim"))
*m_pLog << "Cannot initialize the HTML Help system" << "\n";
-
+ else {
+ if (::wxDirExists ("/tmp"))
+ m_pFrame->getHtmlHelpController().SetTempDir(_T("/tmp"));
+ m_pFrame->getHtmlHelpController().UseConfig (m_pConfig);
+ }
+
for (int i = optind + 1; i <= argc; i++) {
wxString filename = argv [i - 1];
m_docManager->CreateDocument (filename, wxDOC_SILENT);
int
CTSimApp::OnExit()
{
+ delete m_pConfig;
+
#ifdef HAVE_DMALLOC
dmalloc_shutdown();
#endif