Fixed issue #1642: Incorrect behavior if repo is located on root of drive
[TortoiseGit.git] / src / TortoiseMerge / LeftView.cpp
blob02e725a4263f0f915c21697a8b354e3205fc9bc4
1 // TortoiseGitMerge - a Diff/Patch program
3 // Copyright (C) 2006-2012 - TortoiseSVN
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #include "stdafx.h"
20 #include "resource.h"
21 #include "AppUtils.h"
23 #include "leftview.h"
24 #include "BottomView.h"
26 IMPLEMENT_DYNCREATE(CLeftView, CBaseView)
28 CLeftView::CLeftView(void)
30 m_pwndLeft = this;
31 m_pState = &m_AllState.left;
32 m_nStatusBarID = ID_INDICATOR_LEFTVIEW;
35 CLeftView::~CLeftView(void)
40 void CLeftView::AddContextItems(CIconMenu& popup, DiffStates state)
42 const bool bShow = HasSelection() && (state != DIFFSTATE_UNKNOWN);
44 if (IsBottomViewGood())
46 if (bShow)
47 popup.AppendMenuIcon(POPUPCOMMAND_USETHEIRBLOCK, IDS_VIEWCONTEXTMENU_USETHISBLOCK);
48 popup.AppendMenuIcon(POPUPCOMMAND_USETHEIRFILE, IDS_VIEWCONTEXTMENU_USETHISFILE);
49 if (bShow)
51 popup.AppendMenuIcon(POPUPCOMMAND_USEYOURANDTHEIRBLOCK, IDS_VIEWCONTEXTMENU_USEYOURANDTHEIRBLOCK);
52 popup.AppendMenuIcon(POPUPCOMMAND_USETHEIRANDYOURBLOCK, IDS_VIEWCONTEXTMENU_USETHEIRANDYOURBLOCK);
55 else
57 if (bShow)
58 popup.AppendMenuIcon(POPUPCOMMAND_USELEFTBLOCK, IDS_VIEWCONTEXTMENU_USETHISBLOCK);
59 popup.AppendMenuIcon(POPUPCOMMAND_USELEFTFILE, IDS_VIEWCONTEXTMENU_USETHISFILE);
60 if (bShow)
62 popup.AppendMenuIcon(POPUPCOMMAND_USEBOTHLEFTFIRST, IDS_VIEWCONTEXTMENU_USEBOTHTHISFIRST);
63 popup.AppendMenuIcon(POPUPCOMMAND_USEBOTHRIGHTFIRST, IDS_VIEWCONTEXTMENU_USEBOTHTHISLAST);
67 CBaseView::AddContextItems(popup, state);