Issue 121577

Summary: Allow setting toolbar name in Addons.xcu
Product: General Reporter: Ariel Constenla-Haile <arielch>
Component: codeAssignee: Ariel Constenla-Haile <arielch>
Status: CLOSED FIXED QA Contact:
Severity: Normal    
Priority: P3 CC: issues, oliver.brinzing
Version: 3.4.1   
Target Milestone: 4.0.0   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Sample extension where the toolbar title is set in Addons.xcu
none
Sample extension where the toolbar title is set in the UIName property
none
Sample extension where the toolbar has no title none

Description Ariel Constenla-Haile 2013-01-03 19:37:41 UTC
Currently the localized name of the toolbar defined by an extension cannot be set in the same file where the toolbar is defined, Addons.xcu

In order to set the toolbar name, the extension developer has to create a configuration file <Modelue>WindowState.xcu for every office module where the toolbar is to be displayed, even if the toolbar name will be exactly the same in every module. This situation is rather sub-optimal.
Comment 1 Oliver Brinzing 2013-01-04 12:21:44 UTC
.
Comment 2 Ariel Constenla-Haile 2013-01-05 18:16:25 UTC
Change applied in 

revision 1429069 schema modification, framework refactoring
revision 1429068 ToolbarLayoutManager changes
revision 1429070 adapt existing Addons.xcu

Now the OfficeToolBar is a set of ToolBar

<set oor:name="OfficeToolBar" oor:node-type="ToolBar">
  <info>
   <desc>Contains a lists of addon toolbars.</desc>
  </info>
</set>

A ToolBar consist of a localized Title and a set of ToolBarItems:

<group oor:name="ToolBar">
  <info>
    <desc>Contains the structure of a toolbar.</desc>
  </info>
  <prop oor:name="Title" oor:type="xs:string" oor:localized="true">
    <info>
      <desc>A localized string used as the toolbar title.</desc>
    </info>
    <value></value>
  </prop>
  <set oor:name="ToolBarItems" oor:node-type="ToolBarItem">
    <info>
       <desc>Contains a list of sets of toolbar items that are part of add-on toolbars.</desc>
    </info>
  </set>
</group>

A ToolBarItem has the same elements as before (though some clean-up should be made here, to remove the obsolete "ImageIdentifier").


Setting the toolbar title in Addons.xcu will take precedence over the <Module>WindowState.xcu.
The later will be taken into account only when the title is empty in Addons.xcu.
This way, an extension wanting to provide a different localized name for different modules, has to leave the Title in Addons.xcu empty, and set the UIName in the WindowState xcu's.
Comment 3 Ariel Constenla-Haile 2013-01-05 18:18:16 UTC
Created attachment 80097 [details]
Sample extension where the toolbar title is set in Addons.xcu
Comment 4 Ariel Constenla-Haile 2013-01-05 18:21:47 UTC
Created attachment 80098 [details]
Sample extension where the toolbar title is set in the UIName property

The "Title" in Addons.xcu is empty.
The extensions sets the "UIName" property in CalcWindowState.xcu and WriterWindowState
Comment 5 Ariel Constenla-Haile 2013-01-05 18:38:49 UTC
Created attachment 80099 [details]
Sample extension where the toolbar has no title

If the title is not set in Addons.xcu nor in a WindowState xcu, the toolbar title will be generated as before: "Add-on N"