From 6a41cef3f9972a88de378a1117697199dbf1d436 Mon Sep 17 00:00:00 2001 From: pv2k Date: Mon, 28 Nov 2016 21:48:43 +0530 Subject: tdf#103391: ask user whether to open online help opens a dialog box from which user can choose to take online help or cancel it Change-Id: I8c1278aab88d55901a65c38b15fcc8519360dc59 Reviewed-on: https://gerrit.libreoffice.org/31385 Reviewed-by: Katarina Behrens Tested-by: Katarina Behrens --- sfx2/UIConfig_sfx.mk | 1 + sfx2/source/appl/sfxhelp.cxx | 23 +++++++++++---- sfx2/uiconfig/ui/helpmanual.ui | 65 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 5 deletions(-) create mode 100644 sfx2/uiconfig/ui/helpmanual.ui diff --git a/sfx2/UIConfig_sfx.mk b/sfx2/UIConfig_sfx.mk index 3d182da9c27a..e057deb2973b 100644 --- a/sfx2/UIConfig_sfx.mk +++ b/sfx2/UIConfig_sfx.mk @@ -29,6 +29,7 @@ $(eval $(call gb_UIConfig_add_uifiles,sfx,\ sfx2/uiconfig/ui/helpcontrol \ sfx2/uiconfig/ui/helpcontentpage \ sfx2/uiconfig/ui/helpindexpage \ + sfx2/uiconfig/ui/helpmanual \ sfx2/uiconfig/ui/helpsearchpage \ sfx2/uiconfig/ui/inputdialog \ sfx2/uiconfig/ui/licensedialog \ diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 6586e79a8f31..80117d0a8916 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -611,12 +611,25 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const if ( !impl_hasHelpInstalled() ) { - if ( impl_showOnlineHelp( aHelpURL ) ) - return true; + ScopedVclPtrInstance< MessageDialog > aQueryBox(const_cast< vcl::Window* >( pWindow ),"onlinehelpmanual","sfx/ui/helpmanual.ui"); + short OnlineHelpBox = aQueryBox->Execute(); + + if(OnlineHelpBox == RET_OK) + { + if ( impl_showOnlineHelp( aHelpURL ) ) + return true; + else + { + ScopedVclPtrInstance< NoHelpErrorBox > aErrBox(const_cast< vcl::Window* >( pWindow )); + aErrBox->Execute(); + return false; + } + } + else + { + return false; + } - ScopedVclPtrInstance< NoHelpErrorBox > aErrBox(const_cast< vcl::Window* >( pWindow )); - aErrBox->Execute(); - return false; } Reference < XDesktop2 > xDesktop = Desktop::create( ::comphelper::getProcessComponentContext() ); diff --git a/sfx2/uiconfig/ui/helpmanual.ui b/sfx2/uiconfig/ui/helpmanual.ui new file mode 100644 index 000000000000..ac6ab51fa67d --- /dev/null +++ b/sfx2/uiconfig/ui/helpmanual.ui @@ -0,0 +1,65 @@ + + + + + + False + False + dialog + True + question + %PRODUCTNAME built-in help is not installed + + + False + vertical + 2 + + + False + True + end + + + Read Help Online + True + True + False + True + + + True + True + 0 + + + + + gtk-cancel + True + True + True + True + True + True + + + True + True + 1 + + + + + False + False + 0 + + + + + + website + + + -- cgit v1.2.3