2005-12-27 Perry
+ PATCH: [ 1390793 ] New global function GetOptionMgr
+ Src: DirActions.cpp DirDoc.cpp DirView.cpp DirViewColHandler.cpp
+ LocationView.cpp MainFrm.cpp MainFrm.h MergeDiffDetailView.cpp
+ MergeDoc.cpp MergeEditView.cpp OpenDlg.cpp
+ Src/Common: OptionsMgr.h
+
+2005-12-27 Perry
PATCH: [ 1382130 ] New line-based RCLocalizationHelper
See plugins.
CString m_registryRoot;
};
+COptionsMgr * GetOptionsMgr();
#endif // _OPTIONS_MGR_
\ No newline at end of file
}
// Check option and enable putting deleted items to Recycle Bin
- if (mf->m_options.GetBool(OPT_USE_RECYCLE_BIN))
+ if (GetOptionsMgr()->GetBool(OPT_USE_RECYCLE_BIN))
operFlags |= FOF_ALLOWUNDO;
fileOp.SetOperationFlags(operation, this, operFlags);
{
DIFFOPTIONS options = {0};
- m_diffWrapper.SetDetectMovedBlocks(mf->m_options.GetBool(OPT_CMP_MOVED_BLOCKS));
- options.nIgnoreWhitespace = mf->m_options.GetInt(OPT_CMP_IGNORE_WHITESPACE);
- options.bIgnoreBlankLines = mf->m_options.GetBool(OPT_CMP_IGNORE_BLANKLINES);
- options.bIgnoreCase = mf->m_options.GetBool(OPT_CMP_IGNORE_CASE);
- options.bEolSensitive = mf->m_options.GetBool(OPT_CMP_EOL_SENSITIVE);
+ m_diffWrapper.SetDetectMovedBlocks(GetOptionsMgr()->GetBool(OPT_CMP_MOVED_BLOCKS));
+ options.nIgnoreWhitespace = GetOptionsMgr()->GetInt(OPT_CMP_IGNORE_WHITESPACE);
+ options.bIgnoreBlankLines = GetOptionsMgr()->GetBool(OPT_CMP_IGNORE_BLANKLINES);
+ options.bIgnoreCase = GetOptionsMgr()->GetBool(OPT_CMP_IGNORE_CASE);
+ options.bEolSensitive = GetOptionsMgr()->GetBool(OPT_CMP_EOL_SENSITIVE);
m_diffWrapper.SetOptions(&options);
}
}
m_pCtxt->m_hDirFrame = pf->GetSafeHwnd();
- m_pCtxt->m_bGuessEncoding = mf->m_options.GetBool(OPT_CP_DETECT);
- m_pCtxt->m_nCompMethod = mf->m_options.GetInt(OPT_CMP_METHOD);
- m_pCtxt->m_bIgnoreSmallTimeDiff = mf->m_options.GetBool(OPT_IGNORE_SMALL_FILETIME);
- m_pCtxt->m_bStopAfterFirstDiff = mf->m_options.GetBool(OPT_CMP_STOP_AFTER_FIRST);
- m_pCtxt->m_nQuickCompareLimit = mf->m_options.GetInt(OPT_CMP_QUICK_LIMIT);
+ m_pCtxt->m_bGuessEncoding = GetOptionsMgr()->GetBool(OPT_CP_DETECT);
+ m_pCtxt->m_nCompMethod = GetOptionsMgr()->GetInt(OPT_CMP_METHOD);
+ m_pCtxt->m_bIgnoreSmallTimeDiff = GetOptionsMgr()->GetBool(OPT_IGNORE_SMALL_FILETIME);
+ m_pCtxt->m_bStopAfterFirstDiff = GetOptionsMgr()->GetBool(OPT_CMP_STOP_AFTER_FIRST);
+ m_pCtxt->m_nQuickCompareLimit = GetOptionsMgr()->GetInt(OPT_CMP_QUICK_LIMIT);
m_pCtxt->m_pCompareStats = m_pCompareStats;
// Set total items count since we don't collect items
{
// Treat SKIPPED as a 'super'-flag. If item is skipped and user
// wants to see skipped items show item regardless of other flags
- return mf->m_options.GetBool(OPT_SHOW_SKIPPED);
+ return GetOptionsMgr()->GetBool(OPT_SHOW_SKIPPED);
}
// Subfolders in non-recursive compare can only be skipped or unique
return 0;
// left/right filters
- if (di.isSideLeft() && !mf->m_options.GetBool(OPT_SHOW_UNIQUE_LEFT))
+ if (di.isSideLeft() && !GetOptionsMgr()->GetBool(OPT_SHOW_UNIQUE_LEFT))
return 0;
- if (di.isSideRight() && !mf->m_options.GetBool(OPT_SHOW_UNIQUE_RIGHT))
+ if (di.isSideRight() && !GetOptionsMgr()->GetBool(OPT_SHOW_UNIQUE_RIGHT))
return 0;
}
else
{
// file type filters
- if (di.isBin() && !mf->m_options.GetBool(OPT_SHOW_BINARIES))
+ if (di.isBin() && !GetOptionsMgr()->GetBool(OPT_SHOW_BINARIES))
return 0;
// result filters
- if (di.isResultSame() && !mf->m_options.GetBool(OPT_SHOW_IDENTICAL))
+ if (di.isResultSame() && !GetOptionsMgr()->GetBool(OPT_SHOW_IDENTICAL))
return 0;
if (di.isResultError() && !mf->m_bShowErrors)
return 0;
- if (di.isResultDiff() && !mf->m_options.GetBool(OPT_SHOW_DIFFERENT))
+ if (di.isResultDiff() && !GetOptionsMgr()->GetBool(OPT_SHOW_DIFFERENT))
return 0;
// left/right filters
- if (di.isSideLeft() && !mf->m_options.GetBool(OPT_SHOW_UNIQUE_LEFT))
+ if (di.isSideLeft() && !GetOptionsMgr()->GetBool(OPT_SHOW_UNIQUE_LEFT))
return 0;
- if (di.isSideRight() && !mf->m_options.GetBool(OPT_SHOW_UNIQUE_RIGHT))
+ if (di.isSideRight() && !GetOptionsMgr()->GetBool(OPT_SHOW_UNIQUE_RIGHT))
return 0;
}
return 1;
{
CMergeDoc * pMergeDoc = 0;
// policy -- use an existing merge doc if available
- if (!mf->m_options.GetBool(OPT_MULTIDOC_MERGEDOCS) && !m_MergeDocs.IsEmpty())
+ if (!GetOptionsMgr()->GetBool(OPT_MULTIDOC_MERGEDOCS) && !m_MergeDocs.IsEmpty())
{
*pNew = FALSE;
pMergeDoc = m_MergeDocs.GetHead();
{
DIFFOPTIONS options;
- m_diffWrapper.SetDetectMovedBlocks(mf->m_options.GetBool(OPT_CMP_MOVED_BLOCKS));
- options.nIgnoreWhitespace = mf->m_options.GetInt(OPT_CMP_IGNORE_WHITESPACE);
- options.bIgnoreBlankLines = mf->m_options.GetBool(OPT_CMP_IGNORE_BLANKLINES);
- options.bIgnoreCase = mf->m_options.GetBool(OPT_CMP_IGNORE_CASE);
- options.bEolSensitive = mf->m_options.GetBool(OPT_CMP_EOL_SENSITIVE);
+ m_diffWrapper.SetDetectMovedBlocks(GetOptionsMgr()->GetBool(OPT_CMP_MOVED_BLOCKS));
+ options.nIgnoreWhitespace = GetOptionsMgr()->GetInt(OPT_CMP_IGNORE_WHITESPACE);
+ options.bIgnoreBlankLines = GetOptionsMgr()->GetBool(OPT_CMP_IGNORE_BLANKLINES);
+ options.bIgnoreCase = GetOptionsMgr()->GetBool(OPT_CMP_IGNORE_CASE);
+ options.bEolSensitive = GetOptionsMgr()->GetBool(OPT_CMP_EOL_SENSITIVE);
m_diffWrapper.SetOptions(&options);
if (m_pDirView)
// Show selection all the time, so user can see current item even when
// focus is elsewhere (ie, on file edit window)
m_dwDefaultStyle |= LVS_REPORT | LVS_SHOWSELALWAYS;
- m_bEscCloses = mf->m_options.GetBool(OPT_CLOSE_WITH_ESC);
+ m_bEscCloses = GetOptionsMgr()->GetBool(OPT_CLOSE_WITH_ESC);
}
CDirView::~CDirView()
GetDocument()->SetDirView(this);
// Load user-selected font
- CMainFrame *pMf = dynamic_cast<CMainFrame*>(AfxGetMainWnd());
- if (pMf->m_options.GetBool(OPT_FONT_DIRCMP_USECUSTOM))
+ if (GetOptionsMgr()->GetBool(OPT_FONT_DIRCMP_USECUSTOM))
{
+ CMainFrame *pMf = dynamic_cast<CMainFrame*>(AfxGetMainWnd());
m_font.CreateFontIndirect(&pMf->m_lfDir);
SetFont(&m_font, TRUE);
}
{
// set sort parameters and handle ascending/descending
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*) pNMHDR;
- int oldSortColumn = mf->m_options.GetInt(OPT_DIRVIEW_SORT_COLUMN);
+ int oldSortColumn = GetOptionsMgr()->GetInt(OPT_DIRVIEW_SORT_COLUMN);
int sortcol = m_invcolorder[pNMListView->iSubItem];
if (sortcol == oldSortColumn)
{
// Swap direction
- bool bSortAscending = mf->m_options.GetBool(OPT_DIRVIEW_SORT_ASCENDING);
- mf->m_options.SaveOption(OPT_DIRVIEW_SORT_ASCENDING, !bSortAscending);
+ bool bSortAscending = GetOptionsMgr()->GetBool(OPT_DIRVIEW_SORT_ASCENDING);
+ GetOptionsMgr()->SaveOption(OPT_DIRVIEW_SORT_ASCENDING, !bSortAscending);
}
else
{
- mf->m_options.SaveOption(OPT_DIRVIEW_SORT_COLUMN, sortcol);
+ GetOptionsMgr()->SaveOption(OPT_DIRVIEW_SORT_COLUMN, sortcol);
// most columns start off ascending, but not dates
bool bSortAscending = IsDefaultSortAscending(sortcol);
- mf->m_options.SaveOption(OPT_DIRVIEW_SORT_ASCENDING, bSortAscending);
+ GetOptionsMgr()->SaveOption(OPT_DIRVIEW_SORT_ASCENDING, bSortAscending);
}
SortColumnsAppropriately();
void CDirView::SortColumnsAppropriately()
{
- int sortCol = mf->m_options.GetInt(OPT_DIRVIEW_SORT_COLUMN);
+ int sortCol = GetOptionsMgr()->GetInt(OPT_DIRVIEW_SORT_COLUMN);
if (sortCol == -1)
return;
- bool bSortAscending = mf->m_options.GetBool(OPT_DIRVIEW_SORT_ASCENDING);
+ bool bSortAscending = GetOptionsMgr()->GetBool(OPT_DIRVIEW_SORT_ASCENDING);
m_ctlSortHeader.SetSortImage(ColLogToPhys(sortCol), bSortAscending);
//sort using static CompareFunc comparison function
CompareState cs(this, sortCol, bSortAscending);
}
// Close open documents first (ask to save unsaved data)
- if (!mf->m_options.GetBool(OPT_MULTIDOC_MERGEDOCS))
+ if (!GetOptionsMgr()->GetBool(OPT_MULTIDOC_MERGEDOCS))
{
if (!pDoc->CloseMergeDocs())
return;
pDoc->CompareReady();
Redisplay();
- if (mf->m_options.GetBool(OPT_SCROLL_TO_FIRST))
+ if (GetOptionsMgr()->GetBool(OPT_SCROLL_TO_FIRST))
OnFirstdiff();
else
MoveSelection(0, 0, 0);
*/
void CDirView::RefreshOptions()
{
- m_bEscCloses = mf->m_options.GetBool(OPT_CLOSE_WITH_ESC);
+ m_bEscCloses = GetOptionsMgr()->GetBool(OPT_CLOSE_WITH_ESC);
}
/**
#include "Merge.h"
#include "DirView.h"
#include "DirDoc.h"
-#include "MainFrm.h"
#include "resource.h"
#include "coretools.h"
#include "dllver.h"
#include "DirViewColItems.h"
#include "DirColsDlg.h"
#include "OptionsDef.h"
+#include "OptionsMgr.h"
#ifdef _DEBUG
#define new DEBUG_NEW
const CDirColsDlg::ColumnArray & cols = dlg.GetColumns();
ClearColumnOrders();
m_dispcols = 0;
- const int sortColumn = mf->m_options.GetInt(OPT_DIRVIEW_SORT_COLUMN);
+ const int sortColumn = GetOptionsMgr()->GetInt(OPT_DIRVIEW_SORT_COLUMN);
for (int i=0; i<cols.GetSize(); ++i)
{
int log = cols[i].log_col;
// If sorted column was hidden, reset sorting
if (log == sortColumn && phy < 0)
{
- mf->m_options.Reset(OPT_DIRVIEW_SORT_COLUMN);
- mf->m_options.Reset(OPT_DIRVIEW_SORT_ASCENDING);
+ GetOptionsMgr()->Reset(OPT_DIRVIEW_SORT_COLUMN);
+ GetOptionsMgr()->Reset(OPT_DIRVIEW_SORT_ASCENDING);
}
}
if (m_dispcols < 1)
#include "stdafx.h"
#include "merge.h"
-#include "MainFrm.h"
+#include "OptionsMgr.h"
#include "MergeEditView.h"
#include "LocationView.h"
#include "MergeDoc.h"
// NB: set m_bIgnoreTrivials to false to see trivial diffs in the LocationView
// There is no GUI to do this
- SetConnectMovedBlocks(mf->m_options.GetInt(OPT_CONNECT_MOVED_BLOCKS));
+ SetConnectMovedBlocks(GetOptionsMgr()->GetInt(OPT_CONNECT_MOVED_BLOCKS));
m_view[0] = NULL;
m_view[1] = NULL;
if (m_displayMovedBlocks == displayMovedBlocks)
return;
- mf->m_options.SaveOption(OPT_CONNECT_MOVED_BLOCKS, displayMovedBlocks);
+ GetOptionsMgr()->SaveOption(OPT_CONNECT_MOVED_BLOCKS, displayMovedBlocks);
m_displayMovedBlocks = displayMovedBlocks;
if (this->GetSafeHwnd() != NULL)
if (IsWindowVisible())
if (pDirDoc && !pDirDoc->CloseMergeDocs())
return FALSE;
- CString strLeft(pszLeft);
- CString strRight(pszRight);
+ CString strLeft = pszLeft;
+ CString strRight = pszRight;
PackingInfo infoUnpacker;
BOOL bROLeft = dwLeftFlags & FFILEOPEN_READONLY;
return;
}
}
+
+/**
+ * @brief Access to the singleton options manager
+ */
+COptionsMgr *
+GetOptionsMgr()
+{
+ return mf->GetTheOptionsMgr();
+}
CString *psError);
BOOL DoFileOpen(LPCTSTR pszLeft = NULL, LPCTSTR pszRight = NULL,
DWORD dwLeftFlags = 0, DWORD dwRightFlags = 0, BOOL bRecurse = FALSE, CDirDoc *pDirDoc = NULL);
- int ShowMergeDoc(CDirDoc * pDirDoc, const FileLocation & filelocLeft, const FileLocation & filelocRight, BOOL bROLeft, BOOL bRORight, PackingInfo * infoUnpacker = NULL);
+ int ShowMergeDoc(CDirDoc * pDirDoc, const FileLocation & filelocLeft,
+ const FileLocation & filelocRight, BOOL bROLeft, BOOL bRORight, PackingInfo * infoUnpacker = NULL);
void UpdateResources();
BOOL CreateBackup(LPCTSTR pszPath);
int HandleReadonlySave(CString& strSavePath, BOOL bMultiFile, BOOL &bApplyToAll);
void GetDirViews(DirViewList * pDirViews);
void GetMergeEditViews(MergeEditViewList * pMergeViews);
void CheckinToClearCase(CString strDestinationPath);
+ COptionsMgr * GetTheOptionsMgr() { return &m_options; }
// Overrides
// ClassWizard generated virtual function overrides
// Public implementation data
public:
- CRegOptions m_options; /**< Options manager */
BOOL m_bFirstTime; /**< If first time frame activated, get pos from reg */
CString m_strSaveAsPath; /**< "3rd path" where output saved if given */
BOOL m_bEscShutdown; /**< If commandline switch -e given ESC closes appliction */
* @name Version Control System (VCS) integration.
*/
/*@{*/
+protected:
CString m_strVssUser; /**< Visual Source Safe User ID */
CString m_strVssPassword; /**< Visual Source Safe Password */
CString m_strVssDatabase;
CString m_strCCComment; /**< ClearCase comment */
+public:
BOOL m_bCheckinVCS; /**< TRUE if files should be checked in after checkout */
BOOL m_CheckOutMulti; /**< Suppresses VSS int. code asking checkout for every file */
BOOL m_bVCProjSync; /**< VC project opened from VSS sync? */
/*@}*/
// Implementation data
+protected:
+
-protected: // control bar embedded members
+ // control bar embedded members
CStatusBar m_wndStatusBar;
ToolBarXPThemes m_wndToolBar;
};
BCMenu * m_pMenus[MENU_COUNT];
+ CRegOptions m_options; /**< Options manager */
// Generated message map functions
protected:
void GetFontProperties();
#include "MergeDiffDetailView.h"
#include "MergeDoc.h"
#include "MainFrm.h"
+#include "OptionsMgr.h"
#include "ChildFrm.h"
#include "OptionsDef.h"
#include "SyntaxColors.h"
// Set the tab size now, just in case the options change...
// We don't update it at the end of OnOptions,
// we can update it safely now
- SetTabSize(mf->m_options.GetInt(OPT_TAB_SIZE));
+ SetTabSize(GetOptionsMgr()->GetInt(OPT_TAB_SIZE));
return TRUE;
}
if ((dwLineFlags & LF_DIFF) != LF_DIFF || (dwLineFlags & LF_MOVED) == LF_MOVED)
return 0;
- if (!mf->m_options.GetBool(OPT_WORDDIFF_HIGHLIGHT))
+ if (!GetOptionsMgr()->GetBool(OPT_WORDDIFF_HIGHLIGHT))
return 0;
int nLineLength = GetLineLength(nLineIndex);
switch (nColorIndex & ~COLORINDEX_APPLYFORCE)
{
case COLORINDEX_HIGHLIGHTBKGND1:
- return mf->m_options.GetInt(OPT_CLR_SELECTED_WORDDIFF);
+ return GetOptionsMgr()->GetInt(OPT_CLR_SELECTED_WORDDIFF);
case COLORINDEX_HIGHLIGHTTEXT1:
- return mf->m_options.GetInt(OPT_CLR_SELECTED_WORDDIFF_TEXT);
+ return GetOptionsMgr()->GetInt(OPT_CLR_SELECTED_WORDDIFF_TEXT);
case COLORINDEX_HIGHLIGHTBKGND2:
- return mf->m_options.GetInt(OPT_CLR_WORDDIFF);
+ return GetOptionsMgr()->GetInt(OPT_CLR_WORDDIFF);
case COLORINDEX_HIGHLIGHTTEXT2:
- return mf->m_options.GetInt(OPT_CLR_WORDDIFF_TEXT);
+ return GetOptionsMgr()->GetInt(OPT_CLR_WORDDIFF_TEXT);
default:
return CCrystalTextView::GetColor(nColorIndex);
}
// Lines with only the LF_DIFF/LF_TRIVIAL flags are not colored with Winmerge colors
if (dwLineFlags & (LF_WINMERGE_FLAGS & ~LF_DIFF & ~LF_TRIVIAL & ~LF_MOVED))
{
- crText = mf->m_options.GetInt(OPT_CLR_DIFF);
+ crText = GetOptionsMgr()->GetInt(OPT_CLR_DIFF);
bDrawWhitespace = TRUE;
if (dwLineFlags & LF_GHOST)
{
- crBkgnd = mf->m_options.GetInt(OPT_CLR_DIFF_DELETED);
+ crBkgnd = GetOptionsMgr()->GetInt(OPT_CLR_DIFF_DELETED);
}
}
else
{
// If no syntax hilighting
- if (!mf->m_options.GetBool(OPT_SYNTAX_HIGHLIGHT))
+ if (!GetOptionsMgr()->GetBool(OPT_SYNTAX_HIGHLIGHT))
{
crBkgnd = GetSysColor (COLOR_WINDOW);
crText = GetSysColor (COLOR_WINDOWTEXT);
#include "dllver.h"
#include "codepage.h"
#include "paths.h"
+#include "OptionsMgr.h"
#ifdef _DEBUG
#define new DEBUG_NEW
m_pInfoUnpacker = new PackingInfo;
m_nBufferType[0] = BUFFER_NORMAL;
m_nBufferType[1] = BUFFER_NORMAL;
- m_bMergingMode = mf->m_options.GetBool(OPT_MERGE_MODE);
+ m_bMergingMode = GetOptionsMgr()->GetBool(OPT_MERGE_MODE);
m_bEditAfterRescan[0] = FALSE;
m_bEditAfterRescan[1] = FALSE;
m_ptBuf[0] = new CDiffTextBuffer(this, 0);
m_pRescanFileInfo[0] = new DiffFileInfo();
m_pRescanFileInfo[1] = new DiffFileInfo();
- m_diffWrapper.SetDetectMovedBlocks(mf->m_options.GetBool(OPT_CMP_MOVED_BLOCKS));
- options.nIgnoreWhitespace = mf->m_options.GetInt(OPT_CMP_IGNORE_WHITESPACE);
- options.bIgnoreBlankLines = mf->m_options.GetBool(OPT_CMP_IGNORE_BLANKLINES);
- options.bIgnoreCase = mf->m_options.GetBool(OPT_CMP_IGNORE_CASE);
- options.bEolSensitive = mf->m_options.GetBool(OPT_CMP_EOL_SENSITIVE);
+ m_diffWrapper.SetDetectMovedBlocks(GetOptionsMgr()->GetBool(OPT_CMP_MOVED_BLOCKS));
+ options.nIgnoreWhitespace = GetOptionsMgr()->GetInt(OPT_CMP_IGNORE_WHITESPACE);
+ options.bIgnoreBlankLines = GetOptionsMgr()->GetBool(OPT_CMP_IGNORE_BLANKLINES);
+ options.bIgnoreCase = GetOptionsMgr()->GetBool(OPT_CMP_IGNORE_CASE);
+ options.bEolSensitive = GetOptionsMgr()->GetBool(OPT_CMP_EOL_SENSITIVE);
m_diffWrapper.SetOptions(&options);
m_diffWrapper.SetPrediffer(NULL);
return SAVE_FAILED; // No filename, cannot save...
if (nCrlfStyle == CRLF_STYLE_AUTOMATIC &&
- !mf->m_options.GetBool(OPT_ALLOW_MIXED_EOL))
+ !GetOptionsMgr()->GetBool(OPT_ALLOW_MIXED_EOL))
{
// get the default nCrlfStyle of the CDiffTextBuffer
nCrlfStyle = GetCRLFMode();
{
DiffFileInfo *fileInfo = NULL;
BOOL bFileChanged = FALSE;
- BOOL bIgnoreSmallDiff = mf->m_options.GetBool(OPT_IGNORE_SMALL_FILETIME);
+ BOOL bIgnoreSmallDiff = GetOptionsMgr()->GetBool(OPT_IGNORE_SMALL_FILETIME);
int tolerance = 0;
if (bIgnoreSmallDiff)
tolerance = SmallTimeDiff; // From MainFrm.h
retVal = FRESULT_OK;
// By default, WinMerge unifies EOL to the most used type (when diffing or saving)
// As some info are lost, we request a confirmation from the user
- if (!mf->m_options.GetBool(OPT_ALLOW_MIXED_EOL))
+ if (!GetOptionsMgr()->GetBool(OPT_ALLOW_MIXED_EOL))
{
CString s;
AfxFormatString1(s, IDS_SUGGEST_PRESERVEEOL, sFileName);
{
// the user wants to keep the original chars
mf->SetEOLMixed(TRUE);
- mf->m_options.SaveOption(OPT_ALLOW_MIXED_EOL, true);
+ GetOptionsMgr()->SaveOption(OPT_ALLOW_MIXED_EOL, true);
}
}
}
DIFFOPTIONS diffOptions = {0};
m_diffWrapper.GetOptions(&diffOptions);
if (m_ptBuf[0]->GetCRLFMode() != m_ptBuf[1]->GetCRLFMode() &&
- !mf->m_options.GetBool(OPT_ALLOW_MIXED_EOL) && diffOptions.bEolSensitive)
+ !GetOptionsMgr()->GetBool(OPT_ALLOW_MIXED_EOL) && diffOptions.bEolSensitive)
{
// Options and files not are not compatible :
// Sensitive to EOL on, allow mixing EOL off, and files have a different EOL style.
{
diffOptions.bEolSensitive = FALSE;
m_diffWrapper.SetOptions(&diffOptions);
- mf->m_options.SaveOption(OPT_CMP_EOL_SENSITIVE, false);
+ GetOptionsMgr()->SaveOption(OPT_CMP_EOL_SENSITIVE, false);
}
}
pRightDetail->SetTextType(sextR);
if (bLeftTyped != bRightTyped &&
- mf->m_options.GetBool(OPT_UNREC_APPLYSYNTAX))
+ GetOptionsMgr()->GetBool(OPT_UNREC_APPLYSYNTAX))
{
CCrystalTextView::TextDefinition *enuType;
}
// scroll to first diff
- if (mf->m_options.GetBool(OPT_SCROLL_TO_FIRST) &&
+ if (GetOptionsMgr()->GetBool(OPT_SCROLL_TO_FIRST) &&
m_diffList.HasSignificantDiffs())
{
int nDiff = m_diffList.FirstSignificantDiff();
}
// Enable/disable automatic rescan (rescanning after edit)
- pLeft->EnableRescan(mf->m_options.GetBool(OPT_AUTOMATIC_RESCAN));
- pRight->EnableRescan(mf->m_options.GetBool(OPT_AUTOMATIC_RESCAN));
+ pLeft->EnableRescan(GetOptionsMgr()->GetBool(OPT_AUTOMATIC_RESCAN));
+ pRight->EnableRescan(GetOptionsMgr()->GetBool(OPT_AUTOMATIC_RESCAN));
// SetTextType will revert to language dependent defaults for tab
- pLeft->SetTabSize(mf->m_options.GetInt(OPT_TAB_SIZE));
- pRight->SetTabSize(mf->m_options.GetInt(OPT_TAB_SIZE));
- pLeft->SetViewTabs(mf->m_options.GetBool(OPT_VIEW_WHITESPACE));
- pRight->SetViewTabs(mf->m_options.GetBool(OPT_VIEW_WHITESPACE));
- pLeft->SetViewEols(mf->m_options.GetBool(OPT_VIEW_WHITESPACE),
- mf->m_options.GetBool(OPT_ALLOW_MIXED_EOL));
- pRight->SetViewEols(mf->m_options.GetBool(OPT_VIEW_WHITESPACE),
- mf->m_options.GetBool(OPT_ALLOW_MIXED_EOL));
- pLeft->SetWordWrapping(mf->m_options.GetBool(OPT_WORDWRAP));
- pRight->SetWordWrapping(mf->m_options.GetBool(OPT_WORDWRAP));
-
- pLeftDetail->SetTabSize(mf->m_options.GetInt(OPT_TAB_SIZE));
- pRightDetail->SetTabSize(mf->m_options.GetInt(OPT_TAB_SIZE));
- pLeftDetail->SetViewTabs(mf->m_options.GetBool(OPT_VIEW_WHITESPACE));
- pRightDetail->SetViewTabs(mf->m_options.GetBool(OPT_VIEW_WHITESPACE));
- pLeftDetail->SetViewEols(mf->m_options.GetBool(OPT_VIEW_WHITESPACE),
- mf->m_options.GetBool(OPT_ALLOW_MIXED_EOL));
- pRightDetail->SetViewEols(mf->m_options.GetBool(OPT_VIEW_WHITESPACE),
- mf->m_options.GetBool(OPT_ALLOW_MIXED_EOL));
+ pLeft->SetTabSize(GetOptionsMgr()->GetInt(OPT_TAB_SIZE));
+ pRight->SetTabSize(GetOptionsMgr()->GetInt(OPT_TAB_SIZE));
+ pLeft->SetViewTabs(GetOptionsMgr()->GetBool(OPT_VIEW_WHITESPACE));
+ pRight->SetViewTabs(GetOptionsMgr()->GetBool(OPT_VIEW_WHITESPACE));
+ pLeft->SetViewEols(GetOptionsMgr()->GetBool(OPT_VIEW_WHITESPACE),
+ GetOptionsMgr()->GetBool(OPT_ALLOW_MIXED_EOL));
+ pRight->SetViewEols(GetOptionsMgr()->GetBool(OPT_VIEW_WHITESPACE),
+ GetOptionsMgr()->GetBool(OPT_ALLOW_MIXED_EOL));
+ pLeft->SetWordWrapping(GetOptionsMgr()->GetBool(OPT_WORDWRAP));
+ pRight->SetWordWrapping(GetOptionsMgr()->GetBool(OPT_WORDWRAP));
+
+ pLeftDetail->SetTabSize(GetOptionsMgr()->GetInt(OPT_TAB_SIZE));
+ pRightDetail->SetTabSize(GetOptionsMgr()->GetInt(OPT_TAB_SIZE));
+ pLeftDetail->SetViewTabs(GetOptionsMgr()->GetBool(OPT_VIEW_WHITESPACE));
+ pRightDetail->SetViewTabs(GetOptionsMgr()->GetBool(OPT_VIEW_WHITESPACE));
+ pLeftDetail->SetViewEols(GetOptionsMgr()->GetBool(OPT_VIEW_WHITESPACE),
+ GetOptionsMgr()->GetBool(OPT_ALLOW_MIXED_EOL));
+ pRightDetail->SetViewEols(GetOptionsMgr()->GetBool(OPT_VIEW_WHITESPACE),
+ GetOptionsMgr()->GetBool(OPT_ALLOW_MIXED_EOL));
pLeftDetail->SetWordWrapping(FALSE);
pRightDetail->SetWordWrapping(FALSE);
UpdateHeaderPath(1);
// Set tab type (tabs/spaces)
- BOOL bInsertTabs = (mf->m_options.GetInt(OPT_TAB_TYPE) == 0);
+ BOOL bInsertTabs = (GetOptionsMgr()->GetInt(OPT_TAB_TYPE) == 0);
pLeft->SetInsertTabs(bInsertTabs);
pRight->SetInsertTabs(bInsertTabs);
{
DIFFOPTIONS options = {0};
- m_diffWrapper.SetDetectMovedBlocks(mf->m_options.GetBool(OPT_CMP_MOVED_BLOCKS));
- options.nIgnoreWhitespace = mf->m_options.GetInt(OPT_CMP_IGNORE_WHITESPACE);
- options.bIgnoreBlankLines = mf->m_options.GetBool(OPT_CMP_IGNORE_BLANKLINES);
- options.bIgnoreCase = mf->m_options.GetBool(OPT_CMP_IGNORE_CASE);
- options.bEolSensitive = mf->m_options.GetBool(OPT_CMP_EOL_SENSITIVE);
+ m_diffWrapper.SetDetectMovedBlocks(GetOptionsMgr()->GetBool(OPT_CMP_MOVED_BLOCKS));
+ options.nIgnoreWhitespace = GetOptionsMgr()->GetInt(OPT_CMP_IGNORE_WHITESPACE);
+ options.bIgnoreBlankLines = GetOptionsMgr()->GetBool(OPT_CMP_IGNORE_BLANKLINES);
+ options.bIgnoreCase = GetOptionsMgr()->GetBool(OPT_CMP_IGNORE_CASE);
+ options.bEolSensitive = GetOptionsMgr()->GetBool(OPT_CMP_EOL_SENSITIVE);
m_diffWrapper.SetOptions(&options);
void CMergeDoc::SetMergingMode(BOOL bMergingMode)
{
m_bMergingMode = bMergingMode;
- mf->m_options.SaveOption(OPT_MERGE_MODE, m_bMergingMode == TRUE);
+ GetOptionsMgr()->SaveOption(OPT_MERGE_MODE, m_bMergingMode == TRUE);
}
/**
if (bDetectMovedBlocks == m_diffWrapper.GetDetectMovedBlocks())
return;
- mf->m_options.SaveOption(OPT_CMP_MOVED_BLOCKS, bDetectMovedBlocks == TRUE);
+ GetOptionsMgr()->SaveOption(OPT_CMP_MOVED_BLOCKS, bDetectMovedBlocks == TRUE);
m_diffWrapper.SetDetectMovedBlocks(bDetectMovedBlocks);
FlushAndRescan();
}
BOOL CMergeDoc::GetOptionInt(LPCTSTR name) const
{
// Currently options are held by the main frame, in a subobject called m_options
- return mf->m_options.GetInt(name);
+ return GetOptionsMgr()->GetInt(name);
}
// Lookup named property and return as BOOL
BOOL CMergeDoc::GetOptionBool(LPCTSTR name) const
{
// Currently options are held by the main frame, in a subobject called m_options
- return mf->m_options.GetBool(name);
+ return GetOptionsMgr()->GetBool(name);
}
// Return current word breaking break type setting (whitespace only or include punctuation)
#include "MergeDiffDetailView.h"
#include "MergeDoc.h"
#include "MainFrm.h"
+#include "OptionsMgr.h"
#include "WaitStatusCursor.h"
#include "MergeEditStatus.h"
#include "FileTransform.h"
SetParser(&m_xParser);
m_bAutomaticRescan = FALSE;
fTimerWaitingForIdle = 0;
- m_bCloseWithEsc = mf->m_options.GetBool(OPT_CLOSE_WITH_ESC);
-
- m_bSyntaxHighlight = mf->m_options.GetBool(OPT_SYNTAX_HIGHLIGHT);
- m_bWordDiffHighlight = mf->m_options.GetBool(OPT_WORDDIFF_HIGHLIGHT);
- m_cachedColors.clrDiff = mf->m_options.GetInt(OPT_CLR_DIFF);
- m_cachedColors.clrSelDiff = mf->m_options.GetInt(OPT_CLR_SELECTED_DIFF);
- m_cachedColors.clrDiffDeleted = mf->m_options.GetInt(OPT_CLR_DIFF_DELETED);
- m_cachedColors.clrSelDiffDeleted = mf->m_options.GetInt(OPT_CLR_SELECTED_DIFF_DELETED);
- m_cachedColors.clrDiffText = mf->m_options.GetInt(OPT_CLR_DIFF_TEXT);
- m_cachedColors.clrSelDiffText = mf->m_options.GetInt(OPT_CLR_SELECTED_DIFF_TEXT);
- m_cachedColors.clrTrivial = mf->m_options.GetInt(OPT_CLR_TRIVIAL_DIFF);
- m_cachedColors.clrTrivialDeleted = mf->m_options.GetInt(OPT_CLR_TRIVIAL_DIFF_DELETED);
- m_cachedColors.clrTrivialText = mf->m_options.GetInt(OPT_CLR_TRIVIAL_DIFF_TEXT);
- m_cachedColors.clrMoved = mf->m_options.GetInt(OPT_CLR_MOVEDBLOCK);
- m_cachedColors.clrMovedDeleted = mf->m_options.GetInt(OPT_CLR_MOVEDBLOCK_DELETED);
- m_cachedColors.clrMovedText = mf->m_options.GetInt(OPT_CLR_MOVEDBLOCK_TEXT);
- m_cachedColors.clrSelMoved = mf->m_options.GetInt(OPT_CLR_SELECTED_MOVEDBLOCK);
- m_cachedColors.clrSelMovedDeleted = mf->m_options.GetInt(OPT_CLR_SELECTED_MOVEDBLOCK_DELETED);
- m_cachedColors.clrSelMovedText = mf->m_options.GetInt(OPT_CLR_SELECTED_MOVEDBLOCK_TEXT);
- m_cachedColors.clrWordDiff = mf->m_options.GetInt(OPT_CLR_WORDDIFF);
- m_cachedColors.clrSelWordDiff = mf->m_options.GetInt(OPT_CLR_SELECTED_WORDDIFF);
- m_cachedColors.clrWordDiffText = mf->m_options.GetInt(OPT_CLR_WORDDIFF_TEXT);
- m_cachedColors.clrSelWordDiffText = mf->m_options.GetInt(OPT_CLR_SELECTED_WORDDIFF_TEXT);
+ m_bCloseWithEsc = GetOptionsMgr()->GetBool(OPT_CLOSE_WITH_ESC);
+
+ m_bSyntaxHighlight = GetOptionsMgr()->GetBool(OPT_SYNTAX_HIGHLIGHT);
+ m_bWordDiffHighlight = GetOptionsMgr()->GetBool(OPT_WORDDIFF_HIGHLIGHT);
+ m_cachedColors.clrDiff = GetOptionsMgr()->GetInt(OPT_CLR_DIFF);
+ m_cachedColors.clrSelDiff = GetOptionsMgr()->GetInt(OPT_CLR_SELECTED_DIFF);
+ m_cachedColors.clrDiffDeleted = GetOptionsMgr()->GetInt(OPT_CLR_DIFF_DELETED);
+ m_cachedColors.clrSelDiffDeleted = GetOptionsMgr()->GetInt(OPT_CLR_SELECTED_DIFF_DELETED);
+ m_cachedColors.clrDiffText = GetOptionsMgr()->GetInt(OPT_CLR_DIFF_TEXT);
+ m_cachedColors.clrSelDiffText = GetOptionsMgr()->GetInt(OPT_CLR_SELECTED_DIFF_TEXT);
+ m_cachedColors.clrTrivial = GetOptionsMgr()->GetInt(OPT_CLR_TRIVIAL_DIFF);
+ m_cachedColors.clrTrivialDeleted = GetOptionsMgr()->GetInt(OPT_CLR_TRIVIAL_DIFF_DELETED);
+ m_cachedColors.clrTrivialText = GetOptionsMgr()->GetInt(OPT_CLR_TRIVIAL_DIFF_TEXT);
+ m_cachedColors.clrMoved = GetOptionsMgr()->GetInt(OPT_CLR_MOVEDBLOCK);
+ m_cachedColors.clrMovedDeleted = GetOptionsMgr()->GetInt(OPT_CLR_MOVEDBLOCK_DELETED);
+ m_cachedColors.clrMovedText = GetOptionsMgr()->GetInt(OPT_CLR_MOVEDBLOCK_TEXT);
+ m_cachedColors.clrSelMoved = GetOptionsMgr()->GetInt(OPT_CLR_SELECTED_MOVEDBLOCK);
+ m_cachedColors.clrSelMovedDeleted = GetOptionsMgr()->GetInt(OPT_CLR_SELECTED_MOVEDBLOCK_DELETED);
+ m_cachedColors.clrSelMovedText = GetOptionsMgr()->GetInt(OPT_CLR_SELECTED_MOVEDBLOCK_TEXT);
+ m_cachedColors.clrWordDiff = GetOptionsMgr()->GetInt(OPT_CLR_WORDDIFF);
+ m_cachedColors.clrSelWordDiff = GetOptionsMgr()->GetInt(OPT_CLR_SELECTED_WORDDIFF);
+ m_cachedColors.clrWordDiffText = GetOptionsMgr()->GetInt(OPT_CLR_WORDDIFF_TEXT);
+ m_cachedColors.clrSelWordDiffText = GetOptionsMgr()->GetInt(OPT_CLR_SELECTED_WORDDIFF_TEXT);
}
CMergeEditView::~CMergeEditView()
// Set the tab size now, just in case the options change...
// We don't update it at the end of OnOptions,
// we can update it safely now
- SetTabSize(mf->m_options.GetInt(OPT_TAB_SIZE));
+ SetTabSize(GetOptionsMgr()->GetInt(OPT_TAB_SIZE));
return TRUE;
}
columns = CalculateActualOffset(nScreenLine, nSubLineOffset) + 1;
chars++;
- if (mf->m_options.GetBool(OPT_ALLOW_MIXED_EOL))
+ if (GetOptionsMgr()->GetBool(OPT_ALLOW_MIXED_EOL))
sEol = GetTextBufferEol(nScreenLine);
else
sEol = _T("hidden");
*/
void CMergeEditView::OnUpdateStatusLeftEOL(CCmdUI* pCmdUI)
{
- if (mf->m_options.GetBool(OPT_ALLOW_MIXED_EOL))
+ if (GetOptionsMgr()->GetBool(OPT_ALLOW_MIXED_EOL))
pCmdUI->SetText(_T(""));
else
GetDocument()->GetLeftView()->OnUpdateIndicatorCRLF(pCmdUI);
*/
void CMergeEditView::OnUpdateStatusRightEOL(CCmdUI* pCmdUI)
{
- if (mf->m_options.GetBool(OPT_ALLOW_MIXED_EOL))
+ if (GetOptionsMgr()->GetBool(OPT_ALLOW_MIXED_EOL))
pCmdUI->SetText(_T(""));
else
GetDocument()->GetRightView()->OnUpdateIndicatorCRLF(pCmdUI);
break;
}
- if (mf->m_options.GetBool(OPT_ALLOW_MIXED_EOL) ||
+ if (GetOptionsMgr()->GetBool(OPT_ALLOW_MIXED_EOL) ||
nStyle != m_pTextBuffer->GetCRLFMode())
{
pCmdUI->Enable(TRUE);
*/
void CMergeEditView::RefreshOptions()
{
- m_bCloseWithEsc = mf->m_options.GetBool(OPT_CLOSE_WITH_ESC);
- m_bAutomaticRescan = mf->m_options.GetBool(OPT_AUTOMATIC_RESCAN);
+ m_bCloseWithEsc = GetOptionsMgr()->GetBool(OPT_CLOSE_WITH_ESC);
+ m_bAutomaticRescan = GetOptionsMgr()->GetBool(OPT_AUTOMATIC_RESCAN);
- if (mf->m_options.GetInt(OPT_TAB_TYPE) == 0)
+ if (GetOptionsMgr()->GetInt(OPT_TAB_TYPE) == 0)
SetInsertTabs(TRUE);
else
SetInsertTabs(FALSE);
- m_bSyntaxHighlight = mf->m_options.GetBool(OPT_SYNTAX_HIGHLIGHT);
- m_bWordDiffHighlight = mf->m_options.GetBool(OPT_WORDDIFF_HIGHLIGHT);
- SetWordWrapping(mf->m_options.GetBool(OPT_WORDWRAP));
- m_cachedColors.clrDiff = mf->m_options.GetInt(OPT_CLR_DIFF);
- m_cachedColors.clrSelDiff = mf->m_options.GetInt(OPT_CLR_SELECTED_DIFF);
- m_cachedColors.clrDiffDeleted = mf->m_options.GetInt(OPT_CLR_DIFF_DELETED);
- m_cachedColors.clrSelDiffDeleted = mf->m_options.GetInt(OPT_CLR_SELECTED_DIFF_DELETED);
- m_cachedColors.clrDiffText = mf->m_options.GetInt(OPT_CLR_DIFF_TEXT);
- m_cachedColors.clrSelDiffText = mf->m_options.GetInt(OPT_CLR_SELECTED_DIFF_TEXT);
- m_cachedColors.clrTrivial = mf->m_options.GetInt(OPT_CLR_TRIVIAL_DIFF);
- m_cachedColors.clrTrivialDeleted = mf->m_options.GetInt(OPT_CLR_TRIVIAL_DIFF_DELETED);
- m_cachedColors.clrTrivialText = mf->m_options.GetInt(OPT_CLR_TRIVIAL_DIFF_TEXT);
- m_cachedColors.clrMoved = mf->m_options.GetInt(OPT_CLR_MOVEDBLOCK);
- m_cachedColors.clrMovedDeleted = mf->m_options.GetInt(OPT_CLR_MOVEDBLOCK_DELETED);
- m_cachedColors.clrMovedText = mf->m_options.GetInt(OPT_CLR_MOVEDBLOCK_TEXT);
- m_cachedColors.clrSelMoved = mf->m_options.GetInt(OPT_CLR_SELECTED_MOVEDBLOCK);
- m_cachedColors.clrSelMovedDeleted = mf->m_options.GetInt(OPT_CLR_SELECTED_MOVEDBLOCK_DELETED);
- m_cachedColors.clrSelMovedText = mf->m_options.GetInt(OPT_CLR_SELECTED_MOVEDBLOCK_TEXT);
- m_cachedColors.clrWordDiff = mf->m_options.GetInt(OPT_CLR_WORDDIFF);
- m_cachedColors.clrSelWordDiff = mf->m_options.GetInt(OPT_CLR_SELECTED_WORDDIFF);
- m_cachedColors.clrWordDiffText = mf->m_options.GetInt(OPT_CLR_WORDDIFF_TEXT);
- m_cachedColors.clrSelWordDiffText = mf->m_options.GetInt(OPT_CLR_SELECTED_WORDDIFF_TEXT);
+ m_bSyntaxHighlight = GetOptionsMgr()->GetBool(OPT_SYNTAX_HIGHLIGHT);
+ m_bWordDiffHighlight = GetOptionsMgr()->GetBool(OPT_WORDDIFF_HIGHLIGHT);
+ SetWordWrapping(GetOptionsMgr()->GetBool(OPT_WORDWRAP));
+ m_cachedColors.clrDiff = GetOptionsMgr()->GetInt(OPT_CLR_DIFF);
+ m_cachedColors.clrSelDiff = GetOptionsMgr()->GetInt(OPT_CLR_SELECTED_DIFF);
+ m_cachedColors.clrDiffDeleted = GetOptionsMgr()->GetInt(OPT_CLR_DIFF_DELETED);
+ m_cachedColors.clrSelDiffDeleted = GetOptionsMgr()->GetInt(OPT_CLR_SELECTED_DIFF_DELETED);
+ m_cachedColors.clrDiffText = GetOptionsMgr()->GetInt(OPT_CLR_DIFF_TEXT);
+ m_cachedColors.clrSelDiffText = GetOptionsMgr()->GetInt(OPT_CLR_SELECTED_DIFF_TEXT);
+ m_cachedColors.clrTrivial = GetOptionsMgr()->GetInt(OPT_CLR_TRIVIAL_DIFF);
+ m_cachedColors.clrTrivialDeleted = GetOptionsMgr()->GetInt(OPT_CLR_TRIVIAL_DIFF_DELETED);
+ m_cachedColors.clrTrivialText = GetOptionsMgr()->GetInt(OPT_CLR_TRIVIAL_DIFF_TEXT);
+ m_cachedColors.clrMoved = GetOptionsMgr()->GetInt(OPT_CLR_MOVEDBLOCK);
+ m_cachedColors.clrMovedDeleted = GetOptionsMgr()->GetInt(OPT_CLR_MOVEDBLOCK_DELETED);
+ m_cachedColors.clrMovedText = GetOptionsMgr()->GetInt(OPT_CLR_MOVEDBLOCK_TEXT);
+ m_cachedColors.clrSelMoved = GetOptionsMgr()->GetInt(OPT_CLR_SELECTED_MOVEDBLOCK);
+ m_cachedColors.clrSelMovedDeleted = GetOptionsMgr()->GetInt(OPT_CLR_SELECTED_MOVEDBLOCK_DELETED);
+ m_cachedColors.clrSelMovedText = GetOptionsMgr()->GetInt(OPT_CLR_SELECTED_MOVEDBLOCK_TEXT);
+ m_cachedColors.clrWordDiff = GetOptionsMgr()->GetInt(OPT_CLR_WORDDIFF);
+ m_cachedColors.clrSelWordDiff = GetOptionsMgr()->GetInt(OPT_CLR_SELECTED_WORDDIFF);
+ m_cachedColors.clrWordDiffText = GetOptionsMgr()->GetInt(OPT_CLR_WORDDIFF_TEXT);
+ m_cachedColors.clrSelWordDiffText = GetOptionsMgr()->GetInt(OPT_CLR_SELECTED_WORDDIFF_TEXT);
}
/**
{
OnPrediffer(ID_NO_PREDIFFER);
}
+/**
+ * @brief Handler for all prediffer choices, including ID_PREDIFF_MANUAL, ID_PREDIFF_AUTO, ID_NO_PREDIFFER, & specific prediffers
+ */
void CMergeEditView::OnPrediffer(UINT nID )
{
CMergeDoc *pd = GetDocument();
*/
void CMergeEditView::OnViewLineDiffs()
{
- mf->m_options.SaveOption(OPT_WORDDIFF_HIGHLIGHT, !m_bWordDiffHighlight);
+ GetOptionsMgr()->SaveOption(OPT_WORDDIFF_HIGHLIGHT, !m_bWordDiffHighlight);
// Call CMergeDoc RefreshOptions() to refresh *both* views
CMergeDoc *pDoc = GetDocument();
*/
void CMergeEditView::OnViewWordWrap()
{
- mf->m_options.SaveOption(OPT_WORDWRAP, !m_bWordWrap);
+ GetOptionsMgr()->SaveOption(OPT_WORDWRAP, !m_bWordWrap);
// Call CMergeDoc RefreshOptions() to refresh *both* views
CMergeDoc *pDoc = GetDocument();
// $Id$
#include "stdafx.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+
#include "Merge.h"
#include "OpenDlg.h"
#include "coretools.h"
#include "SelectUnpackerDlg.h"
#include "OptionsDef.h"
#include "MainFrm.h"
+#include "OptionsMgr.h"
#include "ProjectFile.h"
-#include <sys/types.h>
-#include <sys/stat.h>
#ifdef COMPILE_MULTIMON_STUBS
#undef COMPILE_MULTIMON_STUBS
theApp.m_globalFileFilter.SetFilter(_T("*.*"));
m_strExt = _T("*.*");
}
- mf->m_options.SaveOption(OPT_FILEFILTER_CURRENT, m_strExt);
+ GetOptionsMgr()->SaveOption(OPT_FILEFILTER_CURRENT, m_strExt);
}
else
{
BOOL bFilterSet = theApp.m_globalFileFilter.SetFilter(m_strExt);
if (!bFilterSet)
m_strExt = theApp.m_globalFileFilter.GetFilterNameOrMask();
- mf->m_options.SaveOption(OPT_FILEFILTER_CURRENT, m_strExt);
+ GetOptionsMgr()->SaveOption(OPT_FILEFILTER_CURRENT, m_strExt);
}
SaveComboboxStates();
LogErrorString(_T("Failed to add string to filters combo list!"));
}
- if (!mf->m_options.GetBool(OPT_VERIFY_OPEN_PATHS))
+ if (!GetOptionsMgr()->GetBool(OPT_VERIFY_OPEN_PATHS))
{
m_ctlOk.EnableWindow(TRUE);
m_ctlUnpacker.EnableWindow(TRUE);
// Enable buttons as appropriate
PATH_EXISTENCE pathsType = GetPairComparability(m_strLeft, m_strRight);
- if (mf->m_options.GetBool(OPT_VERIFY_OPEN_PATHS))
+ if (GetOptionsMgr()->GetBool(OPT_VERIFY_OPEN_PATHS))
{
m_ctlOk.EnableWindow(pathsType != DOES_NOT_EXIST);
m_ctlUnpacker.EnableWindow(pathsType == IS_EXISTING_FILE);
{
CRect rectFrame;
CRect rectBar;
- mf->GetWindowRect(&rectFrame);
+ AfxGetMainWnd()->GetWindowRect(&rectFrame);
GetClientRect(&rectBar);
// Middlepoint of MainFrame
int x = rectFrame.left + (rectFrame.right - rectFrame.left) / 2;
strFileFilter.LoadString(IDS_PROJECTFILES);
// get the default projects path
- CMainFrame* pFrame = (CMainFrame*) theApp.m_pMainWnd;
CString strProjectFileName;
- CString strProjectPath = pFrame->m_options.GetString(OPT_PROJECTS_PATH);
+ CString strProjectPath = GetOptionsMgr()->GetString(OPT_PROJECTS_PATH);
if (!::SelectFile(strProjectFileName, strProjectPath, NULL, IDS_PROJECTFILES, FALSE))
return;
// get the path part from the filename
strProjectPath = paths_GetParentPath(strProjectFileName);
// store this as the new project path
- pFrame->m_options.SaveOption(OPT_PROJECTS_PATH,strProjectPath);
+ GetOptionsMgr()->SaveOption(OPT_PROJECTS_PATH,strProjectPath);
// If prefix found from start of filter field text
if (strExt.Find(filterPrefix, 0) == 0)