Bug Hunting Session
Bug 103391 - Show dialog when no local help is installed
Summary: Show dialog when no local help is installed
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
5.3.0.0.alpha0+
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: target:5.4.0
Keywords: difficultyBeginner, easyHack, skillCpp, topicUI
Depends on:
Blocks: Help-Msgbox
  Show dependency treegraph
 
Reported: 2016-10-21 17:21 UTC by Samuel Mehrbrodt (CIB)
Modified: 2018-01-10 22:38 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
gimp help dialog (23.29 KB, image/png)
2016-10-21 17:21 UTC, Samuel Mehrbrodt (CIB)
Details
LibreOffice dialog (14.11 KB, image/png)
2017-01-12 16:19 UTC, Heiko Tietze
Details
gerrt#33103 looks like this (6.20 KB, image/png)
2017-01-18 14:00 UTC, Adolfo Jayme
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Mehrbrodt (CIB) 2016-10-21 17:21:21 UTC
Created attachment 128135 [details]
gimp help dialog

When no local help is installed, currently the online help is opened automatically.

Instead a dialog could be shown offering to download the local help package, or to visit the online help (with a checkbox to not show the dialog again. in this case the online help would always open).

See attached a similiar dialog from Gimp.
Comment 1 Joel Madero 2016-10-23 20:46:17 UTC
Valid enhancement request. I don't see this being very easy to accomplish but if you have code pointers maybe we could turn it into an easy hack.
Comment 2 Yousuf Philips (jay) (retired) 2016-10-23 21:29:59 UTC
Definitely worth doing, as the user shouldnt be automatically jumped out of the application because no local help is installed. Would be useful to have different text strings for different OSes.

@Samuel: You interested in working on this?
Comment 3 Adolfo Jayme 2016-10-23 22:01:55 UTC
(In reply to Yousuf Philips (jay) from comment #2)
> Definitely worth doing, as the user shouldnt be automatically jumped out of
> the application because no local help is installed.

Many of today’s applications do exactly that (including every single bundled program in Windows, such as Notepad), and I don’t see anybody complaining. I don’t think people are confused because they click “Help” in a certain program and they get redirected to their browser. It’s common enough.

That said, I definitely like how GIMP handles this with its (brief!) interstitial dialog, so +1.
Comment 4 Katarina Behrens (CIB) 2016-10-31 10:08:35 UTC
A good easy hack candidate

The code opening either help window or online help is in sfx2/source/appl/sfxhelp.cxx, in particular SfxHelp::Start_Impl function. 

Use imp_hasHelpInstalled function to check if help is installed, or simply plug your code in where this function is already called.

For the question dialog implementation, you may want to use MessageBox class (vcl/source/windows/layout.cxx), or inherit from it to create your own dialog class
Comment 5 Katarina Behrens (CIB) 2016-10-31 10:15:56 UTC
And to avoid scope-creep, I'd initially only implement this as binary choice 

[Read help online] [Cancel]

Downloading local help packages is different process on different platforms, thus challenging to implement and remembering user's choice is also non-trivial task
Comment 6 Vidhey PV 2016-11-05 10:03:42 UTC
I am new and interested in contributing to libreoffice and also interested to resolve this easyhack.
but i have a question:
is there any wiki or some doc,where I can find the logic of the code or the pointers related to the code???
Comment 7 jani 2016-11-05 10:37:46 UTC
(In reply to Vidhey PV from comment #6)
> I am new and interested in contributing to libreoffice and also interested
> to resolve this easyhack.
> but i have a question:
> is there any wiki or some doc,where I can find the logic of the code or the
> pointers related to the 

Welcome have a look at comment #4 that is the code pointer you search for.

You might also want to look at
https://wiki.documentfoundation.org/Development/GetInvolved

which help you get started.
rgds
jan i
Comment 8 Vidhey PV 2016-11-06 18:56:12 UTC
I looked into sfx2/source/appl/sfxhelp.cxx and SfxHelp::Start_Impl function.I tried to understand it ,but I was not able to understand "what the structs used in the function does and some functions used in the Start_impl does".I think the comments are not sufficient enough to understand the code.Is there any doc or READMe where all the structs used or what a function does is explained???

---Thanks
Comment 9 Vidhey PV 2016-11-28 18:04:17 UTC
This functionality, is this mostly needed on linux or windows??????
Comment 10 jani 2017-01-09 08:25:59 UTC
A polite ping, still working on this issue ?
Comment 11 Katarina Behrens (CIB) 2017-01-10 11:48:30 UTC
So 1st patch is here: https://gerrit.libreoffice.org/#/c/31385/ and it works

Next steps: 

* Tweak helpmanual.ui to include checkbox (see eg. sfx2/uiconfig/ui/alienwarndialog.ui as for how)

* Introduce a new boolean configuration variable: for example org.openoffice.Office.Common.Misc.AskOpenOnlineHelp (it'll then come to officecfg/registry/data/org/openoffice/Office/Common.xcu) 

* Write a class deriving from MessageDialog (see eg. sfx2/source/dialog/alienwarn.cxx as for how) that'll include code setting check box on/off 

* Read configuration and set checkbox state, like for example here: http://opengrok.libreoffice.org/xref/core/sfx2/source/dialog/templdlg.cxx#686 

* On disposing the dialog, write the configuration depending on the state of checkbox, like for example here: http://opengrok.libreoffice.org/xref/core/sfx2/source/dialog/templdlg.cxx#2029

That's it
Comment 12 Katarina Behrens (CIB) 2017-01-10 11:53:27 UTC
And I forgot:

in sfx2/source/app/sfxhelp.cxx, if this AskShowOnlineHelp variable is set to false, no dialog should be opened, so some conditionals need to be added there as well
Comment 13 Siddhartha Gairola 2017-01-10 16:01:51 UTC
Could you please explain the second point in your second last comment.
Comment 14 Siddhartha Gairola 2017-01-10 16:25:26 UTC
(In reply to Siddhartha Gairola from comment #13)
> Could you please explain the second point in comment 11.
Comment 15 Commit Notification 2017-01-11 11:23:41 UTC
pv2k committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6a41cef3f9972a88de378a1117697199dbf1d436

tdf#103391: ask user whether to open online help

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 16 jani 2017-01-12 07:25:03 UTC
Is this solved ?
Comment 17 Heiko Tietze 2017-01-12 16:19:36 UTC
Created attachment 130364 [details]
LibreOffice dialog

Function wise the issue is fixed. The design has room for improvements.

Version: 5.4.0.0.alpha0+
Build ID: 229d98e94a5d6b350c4d5fd5469be8e4a260a40c
CPU Threads: 8; OS Version: Linux 4.8; UI Render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); Calc: group
Comment 18 Yousuf Philips (jay) (retired) 2017-01-15 20:05:42 UTC
(In reply to Heiko Tietze from comment #17)
> Created attachment 130364 [details]
> LibreOffice dialog
> 
> Function wise the issue is fixed. The design has room for improvements.

Yes the sentence has room for improvement. @Stuart, @Adolfo: Any suggestions?

Also it might be nice if there were a third button which would link to how to install local help, as the behaviour would be different on different OSes.
Comment 19 Heiko Tietze 2017-01-15 20:51:56 UTC
(In reply to Yousuf Philips (jay) from comment #18)
> Yes the sentence has room for improvement. @Stuart, @Adolfo: Any suggestions?

It's pretty easy to change title and subtext. But the spacing is fix, AFAIS, and I didn't manage to place a non-standard icon left hand. The confirmation dialog has limited capabilities.
Comment 20 Adolfo Jayme 2017-01-15 21:31:06 UTC
I fixed the spacing and added a title and secondary text; please review. https://gerrit.libreoffice.org/33103
Comment 21 Heiko Tietze 2017-01-16 08:28:03 UTC
(In reply to Adolfo Jayme from comment #20)
> I fixed the spacing and added a title and secondary text; please review.
> https://gerrit.libreoffice.org/33103

Can you supply a screenshot? Makes it easier to review here.
Comment 22 Katarina Behrens (CIB) 2017-01-16 17:27:01 UTC
 
> Also it might be nice if there were a third button which would link to how
> to install local help, as the behaviour would be different on different OSes.

Installing any additional software in multi-architecture, multi-platform code is a HARD problem. This bug, however, is an easy hack ... I for sure don't have to (wo)mansplain what that means.

I explicitly prevented the easy hacker from adding such a button, this is no way a task for an easy hack => so please open a new ticket
Comment 23 Adolfo Jayme 2017-01-18 14:00:47 UTC
Created attachment 130524 [details]
gerrt#33103 looks like this
Comment 24 Heiko Tietze 2017-01-18 14:32:05 UTC
(In reply to Adolfo Jayme from comment #23)
> Created attachment 130524 [details]
> gerrt#33103 looks like this

Thanks. Now it doesn't look like avoiding good design by all means. But the dialog has still room for improvement when you compare it with the GIMP example. My suggestion is to be more verbose like "You may either install the offline version from our website or via repository depending on your operating system. Or read the online help in your default Internet browser." (three lines of text just looks better), and to have a friendly image on the left, a big LibreOffice logo perhaps. If that's too much you could 'move' the subtext a little bit upward as it is somewhat mounted to the buttons right now.
Comment 25 Heiko Tietze 2017-02-09 21:39:52 UTC
>2017-02-09 11:09:22 UTC Assignee vidhey96@gmail.com -> libreoffice-bugs@lists.freedesktop.org

Hope you didn't get my reply wrong. Of course the dialog is much better than before, only nitpicking. I'm fine with setting it as resolved/fixed.
Comment 26 Commit Notification 2017-04-02 03:12:48 UTC
Adolfo Jayme Barrientos committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=170b4f451d752d92dd56880a04d64ebad5b165a4

tdf#103391 Add missing title and secondary text to message box

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.