Kaydet (Commit) e139290c authored tarafından Caolán McNamara's avatar Caolán McNamara

convert field assign address book page to .ui

Change-Id: I4d97bd75df0c75af6b643e67350a1af738bd7538
üst 87812e16
......@@ -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 \
))
......
......@@ -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
......
......@@ -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";
......
......@@ -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 );
}
......
......@@ -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 );
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkGrid" id="FieldAssignPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="row_spacing">12</property>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label" translatable="yes">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.</property>
<property name="wrap">True</property>
<property name="max_width_chars">90</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="assign">
<property name="label" translatable="yes">Field Assignment</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">center</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="hint">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="vexpand">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="wrap">True</property>
<property name="max_width_chars">90</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
</interface>
......@@ -246,7 +246,7 @@
This wizard helps you create the data source.</property>
<property name="wrap">True</property>
<property name="max_width_chars">100</property>
<property name="max_width_chars">90</property>
</object>
<packing>
<property name="left_attach">0</property>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment