summaryrefslogtreecommitdiff
path: root/cui/source/customize
diff options
context:
space:
mode:
authorOnur Yilmaz <onuryilmaz0750@gmail.com>2020-02-03 23:23:17 +0300
committerMuhammet Kara <muhammet.kara@collabora.com>2020-02-04 19:53:11 +0100
commit7d5a463684b44b625bf555c1d8ed4df5a1660339 (patch)
treef3320c38786437335e65aeba5f466132cbbe2476 /cui/source/customize
parent2b3ece8b2e22b42dd3e80a691a4a492837f7996b (diff)
tdf#129720: Populate the Description box of the Customize dialog...
Change-Id: Id294458e0b380ceedc199a9c642f29ecfbeef10e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87920 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
Diffstat (limited to 'cui/source/customize')
-rw-r--r--cui/source/customize/cfg.cxx39
1 files changed, 17 insertions, 22 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 2cdfc4c245ab..35d39195234c 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -1562,12 +1562,10 @@ IMPL_LINK_NOARG(SvxConfigPage, FunctionDoubleClickHdl, weld::TreeView&, bool)
IMPL_LINK_NOARG(SvxConfigPage, SelectFunctionHdl, weld::TreeView&, void)
{
- // Store the tooltip of the description field at first run
- static const OUString sDescTooltip = m_xDescriptionField->get_tooltip_text();
-
// GetScriptURL() returns a non-empty string if a
// valid command is selected on the left box
- bool bIsValidCommand = !GetScriptURL().isEmpty();
+ OUString aSelectCommand = GetScriptURL();
+ bool bIsValidCommand = !aSelectCommand.isEmpty();
// Enable/disable Add and Remove buttons depending on current selection
if (bIsValidCommand)
@@ -1575,7 +1573,21 @@ IMPL_LINK_NOARG(SvxConfigPage, SelectFunctionHdl, weld::TreeView&, void)
m_xAddCommandButton->set_sensitive(true);
m_xRemoveCommandButton->set_sensitive(true);
- m_xDescriptionField->set_text(m_xFunctions->GetHelpText(false));
+ if (SfxHelp::IsHelpInstalled())
+ {
+ m_xDescriptionField->set_text(m_xFunctions->GetHelpText(false));
+ }
+ else
+ {
+ SfxGroupInfo_Impl *pData = reinterpret_cast<SfxGroupInfo_Impl*>(m_xFunctions->get_selected_id().toInt64());
+ if (pData)
+ {
+ OUString aLabel = CuiResId(RID_SVXSTR_COMMANDLABEL) + ": " + pData->sLabel + "\n";
+ OUString aName = CuiResId(RID_SVXSTR_COMMANDNAME) + ": " + pData->sCommand + "\n";
+ OUString aTip = CuiResId(RID_SVXSTR_COMMANDTIP) + ": " + pData->sTooltip;
+ m_xDescriptionField->set_text(aLabel + aName + aTip);
+ }
+ }
}
else
{
@@ -1585,23 +1597,6 @@ IMPL_LINK_NOARG(SvxConfigPage, SelectFunctionHdl, weld::TreeView&, void)
m_xDescriptionField->set_text("");
}
-
- // Disable the description field and its label if the local help is not installed
- // And inform the user via tooltips
- if ( !SfxHelp::IsHelpInstalled() )
- {
- m_xDescriptionField->set_sensitive(false);
- m_xDescriptionFieldLb->set_sensitive(false);
- m_xDescriptionField->set_tooltip_text( sDescTooltip );
- m_xDescriptionFieldLb->set_tooltip_text( sDescTooltip );
- }
- else
- {
- m_xDescriptionField->set_sensitive(true);
- m_xDescriptionFieldLb->set_sensitive(true);
- m_xDescriptionField->set_tooltip_text("");
- m_xDescriptionFieldLb->set_tooltip_text("");
- }
}
IMPL_LINK_NOARG(SvxConfigPage, ImplUpdateDataHdl, Timer*, void)