Repository navigation
Open view: collapsible recent comparison list - #3673
Open
regular-hopper-user wants to merge 2 commits into
Open
regular-hopper-user wants to merge 2 commits into
regular-hopper-user wants to merge 2 commits into
Conversation
File > Recent Files or Folders is filled from the Windows jump list (IApplicationDocumentLists). Windows keeps no jump list history before Windows 7, when the user has turned off "Show recently opened items" (Start_TrackDocs=0) or when the NoRecentDocsHistory policy is set. The menu then stays empty and there is no way to reopen a previous comparison. - JumpList::IsRecentDocsTrackingEnabled() tells whether Windows keeps the history. It is read each time, so a changed Windows setting applies at once. - Where Windows keeps the history nothing changes: the menu uses the jump list and WinMerge stores nothing. - Otherwise WinMerge stores the recent comparisons itself and the menu reads them. Entries are added where the jump list entry is created (AddToRecentDocs), so every comparison type is recorded. - Storage (profile section "Recent Compare List"): one value per comparison, named after a hash of its command line parameters and holding "<last opened time><TAB><title><TAB><parameters>". Adding a comparison writes only its own value (opening it again updates the time), and the list is always read from the registry or ini file, not from the options loaded in the process. So several WinMerge instances never overwrite each other's entries, and no half-written state can empty the list. Only the oldest entries beyond the maximum are removed. - New COptionsMgr::ReadStoredSection() reads the string values of a section from the registry (CRegOptionsMgr) or the ini file (CIniOptionsMgr) after the pending writes of the process. - New option Settings/RecentCompareMax (default 20, 0-128). - The menu shows at most as many items as its command ID range (ID_MRU_FIRST..ID_MRU_LAST) allows; Settings/MRUMax allows more. - Options > Shell "Clear all recent items" also clears the own list.
The Select Files or Folders view gets a "Show recent comparisons" check box next to Save Project. Checked, a list of the recent comparisons (MruHelper::GetRecentCompares: the Windows jump list or WinMerge's own list) appears between the buttons and the status line, so Compare and Cancel stay where they are. Unchecked (the default), the view keeps its previous size. - Columns: comparison name and its command line parameters (the paths and options it was opened with, shown as stored, so filling the list never touches the file system). Up to Settings/RecentCompareMax entries. - Enter or double-click opens the selected comparison with its original options (CMainFrame::OpenRecentCompare, now also used by File > Recent Files or Folders). - The list is refreshed when the view becomes active. - The expanded state is kept in Settings/ShowRecentCompares (default off). - The status line is not in the dynamic layout, so expanding moves it down by the list height and collapsing moves it back; width changes keep working through the dynamic layout. Builds on "Keep an own recent comparison list where the jump list keeps no history".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Builds on #3663: its commit is included here until that PR is merged. Only the last commit ("Open view: collapsible recent comparison list") belongs to this PR.
The Select Files or Folders view gets a "Show recent comparisons" check box next to Save Project. Checked, the recent comparisons (
MruHelper::GetRecentCompares: the jump list where Windows keeps its history, otherwise WinMerge's own list) appear in a list between the buttons and the status line, so Compare and Cancel stay where they are. Unchecked, which is the default, the view keeps its current size.Settings/RecentCompareMaxentries.CMainFrame::OpenRecentCompare, now also used by File > Recent Files or Folders).Settings/ShowRecentCompares(default off).The new strings are not in the translation files yet.
Testing
x64 Release build, isolated instance (
/inifile, registry unchanged):