OSDN Git Service

PATCH: [ 1155319 ] Select font for dir compare view
authorKimmo Varis <kimmov@gmail.com>
Fri, 4 Mar 2005 08:21:23 +0000 (08:21 +0000)
committerKimmo Varis <kimmov@gmail.com>
Fri, 4 Mar 2005 08:21:23 +0000 (08:21 +0000)
 - we must allow selecting file compare font even if no open views

Src/MainFrm.cpp
Src/readme.txt

index a4153a5..516e817 100644 (file)
@@ -1586,7 +1586,10 @@ int CMainFrame::SyncFileToVCS(LPCTSTR pszSrc, LPCTSTR pszDest,
  * @brief Select font for Merge/Dir view
  * 
  * Shows font selection dialog to user, sets current font and saves
- * selected font properties to registry.
+ * selected font properties to registry. Selects fon type to active
+ * view (Merge/Dir compare). If there is no open views, then font
+ * is selected for Merge view (for example user may want to change to
+ * unicode font before comparing files).
  */
 void CMainFrame::OnViewSelectfont() 
 {
@@ -1664,14 +1667,11 @@ void CMainFrame::OnViewSelectfont()
 }
 
 /**
- * @brief Enable 'Select font' if view is active
+ * @brief Enable 'Select font'.
  */
 void CMainFrame::OnUpdateViewSelectfont(CCmdUI* pCmdUI) 
 {
-       CFrameWnd * pFrame = GetActiveFrame();
-       BOOL bMergeFrame = pFrame->IsKindOf(RUNTIME_CLASS(CChildFrame));
-       BOOL bDirFrame = pFrame->IsKindOf(RUNTIME_CLASS(CDirFrame));
-       pCmdUI->Enable(bMergeFrame || bDirFrame);
+       pCmdUI->Enable(TRUE);
 }
 
 /**
@@ -1758,6 +1758,9 @@ void CMainFrame::GetFontProperties()
 
 /**
  * @brief Use default font for active view type
+ *
+ * Disable user-selected font for active view type (Merge/Dir compare).
+ * If there is no open views, then Merge view font is changed.
  */
 void CMainFrame::OnViewUsedefaultfont() 
 {
@@ -1773,17 +1776,11 @@ void CMainFrame::OnViewUsedefaultfont()
 }
 
 /**
- * @brief Enable 'Use Default font' if view is open and has user font selected
+ * @brief Enable 'Use Default font'.
  */
 void CMainFrame::OnUpdateViewUsedefaultfont(CCmdUI* pCmdUI) 
 {
-       CFrameWnd * pFrame = GetActiveFrame();
-       BOOL bMergeFrame = pFrame->IsKindOf(RUNTIME_CLASS(CChildFrame));
-       BOOL bDirFrame = pFrame->IsKindOf(RUNTIME_CLASS(CDirFrame));
-       bool bEnableMerge = m_options.GetBool(OPT_FONT_FILECMP_USECUSTOM);
-       bool bEnableDir = m_options.GetBool(OPT_FONT_DIRCMP_USECUSTOM);
-       pCmdUI->Enable((bEnableMerge && bMergeFrame) || 
-               (bEnableDir && bDirFrame));
+       pCmdUI->Enable(TRUE);
 }
 
 /**
index 9ff00ba..7b464ce 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-04 Kimmo
+ PATCH: [ 1155319 ] Select font for dir compare view
+  We must allow selecting file compare font even if no open views
+  Src: Mainfrm.cpp
+
 2005-03-04 Perry
  PATCH: [ 1156253 ] Fix filter helper handling of new filters
  BUG: [ 1153018 ] Create new filter, now cannot find it