diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-02-20 12:38:01 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-02-20 12:52:28 +0000 |
commit | 5f1d9876a26cc9bc6553a65e2335bd87e13789a2 (patch) | |
tree | 2ca536a6d190f5c51e8dcf09327be79547903b83 /cui | |
parent | 4c2ff9d048addd680799bf4aa28c5bb7b68eec71 (diff) |
move (rather dubious) accessibility name assignment code to .ui
Change-Id: I50dde15f4a13f0325c96330dbdc0cc8c74bb6cb6
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/inc/cuioptgenrl.hxx | 1 | ||||
-rw-r--r-- | cui/source/options/optgenrl.cxx | 35 | ||||
-rw-r--r-- | cui/uiconfig/ui/optuserpage.ui | 120 |
3 files changed, 120 insertions, 36 deletions
diff --git a/cui/source/inc/cuioptgenrl.hxx b/cui/source/inc/cuioptgenrl.hxx index 3b72966721f3..9b711169323c 100644 --- a/cui/source/inc/cuioptgenrl.hxx +++ b/cui/source/inc/cuioptgenrl.hxx @@ -59,7 +59,6 @@ private: void InitControls (); void SetLinks (); - void SetAccessibleNames (); protected: virtual int DeactivatePage( SfxItemSet* pSet ); diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx index 638d0b83bcda..812278b2ccfd 100644 --- a/cui/source/options/optgenrl.cxx +++ b/cui/source/options/optgenrl.cxx @@ -214,7 +214,6 @@ SvxGeneralTabPage::SvxGeneralTabPage(Window* pParent, const SfxItemSet& rCoreSet InitControls(); SetExchangeSupport(); // this page needs ExchangeSupport SetLinks(); - SetAccessibleNames(); } //------------------------------------------------------------------------ @@ -294,40 +293,6 @@ void SvxGeneralTabPage::SetLinks () //------------------------------------------------------------------------ -void SvxGeneralTabPage::SetAccessibleNames () -{ - // Because some labels have text for more than one edit field we have to - // split these texts and set these texts as accessible name - // of the corresponding edit fields. - // E.g. "City/State/Zip" -> "City", "State", "Zip" or - // "Tel. (Home/Work)" -> "Tel. (Home)", "Tel. (Work)" - for (unsigned i = 0; i != vRows.size(); ++i) - { - Row& rRow = *vRows[i]; - rtl::OUString const sLabel = rRow.pLabel->GetDisplayText(); - rtl::OUString sList = sLabel; // between brackets or the whole label - // brackets? - int iBracket = sLabel.indexOf('('); - if (iBracket != -1) - sList = sList.copy(iBracket + 1, sLabel.lastIndexOf(')') - iBracket - 1); - // cutting at '/'s - sal_Int32 nIndex = 0; - for (unsigned iField = rRow.nFirstField; iField != rRow.nLastField; ++iField) - { - // the token - rtl::OUString sPart = sList.getToken(0, static_cast<sal_Unicode>('/'), nIndex).trim(); - Edit *pEdit = vFields[iField]->pEdit; - // creating the accessible name - if (iBracket != -1) - pEdit->SetAccessibleName(sLabel.copy(0, iBracket) + "(" + sPart + ")"); - else - pEdit->SetAccessibleName(sPart); - } - } -} - -//------------------------------------------------------------------------ - SfxTabPage* SvxGeneralTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) { return ( new SvxGeneralTabPage( pParent, rAttrSet ) ); diff --git a/cui/uiconfig/ui/optuserpage.ui b/cui/uiconfig/ui/optuserpage.ui index c487591fb212..3cfbc40fc9de 100644 --- a/cui/uiconfig/ui/optuserpage.ui +++ b/cui/uiconfig/ui/optuserpage.ui @@ -122,6 +122,11 @@ <property name="label" translatable="yes">Tel. (Home/_Work)</property> <property name="use_underline">True</property> <property name="mnemonic_widget">home</property> + <child internal-child="accessible"> + <object class="AtkObject" id="phoneft-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes">Home telephone number</property> + </object> + </child> </object> <packing> <property name="left_attach">0</property> @@ -170,6 +175,11 @@ <property name="no_show_all">True</property> <property name="hexpand">True</property> <property name="invisible_char">•</property> + <child internal-child="accessible"> + <object class="AtkObject" id="firstname-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">First name</property> + </object> + </child> </object> <packing> <property name="left_attach">0</property> @@ -184,6 +194,11 @@ <property name="no_show_all">True</property> <property name="hexpand">True</property> <property name="invisible_char">•</property> + <child internal-child="accessible"> + <object class="AtkObject" id="lastname-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Last name</property> + </object> + </child> </object> <packing> <property name="left_attach">1</property> @@ -198,6 +213,11 @@ <property name="no_show_all">True</property> <property name="invisible_char">•</property> <property name="width_chars">7</property> + <child internal-child="accessible"> + <object class="AtkObject" id="shortname-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Initials</property> + </object> + </child> </object> <packing> <property name="left_attach">2</property> @@ -225,6 +245,11 @@ <property name="no_show_all">True</property> <property name="hexpand">True</property> <property name="invisible_char">•</property> + <child internal-child="accessible"> + <object class="AtkObject" id="city-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">City</property> + </object> + </child> </object> <packing> <property name="left_attach">0</property> @@ -239,6 +264,11 @@ <property name="no_show_all">True</property> <property name="hexpand">True</property> <property name="invisible_char">•</property> + <child internal-child="accessible"> + <object class="AtkObject" id="state-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">State</property> + </object> + </child> </object> <packing> <property name="left_attach">1</property> @@ -253,6 +283,11 @@ <property name="no_show_all">True</property> <property name="invisible_char">•</property> <property name="width_chars">15</property> + <child internal-child="accessible"> + <object class="AtkObject" id="zip-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Zip code</property> + </object> + </child> </object> <packing> <property name="left_attach">2</property> @@ -281,6 +316,11 @@ <property name="no_show_all">True</property> <property name="hexpand">True</property> <property name="invisible_char">•</property> + <child internal-child="accessible"> + <object class="AtkObject" id="title-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Title</property> + </object> + </child> </object> <packing> <property name="left_attach">0</property> @@ -295,6 +335,11 @@ <property name="no_show_all">True</property> <property name="hexpand">True</property> <property name="invisible_char">•</property> + <child internal-child="accessible"> + <object class="AtkObject" id="position-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Position</property> + </object> + </child> </object> <packing> <property name="left_attach">1</property> @@ -322,6 +367,11 @@ <property name="no_show_all">True</property> <property name="hexpand">True</property> <property name="invisible_char">•</property> + <child internal-child="accessible"> + <object class="AtkObject" id="home-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Home telephone number</property> + </object> + </child> </object> <packing> <property name="left_attach">0</property> @@ -336,6 +386,11 @@ <property name="no_show_all">True</property> <property name="hexpand">True</property> <property name="invisible_char">•</property> + <child internal-child="accessible"> + <object class="AtkObject" id="work-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Work telephone number</property> + </object> + </child> </object> <packing> <property name="left_attach">1</property> @@ -364,6 +419,11 @@ <property name="no_show_all">True</property> <property name="hexpand">True</property> <property name="invisible_char">•</property> + <child internal-child="accessible"> + <object class="AtkObject" id="fax-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">FAX number</property> + </object> + </child> </object> <packing> <property name="left_attach">0</property> @@ -378,6 +438,11 @@ <property name="no_show_all">True</property> <property name="hexpand">True</property> <property name="invisible_char">•</property> + <child internal-child="accessible"> + <object class="AtkObject" id="email-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">email address</property> + </object> + </child> </object> <packing> <property name="left_attach">1</property> @@ -451,6 +516,11 @@ <property name="hexpand">True</property> <property name="invisible_char">•</property> <property name="invisible_char_set">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="ruslastname-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Last name</property> + </object> + </child> </object> <packing> <property name="left_attach">0</property> @@ -466,6 +536,11 @@ <property name="hexpand">True</property> <property name="invisible_char">•</property> <property name="invisible_char_set">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="rusfathersname-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Father's name</property> + </object> + </child> </object> <packing> <property name="left_attach">2</property> @@ -481,6 +556,11 @@ <property name="invisible_char">•</property> <property name="width_chars">7</property> <property name="invisible_char_set">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="russhortname-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Initials</property> + </object> + </child> </object> <packing> <property name="left_attach">3</property> @@ -496,6 +576,11 @@ <property name="hexpand">True</property> <property name="invisible_char">•</property> <property name="invisible_char_set">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="rusfirstname-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">First name</property> + </object> + </child> </object> <packing> <property name="left_attach">1</property> @@ -540,6 +625,11 @@ <property name="hexpand">True</property> <property name="invisible_char">•</property> <property name="invisible_char_set">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="eastlastname-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Last name</property> + </object> + </child> </object> <packing> <property name="left_attach">0</property> @@ -555,6 +645,11 @@ <property name="hexpand">True</property> <property name="invisible_char">•</property> <property name="invisible_char_set">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="eastfirstname-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">First name</property> + </object> + </child> </object> <packing> <property name="left_attach">1</property> @@ -570,6 +665,11 @@ <property name="invisible_char">•</property> <property name="width_chars">7</property> <property name="invisible_char_set">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="eastshortname-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Initials</property> + </object> + </child> </object> <packing> <property name="left_attach">2</property> @@ -614,6 +714,11 @@ <property name="hexpand">True</property> <property name="invisible_char">•</property> <property name="invisible_char_set">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="russtreet-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Street</property> + </object> + </child> </object> <packing> <property name="left_attach">0</property> @@ -629,6 +734,11 @@ <property name="invisible_char">•</property> <property name="width_chars">15</property> <property name="invisible_char_set">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="apartnum-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Apartment number</property> + </object> + </child> </object> <packing> <property name="left_attach">1</property> @@ -673,6 +783,11 @@ <property name="hexpand">True</property> <property name="invisible_char">•</property> <property name="invisible_char_set">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="icity-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">City</property> + </object> + </child> </object> <packing> <property name="left_attach">1</property> @@ -688,6 +803,11 @@ <property name="invisible_char">•</property> <property name="width_chars">15</property> <property name="invisible_char_set">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="izip-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Zip code</property> + </object> + </child> </object> <packing> <property name="left_attach">0</property> |