📄 resorgoptions.cpp
字号:
/************************************************************************
*
* Resource ID Organiser Core Library
*
* (c) Copyright 2000-2004 by Anna-Jayne Metcalfe (resorg@annasplace.me.uk)
* All rights reserved.
*
************************************************************************
*
* Filename : ResOrgOptions.cpp
*
* Description : CResOrgOptions - class to hold program options
*
* Compiler : Microsoft Visual C++ 6.0, Service Pack 3 or later
* Microsoft Visual C++ .NET 2003
*
* Target
* Environment : Windows 98/NT/2000/XP
*
* NOTE:
*
* This software is provided "as is" free for personal use. All
* title and copyrights in and to the software, including but not
* limited to any images, text, etc. incorporated into it, are
* owned by Anna-Jayne Metcalfe, except where acknowledged otherwise.
*
* Your may freely to use this code in your own products, PROVIDED
* this notice is not removed or modified.
*
*
* Visit http://www.annasplace.me.uk/resorg for latest updates
*
************************************************************************
*
* MODIFICATION HISTORY:
*
* This is a controlled document. See project configuration
* control tool for latest version and full version history.
*
* $Archive: /Projects/AddIns/ResOrg/ResOrgCore/ResOrgOptions.cpp $
* $Revision: 32 $
* $Date: 26/10/04 10:02 $
* $Author: Anna $
*
* $History: ResOrgOptions.cpp $
*
* ***************** Version 32 *****************
* User: Anna Date: 26/10/04 Time: 10:02
* Updated in $/Projects/AddIns/ResOrg/ResOrgCore
* Updated options to point to new website
*
* ***************** Version 31 *****************
* User: Anna Date: 29/08/04 Time: 21:32
* Updated in $/Projects/AddIns/ResOrg/ResOrgCore
* 1. Added CResOrgOptions::UpdateBooleanOption() as a means of
* simplifying the CResOrgOptions implementation
* 2. Added "Auto save symbol file config" option
* 3. Fixed some miscellaneous bugs
*
* ***************** Version 30 *****************
* User: Anna Date: 21/08/04 Time: 19:29
* Updated in $/Projects/AddIns/ResOrg/ResOrgCore
* Added "Check For Out Of Range Symbols" option
*
* ***************** Version 29 *****************
* User: Anna Date: 11/05/04 Time: 22:50
* Updated in $/Projects/AddIns/ResOrg/ResOrgCore
* 1. Improved handling of default fixed symbol lists
* 2. Corrected a couple of website URLs
*
* ***************** Version 28 *****************
* User: Anna Date: 11/05/04 Time: 0:22
* Updated in $/Projects/AddIns/ResOrg/ResOrgCore
* By popular request...added support for "Fixed" symbols
*
* ***************** Version 27 *****************
* User: Anna Date: 21/06/03 Time: 11:32
* Updated in $/Projects/AddIns/ResOrg/ResOrgCore
* Replaced CResOrgVersionCheck::IsNewVersion() with
* CResOrgVersionCheck::CompareVersions(). This allows CResOrgOptions to
* also determine if the installed version is *newer* than the current
* release
*
* ***************** Version 26 *****************
* User: Anna Date: 20/04/03 Time: 15:33
* Updated in $/Projects/AddIns/ResOrg/ResOrgCore
* Added m_bAutoSaveSymbolFileConfig (reserved for future use)
*
* ***************** Version 25 *****************
* User: Anna Date: 19/03/03 Time: 18:42
* Updated in $/Projects/AddIns/ResOrg/ResOrgCore
* Moved the "OPTIONS" #define to ResOrgOptions.h so that CResOrgSplashWnd
* can see it
*
* ***************** Version 24 *****************
* User: Anna Date: 15/02/03 Time: 20:47
* Updated in $/Projects/AddIns/ResOrg/ResOrgCore
* Changed big BOOLs into little bools
*
* ***************** Version 23 *****************
* User: Anna Date: 3/01/03 Time: 7:36
* Updated in $/Projects/AddIns/ResOrg/ResOrgCore
* Added an option to filter multi-file Symbols Displays by default
*
* ***************** Version 22 *****************
* User: Anna Date: 25/11/02 Time: 20:28
* Updated in $/Projects/AddIns/ResOrg/ResOrgCore
* 1. Updated website address on file banner and in the code
* 2. Added CResOrgOptions::GetEmailURL()
*
* ***************** Version 21 *****************
* User: Anna Date: 22/10/02 Time: 13:24
* Updated in $/Projects/AddIns/ResOrg/ResOrgCore
* Changed name/mail address (at last!)
*
* ***************** Version 20 *****************
* User: Andy Date: 11/06/02 Time: 11:14
* Updated in $/Projects/AddIns/ResOrg/ResOrgCore
* The VC5/6 and .NET builds now use different sections in the version.txt
* file on the server
*
* ***************** Version 19 *****************
* User: Andy Date: 7/06/02 Time: 17:04
* Updated in $/Projects/AddIns/ResOrg/ResOrgCore
* Renamed the ResOrgUtils module to ResOrgCore. Updated file banners
* accordingly
*
* ***************** Version 18 *****************
* User: Andy Date: 7/06/02 Time: 9:39
* Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
* The "Add-In" page is no longer used in the Visual C++.NET version
*
* ***************** Version 17 *****************
* User: Andy Date: 10/05/02 Time: 16:00
* Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
* Added "Use Office XP style menus" option
*
* ***************** Version 16 *****************
* User: Andy Date: 12/28/01 Time: 12:52a
* Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
* Added some new options and moved the others around a bit
*
* ***************** Version 15 *****************
* User: Andy Date: 11/15/01 Time: 1:43p
* Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
* Added new option to determine whether development versions should be
* checked for updates
*
* ***************** Version 14 *****************
* User: Andy Date: 11/11/01 Time: 12:51p
* Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
* Corrected defaults for options
*
* ***************** Version 13 *****************
* User: Andy Date: 10/21/01 Time: 11:00p
* Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
* Added "Warn if Next Symbol values are in use" option
*
* ***************** Version 12 *****************
* User: Andy Date: 8/07/01 Time: 8:35
* Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
* 1. CResOrgOptions::Configure() now allows the parent window of the
* Options dialog to be specified
* 2. CResOrgOptions::OnVersionCheckCompleted() now passes the HWND of
* the desktop to ShellExecute() when opening a browser window. This stops
* a download freezing when the app is closed
*
* ***************** Version 11 *****************
* User: Andy Date: 2/07/01 Time: 22:17
* Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
* Added additional options for web URLs (updated from the version
* checker)
*
* ***************** Version 10 *****************
* User: Andy Date: 26/05/01 Time: 15:14
* Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
* Added Mailing List prompt option
*
* ***************** Version 9 *****************
* User: Andy Date: 22/05/01 Time: 16:02
* Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
* 1. Removed version check code from Initialise () to a new
* DoVersionCheck() method. This prevents problems with the "nag" screen
* displayed by the ResOrg app.
* 2. Made StartVersionCheck() a bit more fault tolerant
*
* ***************** Version 8 *****************
* User: Andy Date: 22/05/01 Time: 6:42
* Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
* 1. Class now derived from CCmdTarget to allow it to receive WM_COMMAND
* notifications from the MainFrame
* 2. StartVersionCheck() now takes an extra parameter to allow dial-up
* networking prompts to be disabled
* 3. OnVersionCheckCompleted() now returns an error code instead of a
* boolean
* 4. Added OnExit()
*
* ***************** Version 7 *****************
* User: Andy Date: 16/05/01 Time: 20:56
* Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
* Added "Updates" page and version checking
*
* ***************** Version 6 *****************
* User: Andy Date: 12/05/01 Time: 6:47
* Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
* Added a registry entry to allow ResOrg to be forced to check a
* particular version of DevStudio
*
* ***************** Version 5 *****************
* User: Andy Date: 4/05/01 Time: 22:35
* Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
* Removed the "Apply" button from the Options Property Sheet
*
* ***************** Version 4 *****************
* User: Andy Date: 5/12/00 Time: 20:32
* Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
* Added web URL to options
*
* ***************** Version 3 *****************
* User: Andy Date: 3/12/00 Time: 8:33
* Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
* Added an option to determine whether to check if the add-in should be
* loaded by Visual Studio
*
* ***************** Version 2 *****************
* User: Andy Date: 29/11/00 Time: 18:38
* Updated in $/Projects/AddIns/ResOrg/ResOrgUtils
* Added file banners
*
* $Nokeywords: $
*
************************************************************************/
#include "StdAfx.h"
#include <Wininet.h>
#include "ResOrgCore_Priv.h"
#include "ResOrgOptionsGeneralPage.h"
#include "ResOrgOptionsSymbolsPage.h"
#include "ResOrgOptionsFixedSymbolsPage.h"
#include "ResOrgOptionsAddInPage.h"
#include "ResOrgOptionsUpdatesPage.h"
#include "ResOrgVersionCheck.h"
#include "ResOrgVersionUpdatedDlg.h"
#include "ResOrgOptions.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#if _MSC_VER >= 1300
#define VER_CHECK_SECTION_RELEASE _T("ResOrg.NET")
#define VER_CHECK_SECTION_DEV _T("ResOrg.NET Beta")
#else
#define VER_CHECK_SECTION_RELEASE _T("ResOrg")
#define VER_CHECK_SECTION_DEV _T("ResOrg Beta")
#endif
/////////////////////////////////////////////////////////////////////////////
// CResOrgOptions
CResOrgOptions::CResOrgOptions(void)
{
m_bWarnOnSymbolChanges = true;
m_bAutoFixNextSymbolValues = true;
m_bWarnIfNextSymbolValuesInUse = false;
m_bFilterMultiFileSymbolsDisplays = true;
m_bCheckForOutOfRangeSymbols = true;
m_bAskAboutLoading = true;
m_bAskAboutMailingList = true;
m_bShowTextOnToolbars = true;
m_bAutoReloadFiles = true;
m_bAutoHideWorkspace = true;
m_bXpStyleMenus = true;
m_bAutoSaveSymbolFileConfig = false;
m_sEmailURL = _T("support@riverblade.co.uk");
m_sWebURL = _T("http://www.riverblade.co.uk/products/resorg");
m_sFaqURL = m_sWebURL + _T("/faq.html");
m_sDiscussionBoardURL = m_sWebURL + _T("/forum");
m_sKnownBugsURL = m_sWebURL + _T("/limitations.html");
m_sMailingListURL = m_sWebURL + _T("/mailing_list.html");
m_sAboutMeURL = _T("http://www.annasplace.me.uk/aboutme.html");
m_sDevStudioVer = _T("");
m_bEnableVersionChecking = true;
m_nVersionCheckInterval = 7;
#ifdef _RESORG_EXPIRY_DATE
m_bCheckDevelopmentVersions = true;
#else
m_bCheckDevelopmentVersions = false;
#endif
m_timeLastUpdateCheck = CTime::GetCurrentTime();
m_pVersionChecker = NULL;
}
CResOrgOptions::~CResOrgOptions(void)
{
if (NULL != m_pVersionChecker)
{
delete m_pVersionChecker;
}
}
BEGIN_MESSAGE_MAP(CResOrgOptions, CResOrgOptions_BASE)
//{{AFX_MSG_MAP(CResOrgOptions)
ON_COMMAND( ID_RESORG_VERSION_CHECK, OnCmdResOrgUpdateCheckCompleted)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Virtual Overrides
bool CResOrgOptions::Initialise(void)
{
m_sEmailURL = ::AfxGetApp()->GetProfileString( OPTIONS,
OPTION_EMAIL_URL,
m_sEmailURL);
m_sWebURL = ::AfxGetApp()->GetProfileString( OPTIONS,
OPTION_WEB_URL,
m_sWebURL);
m_sFaqURL = ::AfxGetApp()->GetProfileString( OPTIONS,
OPTION_FAQ_URL,
m_sFaqURL);
m_sDiscussionBoardURL = ::AfxGetApp()->GetProfileString( OPTIONS,
OPTION_DISCUSSIONS_URL,
m_sDiscussionBoardURL);
m_sKnownBugsURL = ::AfxGetApp()->GetProfileString( OPTIONS,
OPTION_BUGS_URL,
m_sKnownBugsURL);
m_sMailingListURL = ::AfxGetApp()->GetProfileString( OPTIONS,
OPTION_MAILING_LIST_URL,
m_sMailingListURL);
m_sAboutMeURL = ::AfxGetApp()->GetProfileString( OPTIONS,
OPTION_ABOUTME_URL,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -