[Libreoffice-commits] core.git: sw/inc sw/source sw/uiconfig sw/UIConfig_swriter.mk

Caolán McNamara caolanm at redhat.com
Thu Aug 22 03:09:22 PDT 2013


 sw/UIConfig_swriter.mk                       |    1 
 sw/inc/envelp.hrc                            |    2 
 sw/inc/helpid.h                              |    1 
 sw/inc/swabstdlg.hxx                         |    3 
 sw/source/ui/dialog/swdlgfact.cxx            |   17 --
 sw/source/ui/dialog/swdlgfact.hxx            |    3 
 sw/source/ui/envelp/mailmrge.cxx             |   19 --
 sw/source/ui/envelp/mailmrge.hrc             |    5 
 sw/source/ui/envelp/mailmrge.src             |   57 --------
 sw/source/ui/inc/mailmrge.hxx                |   18 --
 sw/source/ui/uiview/view2.cxx                |    4 
 sw/uiconfig/swriter/ui/mailmergedialog.ui    |    4 
 sw/uiconfig/swriter/ui/mergeconnectdialog.ui |  174 +++++++++++++++++++++++++++
 13 files changed, 192 insertions(+), 116 deletions(-)

New commits:
commit c880eff613540fc291cd5f90928c95cbe260979f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Aug 22 09:57:51 2013 +0100

    convert mail merge connection dialog to .ui
    
    Change-Id: I37bbe66798efe855e9d12d131311615f6fbac702

diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index d3360ca..f9d1578 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -125,6 +125,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
 	sw/uiconfig/swriter/ui/linenumbering \
 	sw/uiconfig/swriter/ui/mailconfigpage \
 	sw/uiconfig/swriter/ui/mailmergedialog \
+	sw/uiconfig/swriter/ui/mergeconnectdialog \
 	sw/uiconfig/swriter/ui/mergetabledialog \
 	sw/uiconfig/swriter/ui/newuserindexdialog \
 	sw/uiconfig/swriter/ui/numparapage \
diff --git a/sw/inc/envelp.hrc b/sw/inc/envelp.hrc
index 7ab5d3d..f96c9e2 100644
--- a/sw/inc/envelp.hrc
+++ b/sw/inc/envelp.hrc
@@ -52,8 +52,6 @@
 #define STR_DATABASE_NOT_OPENED  (RC_ENVLOP_BEGIN + 63)
 #define STR_NO_DRIVERS           (RC_ENVLOP_BEGIN + 64)
 
-#define DLG_MERGE_FIELD_CONNECTIONS (RC_ENVLOP_BEGIN + 66)
-
 #define STR_BTN_NEWDOC           (RC_ENVLOP_BEGIN + 68)
 #define STR_SENDER_TOKENS        (RC_ENVLOP_BEGIN + 69)
 // Ueberlaufpruefung ----------------------------------------------------------
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index 8dccf24..3b9689f 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -384,7 +384,6 @@
 
 #define HID_PVIEW_ZOOM_LB                                       "SW_HID_PVIEW_ZOOM_LB"
 #define HID_MAIL_MERGE_SELECT                                   "SW_HID_MAIL_MERGE_SELECT"
-#define HID_MAIL_MERGE_INSERT_FIELDS                            "SW_HID_MAIL_MERGE_INSERT_FIELDS"
 #define HID_PRINT_AS_MERGE                                      "SW_HID_PRINT_AS_MERGE"
 #define HID_MERGE_SOURCE_UNAVAILABLE                            "SW_HID_MERGE_SOURCE_UNAVAILABLE"
 #define HID_MODULE_TOOLBOX                                      "SW_HID_MODULE_TOOLBOX"
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index 2fca3cc..c5b26d5 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -428,8 +428,7 @@ public:
                                                 const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& xConnection,
                                                 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >* pSelection = 0 ) = 0; //add for SwMailMergeDlg
     virtual AbstractMailMergeCreateFromDlg*     CreateMailMergeCreateFromDlg(Window* pParent) = 0;
-    virtual AbstractMailMergeFieldConnectionsDlg*       CreateMailMergeFieldConnectionsDlg( int nResId,
-                                                            Window* pParent ) = 0; //add for SwMailMergeFieldConnectionsDlg
+    virtual AbstractMailMergeFieldConnectionsDlg* CreateMailMergeFieldConnectionsDlg(Window* pParent) = 0; //add for SwMailMergeFieldConnectionsDlg
     virtual VclAbstractDialog*          CreateMultiTOXMarkDlg( int nResId,
                                                 Window* pParent, SwTOXMgr &rTOXMgr ) = 0; //add for SwMultiTOXMarkDlg
     virtual SfxAbstractTabDialog*       CreateSwTabDialog( int nResId,
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index d15d834..3c6e5b5 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -1020,21 +1020,10 @@ AbstractMailMergeCreateFromDlg * SwAbstractDialogFactory_Impl::CreateMailMergeCr
     return new AbstractMailMergeCreateFromDlg_Impl(pDlg);
 }
 
-AbstractMailMergeFieldConnectionsDlg * SwAbstractDialogFactory_Impl::CreateMailMergeFieldConnectionsDlg( int nResId,
-                                                            Window* pParent ) //add for SwMailMergeFieldConnectionsDlg
+AbstractMailMergeFieldConnectionsDlg * SwAbstractDialogFactory_Impl::CreateMailMergeFieldConnectionsDlg(Window* pParent) //add for SwMailMergeFieldConnectionsDlg
 {
-    SwMailMergeFieldConnectionsDlg* pDlg=NULL;
-    switch ( nResId )
-    {
-        case DLG_MERGE_FIELD_CONNECTIONS :
-            pDlg = new SwMailMergeFieldConnectionsDlg( pParent );
-            break;
-        default:
-            break;
-    }
-    if ( pDlg )
-        return new AbstractMailMergeFieldConnectionsDlg_Impl( pDlg );
-    return 0;
+    SwMailMergeFieldConnectionsDlg* pDlg = new SwMailMergeFieldConnectionsDlg( pParent );
+    return new AbstractMailMergeFieldConnectionsDlg_Impl( pDlg );
 }
 
 VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateMultiTOXMarkDlg( int nResId,
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 74e01c5..409a8e2 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -524,8 +524,7 @@ public:
                                                 const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& xConnection,
                                                 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >* pSelection = 0 ); //add for SwMailMergeDlg
     virtual AbstractMailMergeCreateFromDlg*     CreateMailMergeCreateFromDlg(Window* pParent);
-    virtual AbstractMailMergeFieldConnectionsDlg*       CreateMailMergeFieldConnectionsDlg( int nResId,
-                                                            Window* pParent ); //add for SwMailMergeFieldConnectionsDlg
+    virtual AbstractMailMergeFieldConnectionsDlg* CreateMailMergeFieldConnectionsDlg(Window* pParent); //add for SwMailMergeFieldConnectionsDlg
     virtual VclAbstractDialog*          CreateMultiTOXMarkDlg( int nResId,
                                                 Window* pParent, SwTOXMgr &rTOXMgr ); //add for SwMultiTOXMarkDlg
     virtual SfxAbstractTabDialog*       CreateSwTabDialog( int nResId,
diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index f9da36d..fdac2f9 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -817,24 +817,13 @@ SwMailMergeCreateFromDlg::SwMailMergeCreateFromDlg(Window* pParent)
         "modules/swriter/ui/mailmergedialog.ui")
 {
     get(m_pThisDocRB, "document");
-    get(m_pUseTemplateRB, "template");
 }
 
-SwMailMergeFieldConnectionsDlg::SwMailMergeFieldConnectionsDlg(Window* pParent) :
-    ModalDialog(pParent, SW_RES(DLG_MERGE_FIELD_CONNECTIONS)),
-    aConnectionsFL( this, SW_RES( FL_CONNECTIONS  )),
-    aUseExistingRB( this, SW_RES( RB_USEEXISTING )),
-    aCreateNewRB(   this, SW_RES( RB_CREATENEW    )),
-    aInfoFI(        this, SW_RES( FT_INFO        )),
-    aOK(            this, SW_RES( BT_OK          )),
-    aCancel(        this, SW_RES( BT_CANCEL      )),
-    aHelp(          this, SW_RES( BT_HELP        ))
-{
-    FreeResource();
-}
-
-SwMailMergeFieldConnectionsDlg::~SwMailMergeFieldConnectionsDlg()
+SwMailMergeFieldConnectionsDlg::SwMailMergeFieldConnectionsDlg(Window* pParent)
+    : ModalDialog(pParent, "MergeConnectDialog",
+        "modules/swriter/ui/mergeconnectdialog.ui")
 {
+    get(m_pUseExistingRB, "existing");
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/envelp/mailmrge.hrc b/sw/source/ui/envelp/mailmrge.hrc
index 92ff952..a18506c 100644
--- a/sw/source/ui/envelp/mailmrge.hrc
+++ b/sw/source/ui/envelp/mailmrge.hrc
@@ -68,11 +68,6 @@
 #define BT_OK           4
 #define BT_CANCEL       5
 #define BT_HELP         6
-#define FL_CONNECTIONS  7
-#define RB_USEEXISTING  8
-#define RB_CREATENEW    9
-#define FT_INFO         10
-
 
 #endif
 
diff --git a/sw/source/ui/envelp/mailmrge.src b/sw/source/ui/envelp/mailmrge.src
index 057745c..bd56557 100644
--- a/sw/source/ui/envelp/mailmrge.src
+++ b/sw/source/ui/envelp/mailmrge.src
@@ -337,61 +337,4 @@ ModalDialog DLG_MAILMERGE
     };
 };
 
-ModalDialog DLG_MERGE_FIELD_CONNECTIONS
-{
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 205 , 97 ) ;
-    Moveable = TRUE ;
-    HelpID = HID_MAIL_MERGE_INSERT_FIELDS;
-    Text [ en-US ] = "Data Source Connection" ;
-    FixedLine FL_CONNECTIONS
-    {
-        Pos = MAP_APPFONT ( 6 , 3 ) ;
-        Size = MAP_APPFONT ( 140 , 8 ) ;
-        Text [ en-US ] = "Connect" ;
-    };
-    RadioButton RB_USEEXISTING
-    {
-        HelpID = "sw:RadioButton:DLG_MERGE_FIELD_CONNECTIONS:RB_USEEXISTING";
-        Pos = MAP_APPFONT ( 12 , 14 ) ;
-        Size = MAP_APPFONT ( 130 , 10 ) ;
-        Check = TRUE;
-        TabStop = TRUE ;
-        Text [ en-US ] = "~Use existing" ;
-    };
-    RadioButton RB_CREATENEW
-    {
-        HelpID = "sw:RadioButton:DLG_MERGE_FIELD_CONNECTIONS:RB_CREATENEW";
-        Pos = MAP_APPFONT ( 12 , 27 ) ;
-        Size = MAP_APPFONT ( 130 , 10 ) ;
-        TabStop = TRUE ;
-        Text [ en-US ] = "~Create new connection" ;
-    };
-    FixedText FT_INFO
-    {
-        Pos = MAP_APPFONT ( 6 , 41 ) ;
-        Size = MAP_APPFONT ( 141 , 50 ) ;
-        WordBreak = TRUE;
-        Text [ en-US ] = "Fields are used to personalize form letters. The fields are placeholders for data from a data source, such as a database. The fields in the form letter must be connected to the data source." ;
-    };
-    OKButton BT_OK
-    {
-        Pos = MAP_APPFONT ( 149 , 6 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        DefButton = TRUE ;
-    };
-    CancelButton BT_CANCEL
-    {
-        Pos = MAP_APPFONT ( 149 , 23 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-    };
-    HelpButton BT_HELP
-    {
-        Pos = MAP_APPFONT ( 149 , 43 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-    };
-
-};
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/mailmrge.hxx b/sw/source/ui/inc/mailmrge.hxx
index 0b9c452..1219df8 100644
--- a/sw/source/ui/inc/mailmrge.hxx
+++ b/sw/source/ui/inc/mailmrge.hxx
@@ -153,7 +153,6 @@ public:
 class SwMailMergeCreateFromDlg : public ModalDialog
 {
     RadioButton* m_pThisDocRB;
-    RadioButton* m_pUseTemplateRB;
 public:
     SwMailMergeCreateFromDlg(Window* pParent);
     bool IsThisDocument() const
@@ -164,20 +163,13 @@ public:
 
 class SwMailMergeFieldConnectionsDlg : public ModalDialog
 {
-    FixedLine       aConnectionsFL;
-    RadioButton     aUseExistingRB;
-    RadioButton     aCreateNewRB;
-
-    FixedInfo       aInfoFI;
-
-    OKButton        aOK;
-    CancelButton    aCancel;
-    HelpButton      aHelp;
+    RadioButton* m_pUseExistingRB;
 public:
     SwMailMergeFieldConnectionsDlg(Window* pParent);
-    ~SwMailMergeFieldConnectionsDlg();
-
-    sal_Bool    IsUseExistingConnections() const {return aUseExistingRB.IsChecked();}
+    bool IsUseExistingConnections() const
+    {
+        return m_pUseExistingRB->IsChecked();
+    }
 };
 
 #endif
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index 04ae139..d2e515d 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -2302,9 +2302,7 @@ void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument)
                 //take an existing data source or create a new one?
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
                 OSL_ENSURE(pFact, "Dialogdiet fail!");
-                AbstractMailMergeFieldConnectionsDlg* pConnectionsDlg = pFact->CreateMailMergeFieldConnectionsDlg(
-                                                    DLG_MERGE_FIELD_CONNECTIONS,
-                                                    &GetViewFrame()->GetWindow());
+                AbstractMailMergeFieldConnectionsDlg* pConnectionsDlg = pFact->CreateMailMergeFieldConnectionsDlg(&GetViewFrame()->GetWindow());
                 OSL_ENSURE(pConnectionsDlg, "Dialogdiet fail!");
                 if(RET_OK == pConnectionsDlg->Execute())
                     bCallAddressPilot = !pConnectionsDlg->IsUseExistingConnections();
diff --git a/sw/uiconfig/swriter/ui/mailmergedialog.ui b/sw/uiconfig/swriter/ui/mailmergedialog.ui
index 8b04fc2..2de61ac 100644
--- a/sw/uiconfig/swriter/ui/mailmergedialog.ui
+++ b/sw/uiconfig/swriter/ui/mailmergedialog.ui
@@ -9,12 +9,12 @@
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
         <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
         <property name="spacing">12</property>
         <child internal-child="action_area">
           <object class="GtkButtonBox" id="dialog-action_area1">
             <property name="can_focus">False</property>
-            <property name="orientation">vertical</property>
-            <property name="layout_style">start</property>
+            <property name="layout_style">end</property>
             <child>
               <object class="GtkButton" id="ok">
                 <property name="label">gtk-ok</property>
diff --git a/sw/uiconfig/swriter/ui/mergeconnectdialog.ui b/sw/uiconfig/swriter/ui/mergeconnectdialog.ui
new file mode 100644
index 0000000..71a8cc1
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/mergeconnectdialog.ui
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="MergeConnectDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Data Source Connection</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">12</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="ok">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="help">
+                <property name="label">gtk-help</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkFrame" id="frame1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
+            <property name="vexpand">True</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">none</property>
+            <child>
+              <object class="GtkAlignment" id="alignment1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="top_padding">6</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <object class="GtkGrid" id="grid2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="hexpand">True</property>
+                    <property name="row_spacing">6</property>
+                    <child>
+                      <object class="GtkRadioButton" id="existing">
+                        <property name="label" translatable="yes">_Use existing</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="use_underline">True</property>
+                        <property name="xalign">0</property>
+                        <property name="active">True</property>
+                        <property name="draw_indicator">True</property>
+                        <property name="group">new</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="GtkRadioButton" id="new">
+                        <property name="label" translatable="yes">_Create new connection</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="use_underline">True</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                        <property name="group">existing</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="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">Fields are used to personalize form letters. The fields are placeholders for data from a data source, such as a database. The fields in the form letter must be connected to the data source.</property>
+                        <property name="wrap">True</property>
+                        <property name="max_width_chars">52</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>
+                </child>
+              </object>
+            </child>
+            <child type="label">
+              <object class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Connect</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">ok</action-widget>
+      <action-widget response="0">cancel</action-widget>
+      <action-widget response="0">help</action-widget>
+    </action-widgets>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list