[Libreoffice-commits] core.git: cui/source cui/uiconfig include/svtools officecfg/registry sfx2/source sfx2/uiconfig svtools/source
Nickson Thanda
nicksonthanda10 at msn.com
Mon Jun 11 12:50:08 UTC 2018
cui/source/options/optgdlg.cxx | 10 +-
cui/source/options/optgdlg.hxx | 1
cui/uiconfig/ui/optgeneralpage.ui | 40 +++++++--
include/svtools/helpopt.hxx | 2
officecfg/registry/schema/org/openoffice/Office/Common.xcs | 6 +
sfx2/source/appl/sfxhelp.cxx | 56 +++++++------
sfx2/uiconfig/ui/helpmanual.ui | 20 ++++
svtools/source/config/helpopt.cxx | 27 +++++-
8 files changed, 125 insertions(+), 37 deletions(-)
New commits:
commit 175a1d13adce55bb4411209736bb332aab990f9c
Author: Nickson Thanda <nicksonthanda10 at msn.com>
Date: Sun Jun 3 22:35:14 2018 +0100
tdf#114875 Added an option to not show "No offline help installed" popup
Change-Id: I8067c0c374af57f5ad8e6f5fffd3a9783521824f
Reviewed-on: https://gerrit.libreoffice.org/55254
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 454fe099c253..5ce324c2d4e3 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -258,6 +258,7 @@ OfaMiscTabPage::OfaMiscTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
: SfxTabPage(pParent, "OptGeneralPage", "cui/ui/optgeneralpage.ui", &rSet)
{
get(m_pExtHelpCB, "exthelp");
+ get(m_pPopUpNoHelpCB,"popupnohelp");
if (!lcl_HasSystemFilePicker())
get<VclContainer>("filedlgframe")->Hide();
#if ! ENABLE_GTK
@@ -322,6 +323,7 @@ void OfaMiscTabPage::dispose()
m_pCollectUsageInfo.clear();
m_pQuickStarterFrame.clear();
m_pQuickLaunchCB.clear();
+ m_pPopUpNoHelpCB.clear();
SfxTabPage::dispose();
}
@@ -336,7 +338,10 @@ bool OfaMiscTabPage::FillItemSet( SfxItemSet* rSet )
std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
SvtHelpOptions aHelpOptions;
- if ( m_pExtHelpCB->IsChecked() != (m_pExtHelpCB->GetSavedValue() == TRISTATE_TRUE) )
+ if ( m_pPopUpNoHelpCB->IsValueChangedFromSaved() )
+ aHelpOptions.SetOfflineHelpPopUp( m_pPopUpNoHelpCB->IsChecked() );
+
+ if ( m_pExtHelpCB->IsValueChangedFromSaved() )
aHelpOptions.SetExtendedHelp( m_pExtHelpCB->IsChecked() );
if ( m_pFileDlgCB->IsValueChangedFromSaved() )
@@ -390,7 +395,8 @@ void OfaMiscTabPage::Reset( const SfxItemSet* rSet )
SvtHelpOptions aHelpOptions;
m_pExtHelpCB->Check( aHelpOptions.IsHelpTips() && aHelpOptions.IsExtendedHelp() );
m_pExtHelpCB->SaveValue();
-
+ m_pPopUpNoHelpCB->Check( aHelpOptions.IsOfflineHelpPopUp() );
+ m_pPopUpNoHelpCB->SaveValue();
SvtMiscOptions aMiscOpt;
m_pFileDlgCB->Check( !aMiscOpt.UseSystemFileDialog() );
m_pFileDlgCB->SaveValue();
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index f6296ff87679..d986860b6f48 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -41,6 +41,7 @@ class OfaMiscTabPage : public SfxTabPage
{
using TabPage::DeactivatePage;
private:
+ VclPtr<CheckBox> m_pPopUpNoHelpCB;
VclPtr<CheckBox> m_pExtHelpCB;
VclPtr<FixedImage> m_pFileDlgROImage;
diff --git a/cui/uiconfig/ui/optgeneralpage.ui b/cui/uiconfig/ui/optgeneralpage.ui
index 022fb620bcdd..8d47ea9e4682 100644
--- a/cui/uiconfig/ui/optgeneralpage.ui
+++ b/cui/uiconfig/ui/optgeneralpage.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.2 -->
+<!-- Generated with glade 3.18.3 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
<object class="GtkAdjustment" id="adjustment1">
@@ -27,14 +27,38 @@
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
- <object class="GtkCheckButton" id="exthelp">
- <property name="label" translatable="yes" context="optgeneralpage|exthelp">_Extended tips</property>
+ <object class="GtkGrid" id="grid2">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkCheckButton" id="exthelp">
+ <property name="label" translatable="yes" context="optgeneralpage|exthelp">_Extended tips</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="popupnohelp">
+ <property name="label" translatable="yes" context="optgeneralpage|popupnohelp">Show "No offline help installed" popup</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
</object>
</child>
</object>
diff --git a/include/svtools/helpopt.hxx b/include/svtools/helpopt.hxx
index 6d55ad0b00b3..07ad90c1c191 100644
--- a/include/svtools/helpopt.hxx
+++ b/include/svtools/helpopt.hxx
@@ -40,6 +40,8 @@ public:
bool IsExtendedHelp() const;
void SetHelpTips( bool b );
bool IsHelpTips() const;
+ void SetOfflineHelpPopUp(bool b);
+ bool IsOfflineHelpPopUp() const;
const OUString& GetHelpStyleSheet()const;
void SetHelpStyleSheet(const OUString& rStyleSheet);
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index ca59a66a1d83..d31d8697a646 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -3554,6 +3554,12 @@
</info>
<value>false</value>
</prop>
+ <prop oor:name="BuiltInHelpNotInstalledPopUp" oor:type="xs:boolean" oor:nillable="false">
+ <info>
+ <desc>Activates "Built-in help is not installed" pop-up</desc>
+ </info>
+ <value>true</value>
+ </prop>
<prop oor:name="HelpStyleSheet" oor:type="xs:string" oor:nillable="false">
<info>
<desc>Specifies the name of the stylesheet used to display help
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index cae51357f2a6..7fd1b642d8ec 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -820,16 +820,23 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const
if ( !impl_hasHelpInstalled() )
{
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pWindow ? pWindow->GetFrameWeld() : nullptr, "sfx/ui/helpmanual.ui"));
- std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("onlinehelpmanual"));
+ SvtHelpOptions aHelpOptions;
+ bool bShowOfflineHelpPopUp = aHelpOptions.IsOfflineHelpPopUp();
- LanguageTag aLangTag = Application::GetSettings().GetUILanguageTag();
- OUString sLocaleString = SvtLanguageTable::GetLanguageString( aLangTag.getLanguageType() );
- OUString sPrimText = xQueryBox->get_primary_text();
- xQueryBox->set_primary_text(sPrimText.replaceAll("$UILOCALE", sLocaleString));
- short OnlineHelpBox = xQueryBox->run();
-
- if(OnlineHelpBox == RET_OK)
+ if(bShowOfflineHelpPopUp)
+ {
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pWindow ? pWindow->GetFrameWeld() : nullptr, "sfx/ui/helpmanual.ui"));
+ std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("onlinehelpmanual"));
+ std::unique_ptr<weld::CheckButton> m_xHideOfflineHelpCB(xBuilder->weld_check_button("hidedialog"));
+ LanguageTag aLangTag = Application::GetSettings().GetUILanguageTag();
+ OUString sLocaleString = SvtLanguageTable::GetLanguageString( aLangTag.getLanguageType() );
+ OUString sPrimText = xQueryBox->get_primary_text();
+ xQueryBox->set_primary_text(sPrimText.replaceAll("$UILOCALE", sLocaleString));
+ short OnlineHelpBox = xQueryBox->run();
+ bShowOfflineHelpPopUp = OnlineHelpBox != RET_OK;
+ aHelpOptions.SetOfflineHelpPopUp(!m_xHideOfflineHelpCB->get_state());
+ }
+ if(!bShowOfflineHelpPopUp)
{
if ( impl_showOnlineHelp( aHelpURL ) )
return true;
@@ -844,7 +851,6 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const
{
return false;
}
-
}
// old-help to display
Reference < XDesktop2 > xDesktop = Desktop::create( ::comphelper::getProcessComponentContext() );
@@ -962,19 +968,25 @@ bool SfxHelp::Start_Impl(const OUString& rURL, weld::Widget* pWidget, const OUSt
if ( !impl_hasHelpInstalled() )
{
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pWidget, "sfx/ui/helpmanual.ui"));
- std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("onlinehelpmanual"));
-
- LanguageTag aLangTag = Application::GetSettings().GetUILanguageTag();
- OUString sLocaleString = SvtLanguageTable::GetLanguageString( aLangTag.getLanguageType() );
- OUString sPrimText = xQueryBox->get_primary_text();
- xQueryBox->set_primary_text(sPrimText.replaceAll("$UILOCALE", sLocaleString));
- xQueryBox->connect_help(LINK(nullptr, NoHelpErrorBox, HelpRequestHdl));
- short OnlineHelpBox = xQueryBox->run();
- xQueryBox->hide();
- if (OnlineHelpBox == RET_OK)
+ SvtHelpOptions aHelpOptions;
+ bool bShowOfflineHelpPopUp = aHelpOptions.IsOfflineHelpPopUp();
+
+ if(bShowOfflineHelpPopUp)
+ {
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pWidget, "sfx/ui/helpmanual.ui"));
+ std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("onlinehelpmanual"));
+ std::unique_ptr<weld::CheckButton> m_xHideOfflineHelpCB(xBuilder->weld_check_button("hidedialog"));
+ LanguageTag aLangTag = Application::GetSettings().GetUILanguageTag();
+ OUString sLocaleString = SvtLanguageTable::GetLanguageString( aLangTag.getLanguageType() );
+ OUString sPrimText = xQueryBox->get_primary_text();
+ xQueryBox->set_primary_text(sPrimText.replaceAll("$UILOCALE", sLocaleString));
+ short OnlineHelpBox = xQueryBox->run();
+ bShowOfflineHelpPopUp = OnlineHelpBox != RET_OK;
+ aHelpOptions.SetOfflineHelpPopUp(!m_xHideOfflineHelpCB->get_state());
+ }
+ if(!bShowOfflineHelpPopUp)
{
- if (impl_showOnlineHelp( aHelpURL ) )
+ if ( impl_showOnlineHelp( aHelpURL ) )
return true;
else
{
diff --git a/sfx2/uiconfig/ui/helpmanual.ui b/sfx2/uiconfig/ui/helpmanual.ui
index e71cac2df176..fd1ea563eb2c 100644
--- a/sfx2/uiconfig/ui/helpmanual.ui
+++ b/sfx2/uiconfig/ui/helpmanual.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.2 -->
+<!-- Generated with glade 3.18.3 -->
<interface domain="sfx">
<requires lib="gtk+" version="3.18"/>
<object class="GtkMessageDialog" id="onlinehelpmanual">
@@ -55,6 +55,24 @@
<property name="position">0</property>
</packing>
</child>
+ <child>
+ <object class="GtkCheckButton" id="hidedialog">
+ <property name="label" translatable="yes" context="helpmanual|hidedialog">Do not show this dialog again</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="halign">start</property>
+ <property name="margin_left">100</property>
+ <property name="hexpand">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
</child>
<action-widgets>
diff --git a/svtools/source/config/helpopt.cxx b/svtools/source/config/helpopt.cxx
index 87029df284eb..6200fb002e85 100644
--- a/svtools/source/config/helpopt.cxx
+++ b/svtools/source/config/helpopt.cxx
@@ -47,13 +47,15 @@ enum class HelpProperty
HelpTips = 1,
Locale = 2,
System = 3,
- StyleSheet = 4
+ StyleSheet = 4,
+ OfflineHelpPopUp = 5
};
class SvtHelpOptions_Impl : public utl::ConfigItem
{
bool bExtendedHelp;
bool bHelpTips;
+ bool bOfflineHelpPopUp;
OUString aLocale;
OUString aSystem;
OUString sHelpStyleSheet;
@@ -73,7 +75,8 @@ public:
bool IsExtendedHelp() const { return bExtendedHelp; }
void SetHelpTips( bool b ) { bHelpTips = b; SetModified(); }
bool IsHelpTips() const { return bHelpTips; }
-
+ void SetOfflineHelpPopUp(bool b) { bOfflineHelpPopUp = b; SetModified();}
+ bool IsOfflineHelpPopUp() const { return bOfflineHelpPopUp;}
const OUString& GetSystem() const { return aSystem; }
const OUString& GetHelpStyleSheet()const{return sHelpStyleSheet;}
@@ -90,7 +93,8 @@ Sequence< OUString > const & SvtHelpOptions_Impl::GetPropertyNames()
"Tip",
"Locale",
"System",
- "HelpStyleSheet"
+ "HelpStyleSheet",
+ "BuiltInHelpNotInstalledPopUp"
};
return aNames;
@@ -107,6 +111,7 @@ SvtHelpOptions_Impl::SvtHelpOptions_Impl()
: ConfigItem( "Office.Common/Help" )
, bExtendedHelp( false )
, bHelpTips( true )
+ , bOfflineHelpPopUp( true)
{
Sequence< OUString > aNames = GetPropertyNames();
Load( aNames );
@@ -148,7 +153,7 @@ void SvtHelpOptions_Impl::Load(const uno::Sequence< OUString>& rPropertyNames)
OUString aTmpStr;
sal_Int32 nTmpInt = 0;
if ( pValues[nProp] >>= bTmp )
- {
+ {
switch ( static_cast< HelpProperty >(
lcl_MapPropertyName(rPropertyNames[nProp], aInternalPropertyNames) ) )
{
@@ -158,6 +163,9 @@ void SvtHelpOptions_Impl::Load(const uno::Sequence< OUString>& rPropertyNames)
case HelpProperty::HelpTips:
bHelpTips = bTmp;
break;
+ case HelpProperty::OfflineHelpPopUp:
+ bOfflineHelpPopUp = bTmp;
+ break;
default:
SAL_WARN( "svtools.config", "Wrong Member!" );
break;
@@ -225,6 +233,9 @@ void SvtHelpOptions_Impl::ImplCommit()
case HelpProperty::StyleSheet:
pValues[nProp] <<= sHelpStyleSheet;
break;
+ case HelpProperty::OfflineHelpPopUp:
+ pValues[nProp] <<= bOfflineHelpPopUp;
+ break;
}
}
@@ -268,7 +279,15 @@ bool SvtHelpOptions::IsExtendedHelp() const
{
return pImpl->IsExtendedHelp();
}
+void SvtHelpOptions::SetOfflineHelpPopUp (bool b )
+{
+ pImpl->SetOfflineHelpPopUp( b );
+}
+bool SvtHelpOptions::IsOfflineHelpPopUp() const
+{
+ return pImpl->IsOfflineHelpPopUp();
+}
void SvtHelpOptions::SetHelpTips( bool b )
{
pImpl->SetHelpTips( b );
More information about the Libreoffice-commits
mailing list