F1 Help fails to find topics

Main development forum.

F1 Help fails to find topics

Postby denisbradford » Tue Jul 21, 2009 5:21 pm

In 2.12.4, F1 help behaves inconsistently when you have different windows open. For example, if just the main window is open, pressing F1 opens the help browser at the 'About WinMerge' topic, which is fine. Some other windows, like Select Files or Folders and the Filters dialog, also open the 'About WinMerge' topic.

But most windows, including the File Compare and Folder Compare window, fail to open a topic; the help browser displays a broken link error message. Interestingly, the error also occurs for the the Filters dialog when a Compare window is also open. I'm guessing the Filters dialog is a child of the Compare window in this case.

I guess one fix is for F1 to always open 'About WinMerge' from all windows, if that's the behavior you intended.

But it would be nicer for F1 to open specific topics. For example, pressing F1 on the File Compare window could go straight to 'Comparing and merging files' in the Help browser, and the Filters dialog could open 'Using filters'. Here's how, if you're interested:

On the authoring side, I just add a dbhh processing instruction to a topic source, like this:

<article id="Filters">
<?dbhh topicname="IDH_Filters" topicid ="1234"?>

The DocBook build generates an alias.h file that lists context sensitive topics:


...and a context.h file that maps topics to application help ids:

#define IDH_Filters 1234

Here, '1234' is an id that you call in the help for some context in the application. Both these files are referenced by the htmlhelp.hhp project file when the build compiles help.

I don't know the API details, but am hoping this is enough detail to see how we might call a particular topic from WinMerge.
Posts: 46
Joined: Thu Sep 25, 2008 12:24 pm
Location: U.S.A.

Re: F1 Help fails to find topics

Postby kimmov » Fri Jul 24, 2009 9:20 pm

Hmm. This is due to how the help is opened. With Windows help you can open "just the help" (.chm file) and it opens the first topic (which is the About WinMerge). But you can also give direct URL to open (filename). You can see the URLs by opening the help and opening properties from context menu. The URL is something like mk:@MSITStore:C:\Program%20Files\WinMerge\Docs\WinMerge.chm::/htmlhelp/CompareDirs.html. Part after "::" /htmlhelp/CompareDirs.html is the URL we open.

In WinMerge we have in several dialogs defined the URL to open so that related help page will be opened. So that user doesn't first need to search the correct place from help. The implementation is a bit fragile since we have just added hard-coded URLs pointing to help places in the code. And probably many of those URLs aren't valid anymore. So the fix is to find those wrong URLs and fix them. Though I think we ignore this for current stable release and fix it for current trunk and next stable series.

I definitely want to open the exact place in help whenever possible. Pressing F1 in options dialog must open help about options not About WinMerge.

I didn't know about the topicid. That sounds like the way we need to do this in future. I need to look at the help API again (been a while I wrote the current code) but I hope using those IDs is easy. We can hopefully also write some scripts helping in checking that all links work as for sure there will be changes in the code and in the help. So there will be some synchronization needed in these IDs too.
Posts: 562
Joined: Thu Sep 11, 2008 8:51 pm
Location: Finland

Re: F1 Help fails to find topics

Postby gambler544 » Fri Sep 18, 2009 12:28 pm

hello, let me know if anyone of you find solution of the issue...
Posts: 1
Joined: Fri Sep 18, 2009 12:26 pm

Re: F1 Help fails to find topics

Postby kimmov » Wed Apr 28, 2010 6:08 am

I think Tim found the problem and fixed it in patch #2988974 Fix help locations. The patch is already applied to SVN trunk so next WinMerge versions will have the fix included.
Posts: 562
Joined: Thu Sep 11, 2008 8:51 pm
Location: Finland

Return to Developers

Who is online

Users browsing this forum: No registered users and 2 guests