Fixed issue #1205: Add "Last modified" column to commit dialog
[TortoiseGit.git] / src / Git / GitStatusListCtrl.h
blob0c4ae7b0691c5645c91abd91f54abee3309063d1
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2008-2012 - TortoiseGit
4 // Copyright (C) 2003-2008 - TortoiseSVN
5 // Copyright (C) 2010-2012 Sven Strickroth <email@cs-ware.de>
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License
9 // as published by the Free Software Foundation; either version 2
10 // of the License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software Foundation,
19 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #pragma once
22 #include "TGitPath.h"
23 #include "GitStatus.h"
24 #include "GitRev.h"
25 #include "GitConfig.h"
26 #include "Colors.h"
27 #include "LoglistCommonResource.h"
28 #include "HintListCtrl.h"
30 #define GIT_WC_ENTRY_WORKING_SIZE_UNKNOWN (-1)
32 // these defines must be in the order the columns are inserted!
33 #define GITSLC_COLFILENAME 0x000000002
34 #define GITSLC_COLEXT 0x000000004
35 #define GITSLC_COLSTATUS 0x000000008
36 //#define SVNSLC_COLTEXTSTATUS 0x000000010
37 //#define SVNSLC_COLPROPSTATUS 0x000000020
38 //#define SVNSLC_COLAUTHOR 0x000000040
39 //#define SVNSLC_COLREVISION 0x000000080
40 //#define SVNSLC_COLDATE 0x000000100
41 #define GITSLC_COLADD 0x000000010
42 #define GITSLC_COLDEL 0x000000020
43 #define GITSLC_COLMODIFICATIONDATE 0x000000040
44 #define GITSLC_NUMCOLUMNS 7
46 //#define SVNSLC_COLREMOTESTATUS 0x000000010
47 //#define SVNSLC_COLREMOTETEXT 0x000000080
48 //#define SVNSLC_COLREMOTEPROP 0x000000100
49 //#define SVNSLC_COLURL 0x000000200
50 //#define SVNSLC_COLLOCK 0x000000400
51 //#define SVNSLC_COLLOCKCOMMENT 0x000000800
53 //#define SVNSLC_COLREMOTEREVISION 0x000004000
55 //#define SVNSLC_COLSVNNEEDSLOCK 0x000010000
56 //#define SVNSLC_COLCOPYFROM 0x000020000
58 #define GITSLC_SHOWUNVERSIONED CTGitPath::LOGACTIONS_UNVER
59 #define GITSLC_SHOWNORMAL 0x00000000
60 #define GITSLC_SHOWMODIFIED (CTGitPath::LOGACTIONS_MODIFIED)
61 #define GITSLC_SHOWADDED (CTGitPath::LOGACTIONS_ADDED|CTGitPath::LOGACTIONS_COPY)
62 #define GITSLC_SHOWREMOVED CTGitPath::LOGACTIONS_DELETED
63 #define GITSLC_SHOWCONFLICTED CTGitPath::LOGACTIONS_UNMERGED
64 #define GITSLC_SHOWMISSING 0x00000000
65 #define GITSLC_SHOWREPLACED CTGitPath::LOGACTIONS_REPLACED
66 #define GITSLC_SHOWMERGED CTGitPath::LOGACTIONS_MERGED
67 #define GITSLC_SHOWIGNORED CTGitPath::LOGACTIONS_IGNORE
68 #define GITSLC_SHOWOBSTRUCTED 0x00000000
69 #define GITSLC_SHOWEXTERNAL 0x00000000
70 #define GITSLC_SHOWINCOMPLETE 0x00000000
71 #define GITSLC_SHOWINEXTERNALS 0x00000000
72 #define GITSLC_SHOWREMOVEDANDPRESENT 0x00000000
73 #define GITSLC_SHOWLOCKS 0x00000000
74 #define GITSLC_SHOWDIRECTFILES 0x00000000
75 #define GITSLC_SHOWDIRECTFOLDER 0x00000000
76 #define GITSLC_SHOWEXTERNALFROMDIFFERENTREPO 0x00000000
77 #define GITSLC_SHOWSWITCHED 0x00000000
78 #define GITSLC_SHOWINCHANGELIST 0x00000000
80 #define GITSLC_SHOWDIRECTS (GITSLC_SHOWDIRECTFILES | GITSLC_SHOWDIRECTFOLDER)
82 #define GITSLC_SHOWFILES 0x01000000
83 #define GITSLC_SHOWSUBMODULES 0x02000000
84 #define GITSLC_SHOWEVERYTHING 0xffffffff
86 #define GITSLC_SHOWVERSIONED (CTGitPath::LOGACTIONS_FORWORD|GITSLC_SHOWNORMAL|GITSLC_SHOWMODIFIED|\
87 GITSLC_SHOWADDED|GITSLC_SHOWREMOVED|GITSLC_SHOWCONFLICTED|GITSLC_SHOWMISSING|\
88 GITSLC_SHOWREPLACED|GITSLC_SHOWMERGED|GITSLC_SHOWIGNORED|GITSLC_SHOWOBSTRUCTED|\
89 GITSLC_SHOWEXTERNAL|GITSLC_SHOWINCOMPLETE|GITSLC_SHOWINEXTERNALS|\
90 GITSLC_SHOWEXTERNALFROMDIFFERENTREPO)
92 #define GITSLC_SHOWVERSIONEDBUTNORMAL (GITSLC_SHOWMODIFIED|GITSLC_SHOWADDED|\
93 GITSLC_SHOWREMOVED|GITSLC_SHOWCONFLICTED|GITSLC_SHOWMISSING|\
94 GITSLC_SHOWREPLACED|GITSLC_SHOWMERGED|GITSLC_SHOWIGNORED|GITSLC_SHOWOBSTRUCTED|\
95 GITSLC_SHOWEXTERNAL|GITSLC_SHOWINCOMPLETE|GITSLC_SHOWINEXTERNALS|\
96 GITSLC_SHOWEXTERNALFROMDIFFERENTREPO)
98 #define GITSLC_SHOWVERSIONEDBUTNORMALANDEXTERNALSFROMDIFFERENTREPOS (GITSLC_SHOWMODIFIED|\
99 GITSLC_SHOWADDED|GITSLC_SHOWREMOVED|GITSLC_SHOWCONFLICTED|GITSLC_SHOWMISSING|\
100 GITSLC_SHOWREPLACED|GITSLC_SHOWMERGED|GITSLC_SHOWIGNORED|GITSLC_SHOWOBSTRUCTED|\
101 GITSLC_SHOWINCOMPLETE|GITSLC_SHOWEXTERNAL|GITSLC_SHOWINEXTERNALS)
103 #define GITSLC_SHOWVERSIONEDBUTNORMALANDEXTERNALS (GITSLC_SHOWMODIFIED|\
104 GITSLC_SHOWADDED|GITSLC_SHOWREMOVED|GITSLC_SHOWCONFLICTED|GITSLC_SHOWMISSING|\
105 GITSLC_SHOWREPLACED|GITSLC_SHOWMERGED|GITSLC_SHOWIGNORED|GITSLC_SHOWOBSTRUCTED|\
106 GITSLC_SHOWINCOMPLETE)
108 #define GITSLC_SHOWALL (GITSLC_SHOWVERSIONED|GITSLC_SHOWUNVERSIONED)
110 #define GITSLC_POPALL 0xFFFFFFFFFFFFFFFF
111 #define GITSLC_POPCOMPAREWITHBASE CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_COMPARE)
112 #define GITSLC_POPCOMPARE CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_COMPAREWC)
113 #define GITSLC_POPGNUDIFF CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_GNUDIFF1)
114 #define GITSLC_POPREVERT CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_REVERT)
115 #define GITSLC_POPUPDATE CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_UPDATE)
116 #define GITSLC_POPSHOWLOG CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_LOG)
117 #define GITSLC_POPSHOWLOGOLDNAME CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_LOGOLDNAME)
118 #define GITSLC_POPOPEN CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_OPEN)
119 #define GITSLC_POPDELETE CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_DELETE)
120 #define GITSLC_POPADD CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_ADD)
121 #define GITSLC_POPIGNORE CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_IGNORE)
122 #define GITSLC_POPCONFLICT CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_EDITCONFLICT)
123 #define GITSLC_POPRESOLVE CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_RESOLVECONFLICT)
124 #define GITSLC_POPLOCK CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_LOCK)
125 #define GITSLC_POPUNLOCK CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_UNLOCK)
126 #define GITSLC_POPUNLOCKFORCE CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_UNLOCKFORCE)
127 #define GITSLC_POPEXPLORE CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_EXPLORE)
128 #define GITSLC_POPCOMMIT CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_COMMIT)
129 #define GITSLC_POPPROPERTIES CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_PROPERTIES)
130 #define GITSLC_POPREPAIRMOVE CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_REPAIRMOVE)
131 #define GITSLC_POPCHANGELISTS CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_CHECKGROUP)
132 #define GITSLC_POPBLAME CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_BLAME)
133 #define GITSLC_POPSAVEAS CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_SAVEAS)
134 #define GITSLC_POPCOMPARETWOFILES CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_COMPARETWO)
135 #define GITSLC_POPRESTORE CGitStatusListCtrl::GetContextMenuBit(CGitStatusListCtrl::IDGITLC_POPRESTORE)
137 #define GITSLC_IGNORECHANGELIST _T("ignore-on-commit")
139 // This gives up to 64 standard properties and menu entries
140 // plus 192 user-defined properties (should be plenty).
141 // User-defined properties will start at column SVNSLC_NUMCOLUMNS+1
142 // but in the registry, we will record them starting at SVNSLC_USERPROPCOLOFFSET.
144 #define GITSLC_USERPROPCOLOFFSET 0x40
145 #define GITSLC_USERPROPCOLLIMIT 0xff
146 #define GITSLC_MAXCOLUMNCOUNT 0xff
148 #define OVL_RESTORE 1
150 // Supporting extreamly long user props makes no sense here --
151 // especially for binary properties. CString uses a pool allocator
152 // that works for up to 256 chars. Make sure we are well below that.
154 #define GITSLC_MAXUSERPROPLENGTH 0x70
156 typedef int (__cdecl *GENERICCOMPAREFN)(const void * elem1, const void * elem2);
157 typedef CComCritSecLock<CComCriticalSection> Locker;
159 class CGitStatusListCtrlDropTarget;
162 * \ingroup TortoiseProc
163 * Helper class for CGitStatusListCtrl that represents
164 * the columns visible and their order as well as
165 * persisting that data in the registry.
167 * It assigns logical index values to the (potential) columns:
168 * 0 .. GitSLC_NUMCOLUMNS-1 contain the standard attributes
169 * GitSLC_USERPROPCOLOFFSET .. GitSLC_MAXCOLUMNCOUNT are user props.
171 * The column vector contains the columns that are actually
172 * available in the control.
174 * Since the set of userprops may change from one WC to another,
175 * we also store the settings (width and order) for those
176 * userprops that are not used in this WC.
178 * A userprop is considered "in use", if the respective column
179 * is not hidden or if at least one item has this property set.
181 class ColumnManager
183 public:
185 /// construction / destruction
187 ColumnManager (CListCtrl* control) : control (control) {};
188 ~ColumnManager() {};
190 DWORD m_dwDefaultColumns;
191 /// registry access
193 void ReadSettings (DWORD defaultColumns, DWORD hideColumns, const CString& containerName, int ReadSettings, int *withlist=NULL);
194 void WriteSettings() const;
196 /// read column definitions
198 int GetColumnCount() const; ///< total number of columns
199 bool IsVisible (int column) const;
200 int GetInvisibleCount() const;
201 bool IsRelevant (int column) const;
202 bool IsUserProp (int column) const;
203 CString GetName (int column) const;
204 int SetNames(UINT * buff, int size);
205 int GetWidth (int column, bool useDefaults = false) const;
206 int GetVisibleWidth (int column, bool useDefaults) const;
208 /// switch columns on and off
210 void SetVisible (int column, bool visible);
212 /// tracking column modifications
214 void ColumnMoved (int column, int position);
215 void ColumnResized (int column);
217 /// call these to update the user-prop list
218 /// (will also auto-insert /-remove new list columns)
220 //void UpdateUserPropList (const std::vector<FileEntry*>& files);
221 //void UpdateRelevance ( const std::vector<FileEntry*>& files
222 // , const std::vector<size_t>& visibleFiles);
224 /// don't clutter the context menu with irrelevant prop info
226 bool AnyUnusedProperties() const;
227 void RemoveUnusedProps();
229 /// bring everything back to its "natural" order
231 void ResetColumns (DWORD defaultColumns);
233 void OnColumnResized(NMHDR *pNMHDR, LRESULT *pResult)
235 LPNMHEADER header = reinterpret_cast<LPNMHEADER>(pNMHDR);
236 if ( (header != NULL)
237 && (header->iItem >= 0)
238 && (header->iItem < GetColumnCount()))
240 ColumnResized (header->iItem);
242 *pResult = 0;
245 void OnColumnMoved(NMHDR *pNMHDR, LRESULT *pResult)
247 LPNMHEADER header = reinterpret_cast<LPNMHEADER>(pNMHDR);
248 *pResult = TRUE;
249 if ( (header != NULL)
250 && (header->iItem >= 0)
251 && (header->iItem < GetColumnCount())
252 // only allow the reordering if the column was not moved left of the first
253 // visible item - otherwise the 'invisible' columns are not at the far left
254 // anymore and we get all kinds of redrawing problems.
255 && (header->pitem)
256 && (header->pitem->iOrder > GetInvisibleCount()))
258 ColumnMoved (header->iItem, header->pitem->iOrder);
259 *pResult = FALSE;
263 void OnHdnBegintrack(NMHDR *pNMHDR, LRESULT *pResult)
265 LPNMHEADER phdr = reinterpret_cast<LPNMHEADER>(pNMHDR);
266 *pResult = 0;
267 if ((phdr->iItem < 0)||(phdr->iItem >= itemName.size()))
268 return;
270 if (IsVisible (phdr->iItem))
272 return;
274 *pResult = 1;
277 int OnHdnItemchanging(NMHDR *pNMHDR, LRESULT *pResult)
279 LPNMHEADER phdr = reinterpret_cast<LPNMHEADER>(pNMHDR);
280 *pResult = 0;
281 if ((phdr->iItem < 0)||(phdr->iItem >= itemName.size()))
283 return 0;
286 // visible columns may be modified
288 if (IsVisible (phdr->iItem))
290 return 0;
293 // columns already marked as "invisible" internally may be (re-)sized to 0
295 if ( (phdr->pitem != NULL)
296 && (phdr->pitem->mask == HDI_WIDTH)
297 && (phdr->pitem->cxy == 0))
299 return 0;
302 if ( (phdr->pitem != NULL)
303 && (phdr->pitem->mask != HDI_WIDTH))
305 return 0;
308 *pResult = 1;
309 return 1;
311 void OnContextMenuHeader(CWnd * pWnd, CPoint point, bool isGroundEnable=false)
313 CHeaderCtrl * pHeaderCtrl = (CHeaderCtrl *)pWnd;
314 if ((point.x == -1) && (point.y == -1))
316 CRect rect;
317 pHeaderCtrl->GetItemRect(0, &rect);
318 pHeaderCtrl->ClientToScreen(&rect);
319 point = rect.CenterPoint();
322 CMenu popup;
323 if (popup.CreatePopupMenu())
325 int columnCount = GetColumnCount();
327 CString temp;
328 UINT uCheckedFlags = MF_STRING | MF_ENABLED | MF_CHECKED;
329 UINT uUnCheckedFlags = MF_STRING | MF_ENABLED;
331 // build control menu
333 //temp.LoadString(IDS_STATUSLIST_SHOWGROUPS);
334 //popup.AppendMenu(isGroundEnable? uCheckedFlags : uUnCheckedFlags, columnCount, temp);
336 if (AnyUnusedProperties())
338 temp.LoadString(IDS_STATUSLIST_REMOVEUNUSEDPROPS);
339 popup.AppendMenu(uUnCheckedFlags, columnCount+1, temp);
342 temp.LoadString(IDS_STATUSLIST_RESETCOLUMNORDER);
343 popup.AppendMenu(uUnCheckedFlags, columnCount+2, temp);
344 popup.AppendMenu(MF_SEPARATOR);
346 // standard columns
347 AddMenuItem(&popup);
349 // user-prop columns:
350 // find relevant ones and sort 'em
352 std::map<CString, int> sortedProps;
353 for (int i = itemName.size(); i < columnCount; ++i)
354 if (IsRelevant(i))
355 sortedProps[GetName(i)] = i;
357 if (!sortedProps.empty())
359 // add 'em to the menu
361 popup.AppendMenu(MF_SEPARATOR);
363 typedef std::map<CString, int>::const_iterator CIT;
364 for ( CIT iter = sortedProps.begin(), end = sortedProps.end()
365 ; iter != end
366 ; ++iter)
368 popup.AppendMenu ( IsVisible(iter->second)
369 ? uCheckedFlags
370 : uUnCheckedFlags
371 , iter->second
372 , iter->first);
376 // show menu & let user pick an entry
378 int cmd = popup.TrackPopupMenu(TPM_RETURNCMD | TPM_LEFTALIGN | TPM_NONOTIFY, point.x, point.y, pWnd, 0);
379 if ((cmd >= 1)&&(cmd < columnCount))
381 SetVisible (cmd, !IsVisible(cmd));
383 else if (cmd == columnCount)
385 pWnd->GetParent()->SendMessage(LVM_ENABLEGROUPVIEW, !isGroundEnable, NULL);
386 //EnableGroupView(!isGroundEnable);
388 else if (cmd == columnCount+1)
390 RemoveUnusedProps();
392 else if (cmd == columnCount+2)
394 ResetColumns (m_dwDefaultColumns);
399 void AddMenuItem(CMenu *pop)
401 UINT uCheckedFlags = MF_STRING | MF_ENABLED | MF_CHECKED;
402 UINT uUnCheckedFlags = MF_STRING | MF_ENABLED;
404 for (int i = 1; i < itemName.size(); ++i)
406 if(IsRelevant(i))
407 pop->AppendMenu ( IsVisible(i)
408 ? uCheckedFlags
409 : uUnCheckedFlags
411 , GetName(i));
414 private:
416 /// initialization utilities
418 void ParseUserPropSettings ( const CString& userPropList
419 , const CString& shownUserProps);
420 void ParseWidths (const CString& widths);
421 void SetStandardColumnVisibility (DWORD visibility);
422 void ParseColumnOrder (const CString& widths);
424 /// map internal column order onto visible column order
425 /// (all invisibles in front)
427 std::vector<int> GetGridColumnOrder();
428 void ApplyColumnOrder();
430 /// utilities used when writing data to the registry
432 DWORD GetSelectedStandardColumns() const;
433 CString GetUserPropList() const;
434 CString GetShownUserProps() const;
435 CString GetWidthString() const;
436 CString GetColumnOrderString() const;
438 /// our parent control and its data
440 CListCtrl* control;
442 /// where to store in the registry
444 CString registryPrefix;
446 /// all columns in their "natural" order
448 struct ColumnInfo
450 int index; ///< is a user prop when < GitSLC_USERPROPCOLOFFSET
451 int width;
452 bool visible;
453 bool relevant; ///< set to @a visible, if no *shown* item has that property
456 std::vector<ColumnInfo> columns;
458 /// user-defined properties
460 struct UserProp
462 CString name; ///< is a user prop when < GitSLC_USERPROPCOLOFFSET
463 int width;
466 std::vector<UserProp> userProps;
468 /// stored result from last UpdateUserPropList() call
470 std::set<CString> itemProps;
472 /// global column ordering including unused user props
474 std::vector<int> columnOrder;
476 std::vector<int> itemName;
481 * \ingroup TortoiseProc
482 * Simple utility class that defines the sort column order.
484 class CSorter
486 public:
488 CSorter ( ColumnManager* columnManager
489 , int sortedColumn
490 , bool ascending);
492 bool operator() ( const CTGitPath* entry1
493 , const CTGitPath* entry2) const;
495 static int A2L(const CString &str)
497 if(str==_T("-"))
498 return -1;
499 else
500 return _ttol(str);
503 private:
505 ColumnManager* columnManager;
506 int sortedColumn;
507 bool ascending;
511 * \ingroup SVN
512 * A List control, based on the MFC CListCtrl which shows a list of
513 * files with their Subversion status. The control also provides a context
514 * menu to do some Subversion tasks on the selected files.
516 * This is the main control used in many dialogs to show a list of files to
517 * work on.
519 class CGitStatusListCtrl :
520 public CListCtrl
522 public:
523 enum
525 IDGITLC_REVERT = 1,
526 IDGITLC_COMPARE,
527 IDGITLC_OPEN,
528 IDGITLC_DELETE,
529 IDGITLC_IGNORE,
530 IDGITLC_GNUDIFF1 ,
531 IDGITLC_UPDATE ,
532 IDGITLC_LOG ,
533 IDGITLC_LOGOLDNAME,
534 IDGITLC_EDITCONFLICT ,
535 IDGITLC_IGNOREMASK ,
536 IDGITLC_ADD ,
537 IDGITLC_RESOLVECONFLICT ,
538 IDGITLC_LOCK ,
539 IDGITLC_LOCKFORCE ,
540 IDGITLC_UNLOCK ,
541 IDGITLC_UNLOCKFORCE ,
542 IDGITLC_OPENWITH ,
543 IDGITLC_EXPLORE ,
544 IDGITLC_RESOLVETHEIRS ,
545 IDGITLC_RESOLVEMINE ,
546 IDGITLC_REMOVE ,
547 IDGITLC_COMMIT ,
548 IDGITLC_PROPERTIES ,
549 IDGITLC_COPY ,
550 IDGITLC_COPYEXT ,
551 IDGITLC_REPAIRMOVE ,
552 IDGITLC_REMOVEFROMCS ,
553 IDGITLC_CREATECS ,
554 IDGITLC_CREATEIGNORECS ,
555 IDGITLC_CHECKGROUP ,
556 IDGITLC_UNCHECKGROUP ,
557 IDGITLC_ADD_RECURSIVE ,
558 IDGITLC_COMPAREWC ,
559 IDGITLC_BLAME ,
560 IDGITLC_SAVEAS ,
561 IDGITLC_REVERTTOREV ,
562 IDGITLC_VIEWREV ,
563 IDGITLC_FINDENTRY ,
564 IDGITLC_COMPARETWO ,
565 IDGITLC_GNUDIFF2 ,
566 IDGITLC_COMPARETWOFILES ,
567 IDGITLC_POPRESTORE ,
568 IDGITLC_CREATERESTORE ,
569 IDGITLC_RESTOREPATH ,
570 // the IDSVNLC_MOVETOCS *must* be the last index, because it contains a dynamic submenu where
571 // the submenu items get command ID's sequent to this number
572 IDGITLC_MOVETOCS ,
574 int GetColumnIndex(int colmask);
575 static inline unsigned __int64 GetContextMenuBit(int i){ return ((unsigned __int64 )0x1)<<i ;}
577 * Sent to the parent window (using ::SendMessage) after a context menu
578 * command has finished if the item count has changed.
580 static const UINT GITSLNM_ITEMCOUNTCHANGED;
582 * Sent to the parent window (using ::SendMessage) when the control needs
583 * to be refreshed. Since this is done usually in the parent window using
584 * a thread, this message is used to tell the parent to do exactly that.
586 static const UINT GITSLNM_NEEDSREFRESH;
589 * Sent to the parent window (using ::SendMessage) when the user drops
590 * files on the control. The LPARAM is a pointer to a TCHAR string
591 * containing the dropped path.
593 static const UINT GITSLNM_ADDFILE;
596 * Sent to the parent window (using ::SendMessage) when the user checks/unchecks
597 * one or more items in the control. The WPARAM contains the number of
598 * checked items in the control.
600 static const UINT GITSLNM_CHECKCHANGED;
602 static const UINT GITSLNM_ITEMCHANGED;
604 CGitStatusListCtrl(void);
605 ~CGitStatusListCtrl(void);
607 CString m_Rev1;
608 CString m_Rev2;
611 * \ingroup TortoiseProc
612 * Helper class for CGitStatusListCtrl which represents
613 * the data for each file shown.
615 #if 0
616 class FileEntry
618 public:
619 FileEntry() : status(git_wc_status_unversioned)
620 // , copyfrom_rev(GIT_REV_ZERO)
621 , last_commit_date(0)
622 , last_commit_rev(GIT_REV_ZERO)
623 // , remoterev(GIT_REV_ZERO)
624 , textstatus(git_wc_status_unversioned)
625 , propstatus(git_wc_status_unversioned)
626 // , remotestatus(git_wc_status_unversioned)
627 // , remotetextstatus(git_wc_status_unversioned)
628 // , remotepropstatus(git_wc_status_unversioned)
629 , copied(false)
630 , switched(false)
631 , checked(false)
632 , inunversionedfolder(false)
633 , inexternal(false)
634 , differentrepo(false)
635 , direct(false)
636 , isfolder(false)
637 , isNested(false)
638 , Revision(GIT_REV_ZERO)
639 , isConflicted(false)
640 // , present_props()
641 , needslock(false)
642 /// , working_size(SVN_WC_ENTRY_WORKING_SIZE_UNKNOWN)
643 , keeplocal(false)
644 // , depth(git_depth_unknown)
647 const CTGitPath& GetPath() const
649 return path;
651 const bool IsChecked() const
653 return checked;
655 CString GetRelativeGitPath() const
657 if (path.IsEquivalentTo(basepath))
658 return path.GetGitPathString();
659 return path.GetGitPathString().Mid(basepath.GetGitPathString().GetLength()+1);
661 // const bool IsLocked() const
662 // {
663 // return !(lock_token.IsEmpty() && lock_remotetoken.IsEmpty());
664 // }
665 // const bool HasNeedsLock() const
666 // {
667 // return needslock;
668 // }
669 const bool IsFolder() const
671 return isfolder;
673 const bool IsInExternal() const
675 return inexternal;
677 const bool IsNested() const
679 return isNested;
681 const bool IsFromDifferentRepository() const
683 return differentrepo;
685 CString GetDisplayName() const
687 CString const& chopped = path.GetDisplayString(&basepath);
688 if (!chopped.IsEmpty())
690 return chopped;
692 else
694 // "Display name" must not be empty.
695 return path.GetFileOrDirectoryName();
698 CString GetChangeList() const
700 return changelist;
702 // CString GetURL() const
703 // {
704 // return url;
705 // }
706 public:
707 git_wc_status_kind status; ///< local status
708 git_wc_status_kind textstatus; ///< local text status
709 git_wc_status_kind propstatus; ///< local property status
711 private:
712 CTGitPath path; ///< full path of the file
713 CTGitPath basepath; ///< common ancestor path of all files
715 CString changelist; ///< the name of the changelist the item belongs to
717 CString last_commit_author; ///< the author which last committed this item
718 CTime last_commit_date; ///< the date when this item was last committed
719 git_revnum_t last_commit_rev; ///< the revision where this item was last committed
721 git_revnum_t remoterev; ///< the revision in HEAD of the repository
722 bool copied; ///< if the file/folder is added-with-history
723 bool switched; ///< if the file/folder is switched to another url
724 bool checked; ///< if the file is checked in the list control
725 bool inunversionedfolder; ///< if the file is inside an unversioned folder
726 bool inexternal; ///< if the item is in an external folder
727 bool differentrepo; ///< if the item is from a different repository than the rest
728 bool direct; ///< directly included (TRUE) or just a child of a folder
729 bool isfolder; ///< TRUE if entry refers to a folder
730 bool isNested; ///< TRUE if the folder from a different repository and/or path
731 bool isConflicted; ///< TRUE if a file entry is conflicted, i.e. if it has the conflicted paths set
732 bool needslock; ///< TRUE if the Git:needs-lock property is set
733 git_revnum_t Revision; ///< the base revision
734 // PropertyList present_props; ///< cacheable properties present in BASE
735 bool keeplocal; ///< Whether a local copy of this entry should be kept in the working copy after a deletion has been committed
736 git_depth_t depth; ///< the depth of this entry
737 friend class CGitStatusListCtrl;
738 friend class CGitStatusListCtrlDropTarget;
739 friend class CSorter;
741 #endif
744 * Initializes the control, sets up the columns.
745 * \param dwColumns mask of columns to show. Use the GitSLC_COLxxx defines.
746 * \param sColumnInfoContainer Name of a registry key
747 * where the position and visibility of each column
748 * is saved and used from. If the registry key
749 * doesn't exist, the default order is used
750 * and dwColumns tells which columns are visible.
751 * \param dwContextMenus mask of context menus to be active, not all make sense for every use of this control.
752 * Use the GitSLC_POPxxx defines.
753 * \param bHasCheckboxes TRUE if the control should show check boxes on the left of each file entry.
754 * \param bHasWC TRUE if the reporisty is not a bare repository (hides wc related items on the contextmenu)
756 void Init(DWORD dwColumns, const CString& sColumnInfoContainer, unsigned __int64 dwContextMenus = ((GITSLC_POPALL ^ GITSLC_POPCOMMIT) ^ GITSLC_POPRESTORE), bool bHasCheckboxes = true, bool bHasWC = true, DWORD allowedColumns = 0xffffffff);
758 * Sets a background image for the list control.
759 * The image is shown in the right bottom corner.
760 * \param nID the resource ID of the bitmap to use as the background
762 bool SetBackgroundImage(UINT nID);
764 * Makes the 'ignore' context menu only ignore the files and not add the
765 * folder which gets the Git:ignore property changed to the list.
766 * This is needed e.g. for the Add-dialog, where the modified folder
767 * showing up would break the resulting "add" command.
769 void SetIgnoreRemoveOnly(bool bRemoveOnly = true) {m_bIgnoreRemoveOnly = bRemoveOnly;}
771 * The unversioned items are by default shown after all other files in the list.
772 * If that behavior should be changed, set this value to false.
774 void PutUnversionedLast(bool bLast) {m_bUnversionedLast = bLast;}
776 * Fetches the Subversion status of all files and stores the information
777 * about them in an internal array.
778 * \param sFilePath path to a file which contains a list of files and/or folders for which to
779 * fetch the status, separated by newlines.
780 * \param bUpdate TRUE if the remote status is requested too.
781 * \return TRUE on success.
783 BOOL GetStatus ( const CTGitPathList* pathList=NULL
784 , bool bUpdate = false
785 , bool bShowIgnores = false
786 , bool bShowUnRev=false
787 , bool bShowUserProps = false);
790 * Populates the list control with the previously (with GetStatus) gathered status information.
791 * \param dwShow mask of file types to show. Use the GitSLC_SHOWxxx defines.
792 * \param dwCheck mask of file types to check. Use GitLC_SHOWxxx defines. Default (0) means 'use the entry's stored check status'
794 void Show(unsigned int dwShow, unsigned int dwCheck = 0, bool bShowFolders = true,BOOL updateStatusList=FALSE, bool UseStoredCheckStatus=false);
795 void Show(unsigned int dwShow, const CTGitPathList& checkedList, bool bShowFolders = true);
798 * Copies the selected entries in the control to the clipboard. The entries
799 * are separated by newlines.
800 * \param dwCols the columns to copy. Each column is separated by a tab.
802 bool CopySelectedEntriesToClipboard(DWORD dwCols);
805 * If during the call to GetStatus() some Git:externals are found from different
806 * repositories than the first one checked, then this method returns TRUE.
808 BOOL HasExternalsFromDifferentRepos() const {return m_bHasExternalsFromDifferentRepos;}
811 * If during the call to GetStatus() some Git:externals are found then this method returns TRUE.
813 BOOL HasExternals() const {return m_bHasExternals;}
816 * If unversioned files are found (but not necessarily shown) TRUE is returned.
818 BOOL HasUnversionedItems() {return m_bHasUnversionedItems;}
821 * If there are any locks in the working copy, TRUE is returned
823 BOOL HasLocks() const {return m_bHasLocks;}
826 * If there are any change lists defined in the working copy, TRUE is returned
828 BOOL HasChangeLists() const {return m_bHasChangeLists;}
831 * Returns the file entry data for the list control index.
833 //CGitStatusListCtrl::FileEntry * GetListEntry(UINT_PTR index);
836 * Returns the file entry data for the specified path.
837 * \note The entry might not be shown in the list control.
839 //CGitStatusListCtrl::FileEntry * GetListEntry(const CTGitPath& path);
842 * Returns the index of the list control entry with the specified path,
843 * or -1 if the path is not in the list control.
845 int GetIndex(const CTGitPath& path);
848 * Returns the file entry data for the specified path in the list control.
850 //CGitStatusListCtrl::FileEntry * GetVisibleListEntry(const CTGitPath& path);
853 * Returns a String containing some statistics like number of modified, normal, deleted,...
854 * files.
856 CString GetStatisticsString(bool simple=false);
859 * Set a static control which will be updated automatically with
860 * the number of selected and total files shown in the list control.
862 void SetStatLabel(CWnd * pStatLabel){m_pStatLabel = pStatLabel;};
865 * Set a tri-state checkbox which is updated automatically if the
866 * user checks/unchecks file entries in the list control to indicate
867 * if all files are checked, none are checked or some are checked.
869 void SetSelectButton(CButton * pButton) {m_pSelectButton = pButton;}
872 * Set a button which is de-/activated automatically. The button is
873 * only set active if at least one item is selected.
875 void SetConfirmButton(CButton * pButton) {m_pConfirmButton = pButton;}
878 * Select/unselect all entries in the list control.
879 * \param bSelect TRUE to check, FALSE to uncheck.
881 void SelectAll(bool bSelect, bool bIncludeNoCommits = false);
884 * Checks all specified items, removes the checks from the ones not specified
885 * \param dwCheck SVNLC_SHOWxxx defines
887 void Check(DWORD dwCheck, bool uncheckNonMatches);
889 /** Set a checkbox on an entry in the listbox
890 * Keeps the listctrl checked state and the FileEntry's checked flag in sync
892 void SetEntryCheck(CTGitPath* pEntry, int listboxIndex, bool bCheck);
894 /** Write a list of the checked items' paths into a path list
896 void WriteCheckedNamesToPathList(CTGitPathList& pathList);
898 /** fills in \a lMin and \a lMax with the lowest/highest revision of all
899 * files/folders in the working copy.
900 * \param bShownOnly if true, the min/max revisions are calculated only for shown items
901 * \param bCheckedOnly if true, the min/max revisions are calculated only for items
902 * which are checked.
903 * \remark Since an item can only be checked if it is visible/shown in the list control
904 * bShownOnly is automatically set to true if bCheckedOnly is true
906 void GetMinMaxRevisions(git_revnum_t& rMin, git_revnum_t& rMax, bool bShownOnly, bool bCheckedOnly);
909 * Returns the parent directory of all entries in the control.
910 * if \a bStrict is set to false, then the paths passed to the control
911 * to fetch the status (in GetStatus()) are used if possible.
913 CString GetCommonDirectory(bool bStrict);
916 * Returns the parent url of all entries in the control.
917 * if \a bStrict is set to false, then the paths passed to the control
918 * to fetch the status (in GetStatus()) are used if possible.
920 CTGitPath GetCommonURL(bool bStrict);
923 * Sets a pointer to a boolean variable which is checked periodically
924 * during the status fetching. As soon as the variable changes to true,
925 * the operations stops.
927 void SetCancelBool(bool * pbCanceled) {m_pbCanceled = pbCanceled;}
930 * Sets the string shown in the control while the status is fetched.
931 * If not set, it defaults to "please wait..."
933 void SetBusyString(const CString& str) {m_sBusy = str;}
934 void SetBusyString(UINT id) {m_sBusy.LoadString(id);}
937 * Sets the string shown in the control if no items are shown. This
938 * can happen for example if there's nothing modified and the unversioned
939 * files aren't shown either, so there's nothing to commit.
940 * If not set, it defaults to "file list is empty".
942 void SetEmptyString(const CString& str) {m_sEmpty = str;}
943 void SetEmptyString(UINT id) {m_sEmpty.LoadString(id);}
946 * Returns the number of selected items
948 LONG GetSelected(){return m_nSelected;};
951 * Enables dropping of files on the control.
953 bool EnableFileDrop();
956 * Checks if the path already exists in the list.
958 bool HasPath(const CTGitPath& path);
960 * Checks if the path is shown/visible in the list control.
962 bool IsPathShown(const CTGitPath& path);
964 * Forces the children to be checked when the parent folder is checked,
965 * and the parent folder to be unchecked if one of its children is unchecked.
967 void CheckChildrenWithParent(bool bCheck) {m_bCheckChildrenWithParent = bCheck;}
970 * Allows checking the items if change lists are present. If set to false,
971 * items are not checked if at least one changelist is available.
973 void CheckIfChangelistsArePresent(bool bCheck) {m_bCheckIfGroupsExist = bCheck;}
975 * Returns the currently used show flags passed to the Show() method.
977 DWORD GetShowFlags() {return m_dwShow;}
979 public:
980 CString GetLastErrorMessage() {return m_sLastError;}
982 void Block(BOOL block, BOOL blockUI) {m_bBlock = block; m_bBlockUI = blockUI;}
984 LONG GetUnversionedCount() { return m_nShownUnversioned; }
985 LONG GetModifiedCount() { return m_nShownModified; }
986 LONG GetAddedCount() { return m_nShownAdded; }
987 LONG GetDeletedCount() { return m_nShownDeleted; }
988 LONG GetConflictedCount() { return m_nShownConflicted; }
989 LONG GetFileCount() { return m_nShownFiles; }
990 LONG GetSubmoduleCount() { return m_nShownSubmodules; }
992 LONG m_nTargetCount; ///< number of targets in the file passed to GetStatus()
994 CString m_sURL; ///< the URL of the target or "(multiple targets)"
996 GitRev m_HeadRev; ///< the HEAD revision of the repository if bUpdate was TRUE
998 bool m_amend; ///< if true show the changes to the revision before the last commit
1000 CString m_sUUID; ///< the UUID of the associated repository
1002 bool m_bIsRevertTheirMy; ///< at rebase case, Their and My version is revert.
1004 DECLARE_MESSAGE_MAP()
1006 public:
1007 void SetBusy(bool b) {m_bBusy = b; Invalidate();}
1009 private:
1010 void SaveColumnWidths(bool bSaveToRegistry = false);
1011 //void AddEntry(FileEntry * entry, WORD langID, int listIndex); ///< add an entry to the control
1012 void RemoveListEntry(int index); ///< removes an entry from the listcontrol and both arrays
1013 bool BuildStatistics(); ///< build the statistics and correct the case of files/folders
1014 void StartDiff(int fileindex); ///< start the external diff program
1015 void StartDiffWC(int fileindex); ///< start the external diff program
1016 void StartDiffTwo(int fileindex);
1018 enum
1020 ALTERNATIVEEDITOR,
1021 OPEN,
1022 OPEN_WITH,
1024 void OpenFile(CTGitPath *path,int mode);
1026 /// fetch all user properties for all items
1027 void FetchUserProperties();
1029 /// Process one line of the command file supplied to GetStatus
1030 bool FetchStatusForSingleTarget(GitConfig& config, GitStatus& status, const CTGitPath& target,
1031 bool bFetchStatusFromRepository, CStringA& strCurrentRepositoryUUID, CTGitPathList& arExtPaths,
1032 bool bAllDirect, git_depth_t depth = git_depth_infinity, bool bShowIgnores = false);
1034 /// Create 'status' data for each item in an unversioned folder
1035 void AddUnversionedFolder(const CTGitPath& strFolderName, const CTGitPath& strBasePath, GitConfig * config);
1037 /// Read the all the other status items which result from a single GetFirstStatus call
1038 void ReadRemainingItemsStatus(GitStatus& status, const CTGitPath& strBasePath, CStringA& strCurrentRepositoryUUID, CTGitPathList& arExtPaths, GitConfig * config, bool bAllDirect);
1040 /// Clear the status vector (contains custodial pointers)
1041 void ClearStatusArray();
1043 /// Sort predicate function - Compare the paths of two entries without regard to case
1044 //static bool EntryPathCompareNoCase(const FileEntry* pEntry1, const FileEntry* pEntry2);
1046 /// Predicate used to build a list of only the versioned entries of the FileEntry array
1047 //static bool IsEntryVersioned(const FileEntry* pEntry1);
1049 /// Look up the relevant show flags for a particular Git status value
1050 DWORD GetShowFlagsFromGitStatus(git_wc_status_kind status);
1052 /// Build a FileEntry item and add it to the FileEntry array
1053 //const FileEntry* AddNewFileEntry(
1054 // const git_wc_status2_t* pGitStatus, // The return from the Git GetStatus functions
1055 // const CTGitPath& path, // The path of the item we're adding
1056 // const CTGitPath& basePath, // The base directory for this status build
1057 // bool bDirectItem, // Was this item the first found by GetFirstFileStatus or by a subsequent GetNextFileStatus call
1058 // bool bInExternal, // Are we in an 'external' folder
1059 // bool bEntryfromDifferentRepo // if the entry is from a different repository
1060 // );
1062 /// Adjust the checkbox-state on all descendants of a specific item
1063 //void SetCheckOnAllDescendentsOf(const FileEntry* parentEntry, bool bCheck);
1065 /// Build a path list of all the selected items in the list (NOTE - SELECTED, not CHECKED)
1066 void FillListOfSelectedItemPaths(CTGitPathList& pathList, bool bNoIgnored = false);
1068 /// Enables/Disables group view and adds all groups to the list control.
1069 /// If bForce is true, then group view is enabled and the 'null' group is added.
1070 bool PrepareGroups(bool bForce = false);
1071 /// Returns the group number to which the group header belongs
1072 /// If the point is not over a group header, -1 is returned
1073 int GetGroupFromPoint(POINT * ppt);
1074 /// Returns the number of change lists the selection has
1075 size_t GetNumberOfChangelistsInSelection();
1077 /// Puts the item to the corresponding group
1078 bool SetItemGroup(int item, int groupindex);
1080 void CheckEntry(int index, int nListItems);
1081 void UncheckEntry(int index, int nListItems);
1083 /// sends an GitSLNM_CHECKCHANGED notification to the parent
1084 void NotifyCheck();
1086 int CellRectFromPoint(CPoint& point, RECT *cellrect, int *col) const;
1088 void OnContextMenuList(CWnd * pWnd, CPoint point);
1089 void OnContextMenuGroup(CWnd * pWnd, CPoint point);
1090 void OnContextMenuHeader(CWnd * pWnd, CPoint point);
1092 virtual void PreSubclassWindow();
1093 virtual BOOL PreTranslateMessage(MSG* pMsg);
1094 virtual INT_PTR OnToolHitTest(CPoint point, TOOLINFO* pTI) const;
1095 afx_msg void OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult);
1096 afx_msg BOOL OnToolTipText(UINT id, NMHDR *pNMHDR, LRESULT *pResult);
1097 afx_msg void OnHdnItemclick(NMHDR *pNMHDR, LRESULT *pResult);
1098 afx_msg void OnLvnItemchanging(NMHDR *pNMHDR, LRESULT *pResult);
1099 afx_msg BOOL OnLvnItemchanged(NMHDR *pNMHDR, LRESULT *pResult);
1100 afx_msg void OnColumnResized(NMHDR *pNMHDR, LRESULT *pResult);
1101 afx_msg void OnColumnMoved(NMHDR *pNMHDR, LRESULT *pResult);
1102 afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
1104 void CreateChangeList(const CString& name);
1106 afx_msg void OnNMDblclk(NMHDR *pNMHDR, LRESULT *pResult);
1107 afx_msg void OnLvnGetInfoTip(NMHDR *pNMHDR, LRESULT *pResult);
1108 afx_msg void OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult);
1109 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
1110 afx_msg UINT OnGetDlgCode();
1111 afx_msg void OnNMReturn(NMHDR *pNMHDR, LRESULT *pResult);
1112 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
1113 afx_msg void OnPaint();
1114 afx_msg void OnHdnBegintrack(NMHDR *pNMHDR, LRESULT *pResult);
1115 afx_msg void OnHdnItemchanging(NMHDR *pNMHDR, LRESULT *pResult);
1116 afx_msg void OnDestroy();
1119 void FileSaveAs(CTGitPath *path);
1120 int RevertSelectedItemToVersion();
1122 private:
1123 bool * m_pbCanceled;
1124 bool m_bAscending; ///< sort direction
1125 int m_nSortedColumn; ///< which column to sort
1126 bool m_bHasCheckboxes;
1127 bool m_bHasWC;
1128 bool m_bUnversionedLast;
1129 bool m_bHasExternalsFromDifferentRepos;
1130 bool m_bHasExternals;
1131 BOOL m_bHasUnversionedItems;
1132 bool m_bHasLocks;
1133 bool m_bHasChangeLists;
1134 //typedef std::vector<FileEntry*> FileEntryVector;
1135 //FileEntryVector m_arStatusArray;
1136 std::vector<CTGitPath*> m_arStatusArray;
1137 std::vector<size_t> m_arListArray;
1138 std::map<CString, int> m_changelists;
1139 bool m_bHasIgnoreGroup;
1140 //CTGitPathList m_ConflictFileList;
1141 CTGitPathList m_StatusFileList;
1142 CTGitPathList m_UnRevFileList;
1143 CTGitPathList m_IgnoreFileList;
1144 //CTGitPathList m_StatusUrlList;
1145 CString m_sLastError;
1147 LONG m_nUnversioned;
1148 LONG m_nNormal;
1149 LONG m_nModified;
1150 LONG m_nAdded;
1151 LONG m_nDeleted;
1152 LONG m_nConflicted;
1153 LONG m_nTotal;
1154 LONG m_nSelected;
1155 LONG m_nLineAdded;
1156 LONG m_nLineDeleted;
1157 LONG m_nRenamed;
1159 LONG m_nShownUnversioned;
1160 LONG m_nShownModified;
1161 LONG m_nShownAdded;
1162 LONG m_nShownDeleted;
1163 LONG m_nShownConflicted;
1164 LONG m_nShownFiles;
1165 LONG m_nShownSubmodules;
1167 DWORD m_dwDefaultColumns;
1168 DWORD m_dwShow;
1169 bool m_bShowFolders;
1170 bool m_bShowIgnores;
1171 bool m_bUpdate;
1172 unsigned __int64 m_dwContextMenus;
1173 BOOL m_bBlock;
1174 BOOL m_bBlockUI;
1175 bool m_bBusy;
1176 bool m_bEmpty;
1177 bool m_bIgnoreRemoveOnly;
1178 bool m_bCheckIfGroupsExist;
1179 bool m_bFileDropsEnabled;
1180 bool m_bOwnDrag;
1182 int m_nIconFolder;
1183 int m_nRestoreOvl;
1185 CWnd * m_pStatLabel;
1186 CButton * m_pSelectButton;
1187 CButton * m_pConfirmButton;
1188 CColors m_Colors;
1190 CString m_sEmpty;
1191 CString m_sBusy;
1192 CString m_sNoPropValueText;
1194 bool m_bCheckChildrenWithParent;
1195 CGitStatusListCtrlDropTarget * m_pDropTarget;
1197 ColumnManager m_ColumnManager;
1199 std::map<CString,bool> m_mapFilenameToChecked; ///< Remember de-/selected items
1200 CComCriticalSection m_critSec;
1202 friend class CGitStatusListCtrlDropTarget;
1203 public:
1204 enum
1206 FILELIST_MODIFY= 0x1,
1207 FILELIST_UNVER = 0x2,
1208 FILELIST_IGNORE =0x4
1210 public:
1211 int UpdateFileList(git_revnum_t hash,CTGitPathList *List=NULL);
1212 int UpdateFileList(int mask, bool once=true,CTGitPathList *List=NULL);
1213 int UpdateUnRevFileList(CTGitPathList *List=NULL);
1214 int UpdateIgnoreFileList(CTGitPathList *List=NULL);
1216 int UpdateWithGitPathList(CTGitPathList &list);
1218 void AddEntry(CTGitPath* path, WORD langID, int ListIndex);
1219 void Clear();
1220 int m_FileLoaded;
1221 git_revnum_t m_CurrentVersion;
1222 bool m_bDoNotAutoselectSubmodules;
1223 std::map<CString, CString> m_restorepaths;
1226 #if 0
1227 class CGitStatusListCtrlDropTarget : public CIDropTarget
1229 public:
1230 CGitStatusListCtrlDropTarget(CGitStatusListCtrl * pGitStatusListCtrl):CIDropTarget(pGitStatusListCtrl->m_hWnd){m_pGitStatusListCtrl = pGitStatusListCtrl;}
1232 virtual bool OnDrop(FORMATETC* pFmtEtc, STGMEDIUM& medium, DWORD * /*pdwEffect*/, POINTL pt);
1233 virtual HRESULT STDMETHODCALLTYPE DragOver(DWORD grfKeyState, POINTL pt, DWORD __RPC_FAR *pdwEffect);
1234 private:
1235 CGitStatusListCtrl * m_pGitStatusListCtrl;
1237 #endif