diff options
author | Onur Yilmaz <onuryilmaz0750@gmail.com> | 2020-02-03 23:23:17 +0300 |
---|---|---|
committer | Muhammet Kara <muhammet.kara@collabora.com> | 2020-02-04 19:53:11 +0100 |
commit | 7d5a463684b44b625bf555c1d8ed4df5a1660339 (patch) | |
tree | f3320c38786437335e65aeba5f466132cbbe2476 /cui | |
parent | 2b3ece8b2e22b42dd3e80a691a4a492837f7996b (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')
-rw-r--r-- | cui/source/customize/cfg.cxx | 39 | ||||
-rw-r--r-- | cui/uiconfig/ui/menuassignpage.ui | 2 |
2 files changed, 18 insertions, 23 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) diff --git a/cui/uiconfig/ui/menuassignpage.ui b/cui/uiconfig/ui/menuassignpage.ui index 44d06931ebe4..e89bc1093739 100644 --- a/cui/uiconfig/ui/menuassignpage.ui +++ b/cui/uiconfig/ui/menuassignpage.ui @@ -275,7 +275,7 @@ <object class="GtkTextView" id="desc"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes" context="menuassignpage|desc">Local help is not installed.</property> + <property name="tooltip_text" translatable="yes" context="menuassignpage|desc">Description of the currently selected function.</property> <property name="editable">False</property> <property name="wrap_mode">word</property> <property name="cursor_visible">False</property> |