#include "pch.h"
#include <vector>
+#include <typeinfo>
#include "OptionsDef.h"
#include "OptionsMgr.h"
#include "RegOptionsMgr.h"
#include "OptionsDiffOptions.h"
#include "OptionsDiffColors.h"
#include "OptionsDirColors.h"
+#include "OptionsEditorSyntax.h"
#include "OptionsFont.h"
#include "DiffWrapper.h" // CMP_CONTENT
#include "paths.h"
#include "Constants.h"
// Functions to copy values set by installer from HKLM to HKCU.
-static void CopyHKLMValues();
static bool OpenHKLM(HKEY *key, LPCTSTR relpath = nullptr);
static bool OpenHKCU(HKEY *key, LPCTSTR relpath = nullptr);
static void CopyFromLMtoCU(HKEY lmKey, HKEY cuKey, LPCTSTR valname);
*/
void Init(COptionsMgr *pOptions)
{
- static_cast<CRegOptionsMgr *>(pOptions)->SetRegRootKey(_T("Thingamahoochie\\WinMerge\\"));
+ if (typeid(*pOptions) == typeid(CRegOptionsMgr))
+ {
+ static_cast<CRegOptionsMgr*>(pOptions)->SetRegRootKey(_T("Thingamahoochie\\WinMerge\\"));
+ }
LANGID LangId = GetUserDefaultLangID();
pOptions->InitOption(OPT_SELECTED_LANGUAGE, static_cast<int>(LangId));
pOptions->InitOption(OPT_SHOW_TOOLBAR, true);
pOptions->InitOption(OPT_SHOW_STATUSBAR, true);
pOptions->InitOption(OPT_SHOW_TABBAR, true);
- const int cxsmicon = GetSystemMetrics(SM_CXSMICON);
- pOptions->InitOption(OPT_TOOLBAR_SIZE, (cxsmicon < 28) ? 0 : (cxsmicon < 40 ? 1 : 2));
+ pOptions->InitOption(OPT_TOOLBAR_SIZE, 0);
pOptions->InitOption(OPT_RESIZE_PANES, false);
pOptions->InitOption(OPT_SYNTAX_HIGHLIGHT, true);
pOptions->InitOption(OPT_WORDWRAP, false);
pOptions->InitOption(OPT_VIEW_LINENUMBERS, false);
pOptions->InitOption(OPT_VIEW_WHITESPACE, false);
- pOptions->InitOption(OPT_CONNECT_MOVED_BLOCKS, 0);
+ pOptions->InitOption(OPT_VIEW_EOL, false);
pOptions->InitOption(OPT_SCROLL_TO_FIRST, false);
+ pOptions->InitOption(OPT_SCROLL_TO_FIRST_INLINE_DIFF, false);
pOptions->InitOption(OPT_VERIFY_OPEN_PATHS, true);
pOptions->InitOption(OPT_AUTO_COMPLETE_SOURCE, (int)1);
pOptions->InitOption(OPT_VIEW_FILEMARGIN, false);
pOptions->InitOption(OPT_DIFF_CONTEXT, (int)-1);
+ pOptions->InitOption(OPT_INVERT_DIFF_CONTEXT, false);
pOptions->InitOption(OPT_SPLIT_HORIZONTALLY, false);
pOptions->InitOption(OPT_RENDERING_MODE, -1);
pOptions->InitOption(OPT_FILE_SIZE_THRESHOLD, 64*1024*1024);
pOptions->InitOption(OPT_DIRVIEW_SORT_ASCENDING, true);
pOptions->InitOption(OPT_SHOW_SELECT_FILES_AT_STARTUP, false);
pOptions->InitOption(OPT_DIRVIEW_EXPAND_SUBDIRS, false);
+ pOptions->InitOption(OPT_DIRVIEW_COLUMN_ORDERS, _T(""));
+ pOptions->InitOption(OPT_DIRVIEW_COLUMN_WIDTHS, _T(""));
+ pOptions->InitOption(OPT_DIRVIEW3_COLUMN_ORDERS, _T(""));
+ pOptions->InitOption(OPT_DIRVIEW3_COLUMN_WIDTHS, _T(""));
pOptions->InitOption(OPT_REPORTFILES_REPORTTYPE, 0);
pOptions->InitOption(OPT_REPORTFILES_COPYTOCLIPBOARD, false);
pOptions->InitOption(OPT_AUTOMATIC_RESCAN, false);
pOptions->InitOption(OPT_ALLOW_MIXED_EOL, false);
+ pOptions->InitOption(OPT_COPY_FULL_LINE, false);
pOptions->InitOption(OPT_TAB_SIZE, (int)4);
pOptions->InitOption(OPT_TAB_TYPE, (int)0); // 0 means tabs inserted
- pOptions->InitOption(OPT_EXT_EDITOR_CMD, paths::ConcatPath(env::GetWindowsDirectory(), _T("NOTEPAD.EXE")));
+ pOptions->InitOption(OPT_EXT_EDITOR_CMD, _T("%windir%\\NOTEPAD.EXE"));
pOptions->InitOption(OPT_USE_RECYCLE_BIN, true);
- pOptions->InitOption(OPT_SINGLE_INSTANCE, false);
+ pOptions->InitOption(OPT_SINGLE_INSTANCE, 0);
pOptions->InitOption(OPT_MERGE_MODE, false);
// OPT_WORDDIFF_HIGHLIGHT is initialized above
pOptions->InitOption(OPT_BREAK_ON_WORDS, false);
pOptions->InitOption(OPT_CMP_IMG_THRESHOLD, 0);
pOptions->InitOption(OPT_CMP_IMG_INSERTIONDELETIONDETECTION_MODE, 0);
pOptions->InitOption(OPT_CMP_IMG_VECTOR_IMAGE_ZOOM_RATIO, 1000);
+ pOptions->InitOption(OPT_CMP_IMG_OCR_RESULT_TYPE, 0);
pOptions->InitOption(OPT_PROJECTS_PATH, _T(""));
pOptions->InitOption(OPT_USE_SYSTEM_TEMP_PATH, true);
pOptions->InitOption(OPT_CUSTOM_TEMP_PATH, _T(""));
pOptions->InitOption(OPT_LINEFILTER_ENABLED, false);
+ pOptions->InitOption(OPT_SUBSTITUTION_FILTERS_ENABLED, false);
+
pOptions->InitOption(OPT_FILEFILTER_CURRENT, _T("*.*"));
// CMainFrame initializes this when it is empty.
- pOptions->InitOption(OPT_FILTER_USERPATH, paths::ConcatPath(env::GetMyDocuments(), DefaultRelativeFilterPath));
+ pOptions->InitOption(OPT_FILTER_USERPATH, _T(""));
+ if (pOptions->GetString(OPT_FILTER_USERPATH).empty())
+ pOptions->SaveOption(OPT_FILTER_USERPATH, paths::ConcatPath(env::GetMyDocuments(), DefaultRelativeFilterPath));
pOptions->InitOption(OPT_FILEFILTER_SHARED, false);
pOptions->InitOption(OPT_CP_DEFAULT_MODE, (int)0);
pOptions->InitOption(OPT_ARCHIVE_FILTER_INDEX, 1);
pOptions->InitOption(OPT_PLUGINS_ENABLED, true);
- pOptions->InitOption(OPT_PLUGINS_DISABLED_LIST, _T(""));
- pOptions->InitOption(OPT_PLUGINS_CUSTOM_FILTERS_LIST, _T(""));
- pOptions->InitOption(OPT_PLUGINS_UNPACKER_MODE, PLUGIN_MANUAL);
- pOptions->InitOption(OPT_PLUGINS_PREDIFFER_MODE, PLUGIN_MANUAL);
- pOptions->InitOption(OPT_PLUGINS_UNPACK_DONT_CHECK_EXTENSION, false);
+ pOptions->InitOption(OPT_PLUGINS_CUSTOM_SETTINGS_LIST, _T(""));
+ pOptions->InitOption(OPT_PLUGINS_UNPACKER_MODE, false);
+ pOptions->InitOption(OPT_PLUGINS_PREDIFFER_MODE, false);
+ pOptions->InitOption(OPT_PLUGINS_UNPACK_DONT_CHECK_EXTENSION, true);
+ pOptions->InitOption(OPT_PLUGINS_OPEN_IN_SAME_FRAME_TYPE, false);
pOptions->InitOption(OPT_PATCHCREATOR_PATCH_STYLE, 0);
pOptions->InitOption(OPT_PATCHCREATOR_CONTEXT_LINES, 0);
Options::DiffOptions::SetDefaults(pOptions);
Options::DiffColors::SetDefaults(pOptions);
Options::DirColors::SetDefaults(pOptions);
+ Options::EditorSyntax::SetDefaults(pOptions);
Options::Font::SetDefaults(pOptions);
}