Issue 121577 - Allow setting toolbar name in Addons.xcu
Summary: Allow setting toolbar name in Addons.xcu
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: 3.4.1
Hardware: All All
: P3 Normal (vote)
Target Milestone: 4.0.0
Assignee: Ariel Constenla-Haile
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-03 19:37 UTC by Ariel Constenla-Haile
Modified: 2022-10-28 12:54 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Sample extension where the toolbar title is set in Addons.xcu (5.19 KB, application/vnd.openofficeorg.extension)
2013-01-05 18:18 UTC, Ariel Constenla-Haile
no flags Details
Sample extension where the toolbar title is set in the UIName property (9.86 KB, application/vnd.openofficeorg.extension)
2013-01-05 18:21 UTC, Ariel Constenla-Haile
no flags Details
Sample extension where the toolbar has no title (7.84 KB, application/vnd.openofficeorg.extension)
2013-01-05 18:38 UTC, Ariel Constenla-Haile
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
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"