From e139290ca19b5cf00d1408925d918dbfddebe330 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 22 Apr 2014 09:29:42 +0100 Subject: convert field assign address book page to .ui Change-Id: I4d97bd75df0c75af6b643e67350a1af738bd7538 --- extensions/UIConfig_sabpilot.mk | 1 + extensions/source/abpilot/abpresid.hrc | 3 - extensions/source/abpilot/abspilot.src | 34 ----------- extensions/source/abpilot/fieldmappingpage.cxx | 34 +++-------- extensions/source/abpilot/fieldmappingpage.hxx | 5 +- extensions/uiconfig/sabpilot/ui/fieldassignpage.ui | 65 ++++++++++++++++++++++ extensions/uiconfig/sabpilot/ui/selecttypepage.ui | 2 +- 7 files changed, 76 insertions(+), 68 deletions(-) create mode 100644 extensions/uiconfig/sabpilot/ui/fieldassignpage.ui (limited to 'extensions') diff --git a/extensions/UIConfig_sabpilot.mk b/extensions/UIConfig_sabpilot.mk index e90fc7e20fda..18683e4a5e97 100644 --- a/extensions/UIConfig_sabpilot.mk +++ b/extensions/UIConfig_sabpilot.mk @@ -10,6 +10,7 @@ $(eval $(call gb_UIConfig_UIConfig,modules/sabpilot)) $(eval $(call gb_UIConfig_add_uifiles,modules/sabpilot,\ + extensions/uiconfig/sabpilot/ui/fieldassignpage \ extensions/uiconfig/sabpilot/ui/selecttypepage \ )) diff --git a/extensions/source/abpilot/abpresid.hrc b/extensions/source/abpilot/abpresid.hrc index 15db79d46997..028dff9f75f2 100644 --- a/extensions/source/abpilot/abpresid.hrc +++ b/extensions/source/abpilot/abpresid.hrc @@ -47,7 +47,6 @@ #define RID_PAGE_ADMININVOKATION ( RID_PAGE_START + 1 ) #define RID_PAGE_TABLESELECTION_AB ( RID_PAGE_START + 2 ) -#define RID_PAGE_FIELDMAPPING ( RID_PAGE_START + 3 ) #define RID_PAGE_FINAL ( RID_PAGE_START + 4 ) // please adjust RID_PAGE_END (below) when adding new tab pages @@ -140,7 +139,6 @@ #define FT_NAME_EXPL 4 #define FT_ERROR 5 #define FL_TOOMUCHTABLES 6 -#define FT_FIELDASSIGMENTEXPL 7 #define FT_ASSIGNEDFIELDS 8 #define FT_FINISH_EXPL 9 #define FT_DUPLICATENAME 10 @@ -151,7 +149,6 @@ #define PB_INVOKE_ADMIN_DIALOG 1 -#define PB_INVOKE_FIELDS_DIALOG 2 #define PB_BROWSE 3 diff --git a/extensions/source/abpilot/abspilot.src b/extensions/source/abpilot/abspilot.src index 7531f122f852..ddc17c39d182 100644 --- a/extensions/source/abpilot/abspilot.src +++ b/extensions/source/abpilot/abspilot.src @@ -122,40 +122,6 @@ TabPage RID_PAGE_TABLESELECTION_AB }; }; - -TabPage RID_PAGE_FIELDMAPPING -{ - HelpID = "extensions:TabPage:RID_PAGE_FIELDMAPPING"; - SVLook = TRUE ; - Size = MAP_APPFONT ( WINDOW_SIZE_X , WINDOW_SIZE_Y ) ; - - FixedText FT_FIELDASSIGMENTEXPL - { - Pos = MAP_APPFONT ( BORDER_X, 9 ) ; - Size = MAP_APPFONT ( WINDOW_SIZE_X - 2 * BORDER_X, 72 ) ; - WordBreak = TRUE; - - Text [ en-US ] = "To incorporate the address data in your templates, %PRODUCTNAME has to know which fields contain which data.\n\nFor instance, you could have stored the e-mail addresses in a field named \"email\", or \"E-mail\" or \"EM\" - or something completely different.\n\nClick the button below to open another dialog where you can enter the settings for your data source."; - }; - - PushButton PB_INVOKE_FIELDS_DIALOG - { - HelpID = "extensions:PushButton:RID_PAGE_FIELDMAPPING:PB_INVOKE_FIELDS_DIALOG"; - Pos = MAP_APPFONT ( ( WINDOW_SIZE_X - BUTTON_SIZE_X ) / 2, 84 ) ; - Size = MAP_APPFONT ( BUTTON_SIZE_X, BUTTON_SIZE_Y ) ; - - Text [ en-US ] = "Field Assignment"; - }; - - FixedText FT_ASSIGNEDFIELDS - { - Pos = MAP_APPFONT ( BORDER_X, WINDOW_SIZE_Y - HEADER_SIZE_Y - 7 - 32 ) ; - Size = MAP_APPFONT ( WINDOW_SIZE_X - 2 * BORDER_X, 32 ) ; - WordBreak = TRUE; - }; -}; - - TabPage RID_PAGE_FINAL { HelpID = "extensions:TabPage:RID_PAGE_FINAL"; diff --git a/extensions/source/abpilot/fieldmappingpage.cxx b/extensions/source/abpilot/fieldmappingpage.cxx index 5ebdc9d4bfd9..c30bf82265c6 100644 --- a/extensions/source/abpilot/fieldmappingpage.cxx +++ b/extensions/source/abpilot/fieldmappingpage.cxx @@ -26,41 +26,21 @@ namespace abp { - - - //= FieldMappingPage - - FieldMappingPage::FieldMappingPage( OAddessBookSourcePilot* _pParent ) - :AddressBookSourcePage( _pParent, ModuleRes( RID_PAGE_FIELDMAPPING ) ) - ,m_aExplanation ( this, ModuleRes( FT_FIELDASSIGMENTEXPL ) ) - ,m_aInvokeDialog ( this, ModuleRes( PB_INVOKE_FIELDS_DIALOG ) ) - ,m_aHint ( this, ModuleRes( FT_ASSIGNEDFIELDS ) ) + : AddressBookSourcePage(_pParent, "FieldAssignPage", + "modules/sabpilot/ui/fieldassignpage.ui") { - FreeResource(); - - m_aInvokeDialog.SetClickHdl( LINK( this, FieldMappingPage, OnInvokeDialog ) ); + get(m_pInvokeDialog, "assign"); + get(m_pHint, "hint"); - // check the size of the InvokeDialog button - some languages are very ... gossipy here .... - sal_Int32 nTextWidth = m_aInvokeDialog.GetTextWidth( m_aInvokeDialog.GetText() ); - - sal_Int32 nBorderSpace = m_aInvokeDialog.LogicToPixel( Point( 4, 0 ), MAP_APPFONT ).X(); - sal_Int32 nSpace = m_aInvokeDialog.GetOutputSizePixel().Width() - 2 * nBorderSpace; - - if ( nSpace < nTextWidth ) - { - Size aButtonSize = m_aInvokeDialog.GetSizePixel(); - aButtonSize.Width() += nTextWidth - nSpace; - m_aInvokeDialog.SetSizePixel( aButtonSize ); - } + m_pInvokeDialog->SetClickHdl( LINK( this, FieldMappingPage, OnInvokeDialog ) ); } - void FieldMappingPage::ActivatePage() { AddressBookSourcePage::ActivatePage(); - m_aInvokeDialog.GrabFocus(); + m_pInvokeDialog->GrabFocus(); } @@ -83,7 +63,7 @@ namespace abp OUString sHint; if ( rSettings.aFieldMapping.empty() ) sHint = ModuleRes(RID_STR_NOFIELDSASSIGNED).toString(); - m_aHint.SetText( sHint ); + m_pHint->SetText( sHint ); } diff --git a/extensions/source/abpilot/fieldmappingpage.hxx b/extensions/source/abpilot/fieldmappingpage.hxx index e684fc09704f..35ce8a2fcc3b 100644 --- a/extensions/source/abpilot/fieldmappingpage.hxx +++ b/extensions/source/abpilot/fieldmappingpage.hxx @@ -33,9 +33,8 @@ namespace abp class FieldMappingPage : public AddressBookSourcePage { protected: - FixedText m_aExplanation; - PushButton m_aInvokeDialog; - FixedText m_aHint; + PushButton* m_pInvokeDialog; + FixedText* m_pHint; public: FieldMappingPage( OAddessBookSourcePilot* _pParent ); diff --git a/extensions/uiconfig/sabpilot/ui/fieldassignpage.ui b/extensions/uiconfig/sabpilot/ui/fieldassignpage.ui new file mode 100644 index 000000000000..f5cc1d33afdb --- /dev/null +++ b/extensions/uiconfig/sabpilot/ui/fieldassignpage.ui @@ -0,0 +1,65 @@ + + + + + + True + False + 6 + 12 + + + True + False + 0 + 0 + To incorporate the address data in your templates, %PRODUCTNAME has to know which fields contain which data. + +For instance, you could have stored the e-mail addresses in a field named "email", or "E-mail" or "EM" - or something completely different. + +Click the button below to open another dialog where you can enter the settings for your data source. + True + 90 + + + 0 + 0 + 1 + 1 + + + + + Field Assignment + True + True + True + center + True + + + 0 + 1 + 1 + 1 + + + + + True + False + True + 0 + 0 + True + 90 + + + 0 + 2 + 1 + 1 + + + + diff --git a/extensions/uiconfig/sabpilot/ui/selecttypepage.ui b/extensions/uiconfig/sabpilot/ui/selecttypepage.ui index 5cbe221e3afd..f61c3a12fccb 100644 --- a/extensions/uiconfig/sabpilot/ui/selecttypepage.ui +++ b/extensions/uiconfig/sabpilot/ui/selecttypepage.ui @@ -246,7 +246,7 @@ This wizard helps you create the data source. True - 100 + 90 0 -- cgit v1.2.3