[Libreoffice-commits] core.git: cui/source cui/uiconfig

Onur Yilmaz (via logerrit) logerrit at kemper.freedesktop.org
Tue Feb 4 18:53:46 UTC 2020


 cui/source/customize/cfg.cxx      |   39 ++++++++++++++++----------------------
 cui/uiconfig/ui/menuassignpage.ui |    2 -
 2 files changed, 18 insertions(+), 23 deletions(-)

New commits:
commit 7d5a463684b44b625bf555c1d8ed4df5a1660339
Author:     Onur Yilmaz <onuryilmaz0750 at gmail.com>
AuthorDate: Mon Feb 3 23:23:17 2020 +0300
Commit:     Muhammet Kara <muhammet.kara at collabora.com>
CommitDate: Tue Feb 4 19:53:11 2020 +0100

    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 at collabora.com>

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>


More information about the Libreoffice-commits mailing list