[Libreoffice-commits] core.git: extensions/source extensions/uiconfig extensions/UIConfig_sabpilot.mk

Caolán McNamara caolanm at redhat.com
Tue Apr 22 01:37:30 PDT 2014


 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(-)

New commits:
commit e139290ca19b5cf00d1408925d918dbfddebe330
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 22 09:29:42 2014 +0100

    convert field assign address book page to .ui
    
    Change-Id: I4d97bd75df0c75af6b643e67350a1af738bd7538

diff --git a/extensions/UIConfig_sabpilot.mk b/extensions/UIConfig_sabpilot.mk
index e90fc7e..18683e4 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 15db79d..028dff9 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 7531f12..ddc17c3 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 5ebdc9d..c30bf82 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 e684fc0..35ce8a2 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 0000000..f5cc1d3
--- /dev/null
+++ b/extensions/uiconfig/sabpilot/ui/fieldassignpage.ui
@@ -0,0 +1,65 @@
+<?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>
diff --git a/extensions/uiconfig/sabpilot/ui/selecttypepage.ui b/extensions/uiconfig/sabpilot/ui/selecttypepage.ui
index 5cbe221..f61c3a1 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.</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>


More information about the Libreoffice-commits mailing list