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

convert mail merge connection dialog to .ui

Change-Id: I37bbe66798efe855e9d12d131311615f6fbac702
üst e9f38669
...@@ -125,6 +125,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ ...@@ -125,6 +125,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/linenumbering \ sw/uiconfig/swriter/ui/linenumbering \
sw/uiconfig/swriter/ui/mailconfigpage \ sw/uiconfig/swriter/ui/mailconfigpage \
sw/uiconfig/swriter/ui/mailmergedialog \ sw/uiconfig/swriter/ui/mailmergedialog \
sw/uiconfig/swriter/ui/mergeconnectdialog \
sw/uiconfig/swriter/ui/mergetabledialog \ sw/uiconfig/swriter/ui/mergetabledialog \
sw/uiconfig/swriter/ui/newuserindexdialog \ sw/uiconfig/swriter/ui/newuserindexdialog \
sw/uiconfig/swriter/ui/numparapage \ sw/uiconfig/swriter/ui/numparapage \
......
...@@ -52,8 +52,6 @@ ...@@ -52,8 +52,6 @@
#define STR_DATABASE_NOT_OPENED (RC_ENVLOP_BEGIN + 63) #define STR_DATABASE_NOT_OPENED (RC_ENVLOP_BEGIN + 63)
#define STR_NO_DRIVERS (RC_ENVLOP_BEGIN + 64) #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_BTN_NEWDOC (RC_ENVLOP_BEGIN + 68)
#define STR_SENDER_TOKENS (RC_ENVLOP_BEGIN + 69) #define STR_SENDER_TOKENS (RC_ENVLOP_BEGIN + 69)
// Ueberlaufpruefung ---------------------------------------------------------- // Ueberlaufpruefung ----------------------------------------------------------
......
...@@ -384,7 +384,6 @@ ...@@ -384,7 +384,6 @@
#define HID_PVIEW_ZOOM_LB "SW_HID_PVIEW_ZOOM_LB" #define HID_PVIEW_ZOOM_LB "SW_HID_PVIEW_ZOOM_LB"
#define HID_MAIL_MERGE_SELECT "SW_HID_MAIL_MERGE_SELECT" #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_PRINT_AS_MERGE "SW_HID_PRINT_AS_MERGE"
#define HID_MERGE_SOURCE_UNAVAILABLE "SW_HID_MERGE_SOURCE_UNAVAILABLE" #define HID_MERGE_SOURCE_UNAVAILABLE "SW_HID_MERGE_SOURCE_UNAVAILABLE"
#define HID_MODULE_TOOLBOX "SW_HID_MODULE_TOOLBOX" #define HID_MODULE_TOOLBOX "SW_HID_MODULE_TOOLBOX"
......
...@@ -428,8 +428,7 @@ public: ...@@ -428,8 +428,7 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& xConnection, 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 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >* pSelection = 0 ) = 0; //add for SwMailMergeDlg
virtual AbstractMailMergeCreateFromDlg* CreateMailMergeCreateFromDlg(Window* pParent) = 0; virtual AbstractMailMergeCreateFromDlg* CreateMailMergeCreateFromDlg(Window* pParent) = 0;
virtual AbstractMailMergeFieldConnectionsDlg* CreateMailMergeFieldConnectionsDlg( int nResId, virtual AbstractMailMergeFieldConnectionsDlg* CreateMailMergeFieldConnectionsDlg(Window* pParent) = 0; //add for SwMailMergeFieldConnectionsDlg
Window* pParent ) = 0; //add for SwMailMergeFieldConnectionsDlg
virtual VclAbstractDialog* CreateMultiTOXMarkDlg( int nResId, virtual VclAbstractDialog* CreateMultiTOXMarkDlg( int nResId,
Window* pParent, SwTOXMgr &rTOXMgr ) = 0; //add for SwMultiTOXMarkDlg Window* pParent, SwTOXMgr &rTOXMgr ) = 0; //add for SwMultiTOXMarkDlg
virtual SfxAbstractTabDialog* CreateSwTabDialog( int nResId, virtual SfxAbstractTabDialog* CreateSwTabDialog( int nResId,
......
...@@ -1020,21 +1020,10 @@ AbstractMailMergeCreateFromDlg * SwAbstractDialogFactory_Impl::CreateMailMergeCr ...@@ -1020,21 +1020,10 @@ AbstractMailMergeCreateFromDlg * SwAbstractDialogFactory_Impl::CreateMailMergeCr
return new AbstractMailMergeCreateFromDlg_Impl(pDlg); return new AbstractMailMergeCreateFromDlg_Impl(pDlg);
} }
AbstractMailMergeFieldConnectionsDlg * SwAbstractDialogFactory_Impl::CreateMailMergeFieldConnectionsDlg( int nResId, AbstractMailMergeFieldConnectionsDlg * SwAbstractDialogFactory_Impl::CreateMailMergeFieldConnectionsDlg(Window* pParent) //add for SwMailMergeFieldConnectionsDlg
Window* pParent ) //add for SwMailMergeFieldConnectionsDlg
{ {
SwMailMergeFieldConnectionsDlg* pDlg=NULL; SwMailMergeFieldConnectionsDlg* pDlg = new SwMailMergeFieldConnectionsDlg( pParent );
switch ( nResId ) return new AbstractMailMergeFieldConnectionsDlg_Impl( pDlg );
{
case DLG_MERGE_FIELD_CONNECTIONS :
pDlg = new SwMailMergeFieldConnectionsDlg( pParent );
break;
default:
break;
}
if ( pDlg )
return new AbstractMailMergeFieldConnectionsDlg_Impl( pDlg );
return 0;
} }
VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateMultiTOXMarkDlg( int nResId, VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateMultiTOXMarkDlg( int nResId,
......
...@@ -524,8 +524,7 @@ public: ...@@ -524,8 +524,7 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& xConnection, 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 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >* pSelection = 0 ); //add for SwMailMergeDlg
virtual AbstractMailMergeCreateFromDlg* CreateMailMergeCreateFromDlg(Window* pParent); virtual AbstractMailMergeCreateFromDlg* CreateMailMergeCreateFromDlg(Window* pParent);
virtual AbstractMailMergeFieldConnectionsDlg* CreateMailMergeFieldConnectionsDlg( int nResId, virtual AbstractMailMergeFieldConnectionsDlg* CreateMailMergeFieldConnectionsDlg(Window* pParent); //add for SwMailMergeFieldConnectionsDlg
Window* pParent ); //add for SwMailMergeFieldConnectionsDlg
virtual VclAbstractDialog* CreateMultiTOXMarkDlg( int nResId, virtual VclAbstractDialog* CreateMultiTOXMarkDlg( int nResId,
Window* pParent, SwTOXMgr &rTOXMgr ); //add for SwMultiTOXMarkDlg Window* pParent, SwTOXMgr &rTOXMgr ); //add for SwMultiTOXMarkDlg
virtual SfxAbstractTabDialog* CreateSwTabDialog( int nResId, virtual SfxAbstractTabDialog* CreateSwTabDialog( int nResId,
......
...@@ -817,24 +817,13 @@ SwMailMergeCreateFromDlg::SwMailMergeCreateFromDlg(Window* pParent) ...@@ -817,24 +817,13 @@ SwMailMergeCreateFromDlg::SwMailMergeCreateFromDlg(Window* pParent)
"modules/swriter/ui/mailmergedialog.ui") "modules/swriter/ui/mailmergedialog.ui")
{ {
get(m_pThisDocRB, "document"); get(m_pThisDocRB, "document");
get(m_pUseTemplateRB, "template");
} }
SwMailMergeFieldConnectionsDlg::SwMailMergeFieldConnectionsDlg(Window* pParent) : SwMailMergeFieldConnectionsDlg::SwMailMergeFieldConnectionsDlg(Window* pParent)
ModalDialog(pParent, SW_RES(DLG_MERGE_FIELD_CONNECTIONS)), : ModalDialog(pParent, "MergeConnectDialog",
aConnectionsFL( this, SW_RES( FL_CONNECTIONS )), "modules/swriter/ui/mergeconnectdialog.ui")
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()
{ {
get(m_pUseExistingRB, "existing");
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -68,11 +68,6 @@ ...@@ -68,11 +68,6 @@
#define BT_OK 4 #define BT_OK 4
#define BT_CANCEL 5 #define BT_CANCEL 5
#define BT_HELP 6 #define BT_HELP 6
#define FL_CONNECTIONS 7
#define RB_USEEXISTING 8
#define RB_CREATENEW 9
#define FT_INFO 10
#endif #endif
......
...@@ -337,61 +337,4 @@ ModalDialog DLG_MAILMERGE ...@@ -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: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -153,7 +153,6 @@ public: ...@@ -153,7 +153,6 @@ public:
class SwMailMergeCreateFromDlg : public ModalDialog class SwMailMergeCreateFromDlg : public ModalDialog
{ {
RadioButton* m_pThisDocRB; RadioButton* m_pThisDocRB;
RadioButton* m_pUseTemplateRB;
public: public:
SwMailMergeCreateFromDlg(Window* pParent); SwMailMergeCreateFromDlg(Window* pParent);
bool IsThisDocument() const bool IsThisDocument() const
...@@ -164,20 +163,13 @@ public: ...@@ -164,20 +163,13 @@ public:
class SwMailMergeFieldConnectionsDlg : public ModalDialog class SwMailMergeFieldConnectionsDlg : public ModalDialog
{ {
FixedLine aConnectionsFL; RadioButton* m_pUseExistingRB;
RadioButton aUseExistingRB;
RadioButton aCreateNewRB;
FixedInfo aInfoFI;
OKButton aOK;
CancelButton aCancel;
HelpButton aHelp;
public: public:
SwMailMergeFieldConnectionsDlg(Window* pParent); SwMailMergeFieldConnectionsDlg(Window* pParent);
~SwMailMergeFieldConnectionsDlg(); bool IsUseExistingConnections() const
{
sal_Bool IsUseExistingConnections() const {return aUseExistingRB.IsChecked();} return m_pUseExistingRB->IsChecked();
}
}; };
#endif #endif
......
...@@ -2302,9 +2302,7 @@ void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument) ...@@ -2302,9 +2302,7 @@ void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument)
//take an existing data source or create a new one? //take an existing data source or create a new one?
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialogdiet fail!"); OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractMailMergeFieldConnectionsDlg* pConnectionsDlg = pFact->CreateMailMergeFieldConnectionsDlg( AbstractMailMergeFieldConnectionsDlg* pConnectionsDlg = pFact->CreateMailMergeFieldConnectionsDlg(&GetViewFrame()->GetWindow());
DLG_MERGE_FIELD_CONNECTIONS,
&GetViewFrame()->GetWindow());
OSL_ENSURE(pConnectionsDlg, "Dialogdiet fail!"); OSL_ENSURE(pConnectionsDlg, "Dialogdiet fail!");
if(RET_OK == pConnectionsDlg->Execute()) if(RET_OK == pConnectionsDlg->Execute())
bCallAddressPilot = !pConnectionsDlg->IsUseExistingConnections(); bCallAddressPilot = !pConnectionsDlg->IsUseExistingConnections();
......
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1"> <object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property> <property name="spacing">12</property>
<child internal-child="action_area"> <child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area1"> <object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="layout_style">end</property>
<property name="layout_style">start</property>
<child> <child>
<object class="GtkButton" id="ok"> <object class="GtkButton" id="ok">
<property name="label">gtk-ok</property> <property name="label">gtk-ok</property>
......
<?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>
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