diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-08-22 09:57:51 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-08-22 11:08:58 +0100 |
commit | c880eff613540fc291cd5f90928c95cbe260979f (patch) | |
tree | a9fafd6daf7823c3a6df711af2b80c68c2069e26 /sw | |
parent | e9f3866934d68b4bca36d2e7d654c077fd6703f4 (diff) |
convert mail merge connection dialog to .ui
Change-Id: I37bbe66798efe855e9d12d131311615f6fbac702
Diffstat (limited to 'sw')
-rw-r--r-- | sw/UIConfig_swriter.mk | 1 | ||||
-rw-r--r-- | sw/inc/envelp.hrc | 2 | ||||
-rw-r--r-- | sw/inc/helpid.h | 1 | ||||
-rw-r--r-- | sw/inc/swabstdlg.hxx | 3 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 17 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 3 | ||||
-rw-r--r-- | sw/source/ui/envelp/mailmrge.cxx | 19 | ||||
-rw-r--r-- | sw/source/ui/envelp/mailmrge.hrc | 5 | ||||
-rw-r--r-- | sw/source/ui/envelp/mailmrge.src | 57 | ||||
-rw-r--r-- | sw/source/ui/inc/mailmrge.hxx | 18 | ||||
-rw-r--r-- | sw/source/ui/uiview/view2.cxx | 4 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/mailmergedialog.ui | 4 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/mergeconnectdialog.ui | 174 |
13 files changed, 192 insertions, 116 deletions
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index d3360ca8cd14..f9d1578279ac 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 7ab5d3df436d..f96c9e2a14a2 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 8dccf24cf229..3b9689f284ca 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 2fca3cc4faf1..c5b26d5914c7 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 d15d8342a87d..3c6e5b5c96ec 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 74e01c5cbd9a..409a8e23196c 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 f9da36d3d85a..fdac2f94b3f8 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 92ff9520ef89..a18506c30732 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 057745c36a17..bd56557c8759 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 0b9c452166cd..1219df82fcae 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 04ae139e18c3..d2e515d8972e 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 8b04fc2f375d..2de61acbe95c 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 000000000000..71a8cc11cadb --- /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> |