summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpv2k <vidhey96@gmail.com>2016-11-28 21:48:43 +0530
committerKatarina Behrens <Katarina.Behrens@cib.de>2017-01-11 11:21:55 +0000
commit6a41cef3f9972a88de378a1117697199dbf1d436 (patch)
tree9b648b964380119d5ed29a04024333a0fe3d2f56
parent618785dfd28a6cf8f075371afd451b6440718e07 (diff)
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 <Katarina.Behrens@cib.de> Tested-by: Katarina Behrens <Katarina.Behrens@cib.de>
-rw-r--r--sfx2/UIConfig_sfx.mk1
-rw-r--r--sfx2/source/appl/sfxhelp.cxx23
-rw-r--r--sfx2/uiconfig/ui/helpmanual.ui65
3 files changed, 84 insertions, 5 deletions
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.20.0 -->
+<interface>
+ <requires lib="gtk+" version="3.20"/>
+ <object class="GtkMessageDialog" id="onlinehelpmanual">
+ <property name="can_focus">False</property>
+ <property name="resizable">False</property>
+ <property name="type_hint">dialog</property>
+ <property name="skip_taskbar_hint">True</property>
+ <property name="message_type">question</property>
+ <property name="text" translatable="yes"> %PRODUCTNAME built-in help is not installed</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="internal_box">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="btnbox">
+ <property name="can_focus">False</property>
+ <property name="homogeneous">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="website">
+ <property name="label" translatable="yes">Read Help Online</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="1">website</action-widget>
+ </action-widgets>
+ </object>
+</interface>