summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-07-02 12:20:01 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-07-02 14:13:26 +0100
commitc1de2a8b12d6d8df0aa219a809e05641afe56c06 (patch)
tree0e29e9709a43371fe1579a0d7a0c99c010a191ae
parentfix StrictStringSort (and STL assertion in starmath test) (diff)
downloadcore-c1de2a8b12d6d8df0aa219a809e05641afe56c06.tar.gz
core-c1de2a8b12d6d8df0aa219a809e05641afe56c06.zip
convert (old) mail merge dialog to .ui
Change-Id: Id812851c93807b15709930112ec839ba64884110
-rw-r--r--sw/UIConfig_swriter.mk1
-rw-r--r--sw/inc/envelp.hrc2
-rw-r--r--sw/inc/helpid.h1
-rw-r--r--sw/inc/swabstdlg.hxx3
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx17
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx3
-rw-r--r--sw/source/ui/envelp/mailmrge.cxx18
-rw-r--r--sw/source/ui/envelp/mailmrge.hrc3
-rw-r--r--sw/source/ui/envelp/mailmrge.src49
-rw-r--r--sw/source/ui/inc/mailmrge.hxx16
-rw-r--r--sw/source/ui/uiview/view2.cxx3
-rw-r--r--sw/uiconfig/swriter/ui/mailmergedialog.ui157
12 files changed, 176 insertions, 97 deletions
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index f85c018514aa..26f78fbfa4ef 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -94,6 +94,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/insertscript \
sw/uiconfig/swriter/ui/inserttable \
sw/uiconfig/swriter/ui/linenumbering \
+ sw/uiconfig/swriter/ui/mailmergedialog \
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 8c59fc4f4a9c..b33d5332f93d 100644
--- a/sw/inc/envelp.hrc
+++ b/sw/inc/envelp.hrc
@@ -66,7 +66,7 @@
#define STR_DATABASE_NOT_OPENED (RC_ENVLOP_BEGIN + 63)
#define STR_NO_DRIVERS (RC_ENVLOP_BEGIN + 64)
-#define DLG_MERGE_CREATE (RC_ENVLOP_BEGIN + 65)
+
#define DLG_MERGE_FIELD_CONNECTIONS (RC_ENVLOP_BEGIN + 66)
#define STR_BTN_NEW_DOC (RC_ENVLOP_BEGIN + 67)
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index c437da15c283..dfe9d8d01ba5 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -436,7 +436,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_CREATE_FROM "SW_HID_MAIL_MERGE_CREATE_FROM"
#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"
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index a7563b8c441f..1515b786d18f 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -430,8 +430,7 @@ public:
sal_Int32 nCommandType,
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( int nResId,
- Window* pParent ) = 0; //add for SwMailMergeCreateFromDlg
+ virtual AbstractMailMergeCreateFromDlg* CreateMailMergeCreateFromDlg(Window* pParent) = 0;
virtual AbstractMailMergeFieldConnectionsDlg* CreateMailMergeFieldConnectionsDlg( int nResId,
Window* pParent ) = 0; //add for SwMailMergeFieldConnectionsDlg
virtual VclAbstractDialog* CreateMultiTOXMarkDlg( int nResId,
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 81f62b11d0c3..1f949a3d9893 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -1109,21 +1109,10 @@ AbstractMailMergeDlg * SwAbstractDialogFactory_Impl::CreateMailMergeDlg( int nRe
return 0;
}
-AbstractMailMergeCreateFromDlg * SwAbstractDialogFactory_Impl::CreateMailMergeCreateFromDlg( int nResId,
- Window* pParent ) //add for SwMailMergeCreateFromDlg
+AbstractMailMergeCreateFromDlg * SwAbstractDialogFactory_Impl::CreateMailMergeCreateFromDlg(Window* pParent)
{
- SwMailMergeCreateFromDlg* pDlg=NULL;
- switch ( nResId )
- {
- case DLG_MERGE_CREATE :
- pDlg = new SwMailMergeCreateFromDlg( pParent );
- break;
- default:
- break;
- }
- if ( pDlg )
- return new AbstractMailMergeCreateFromDlg_Impl( pDlg );
- return 0;
+ SwMailMergeCreateFromDlg* pDlg = new SwMailMergeCreateFromDlg(pParent);
+ return new AbstractMailMergeCreateFromDlg_Impl(pDlg);
}
AbstractMailMergeFieldConnectionsDlg * SwAbstractDialogFactory_Impl::CreateMailMergeFieldConnectionsDlg( int nResId,
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index c46abe634f37..6aa3be4d3a20 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -526,8 +526,7 @@ public:
sal_Int32 nCommandType,
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( int nResId,
- Window* pParent ); //add for SwMailMergeCreateFromDlg
+ virtual AbstractMailMergeCreateFromDlg* CreateMailMergeCreateFromDlg(Window* pParent);
virtual AbstractMailMergeFieldConnectionsDlg* CreateMailMergeFieldConnectionsDlg( int nResId,
Window* pParent ); //add for SwMailMergeFieldConnectionsDlg
virtual VclAbstractDialog* CreateMultiTOXMarkDlg( int nResId,
diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index 8ae22f1b1ef6..f9da36d3d85a 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -812,20 +812,12 @@ uno::Reference<XResultSet> SwMailMergeDlg::GetResultSet() const
return xResSetClone;
}
-SwMailMergeCreateFromDlg::SwMailMergeCreateFromDlg(Window* pParent) :
- ModalDialog(pParent, SW_RES(DLG_MERGE_CREATE)),
- aCreateFromFL( this, SW_RES( FL_CREATEFROM )),
- aThisDocRB( this, SW_RES( RB_THISDOC )),
- aUseTemplateRB( this, SW_RES( RB_TEMPLATE )),
- aOK( this, SW_RES( BT_OK )),
- aCancel( this, SW_RES( BT_CANCEL )),
- aHelp( this, SW_RES( BT_HELP ))
-{
- FreeResource();
-}
-
-SwMailMergeCreateFromDlg::~SwMailMergeCreateFromDlg()
+SwMailMergeCreateFromDlg::SwMailMergeCreateFromDlg(Window* pParent)
+ : ModalDialog(pParent, "MailMergeDialog",
+ "modules/swriter/ui/mailmergedialog.ui")
{
+ get(m_pThisDocRB, "document");
+ get(m_pUseTemplateRB, "template");
}
SwMailMergeFieldConnectionsDlg::SwMailMergeFieldConnectionsDlg(Window* pParent) :
diff --git a/sw/source/ui/envelp/mailmrge.hrc b/sw/source/ui/envelp/mailmrge.hrc
index cd08296d26ff..92ff9520ef89 100644
--- a/sw/source/ui/envelp/mailmrge.hrc
+++ b/sw/source/ui/envelp/mailmrge.hrc
@@ -65,9 +65,6 @@
#define FT_FILTER 43
#define LB_FILTER 44
-#define FL_CREATEFROM 1
-#define RB_THISDOC 2
-#define RB_TEMPLATE 3
#define BT_OK 4
#define BT_CANCEL 5
#define BT_HELP 6
diff --git a/sw/source/ui/envelp/mailmrge.src b/sw/source/ui/envelp/mailmrge.src
index 103fe9d66f8f..057745c36a17 100644
--- a/sw/source/ui/envelp/mailmrge.src
+++ b/sw/source/ui/envelp/mailmrge.src
@@ -337,55 +337,6 @@ ModalDialog DLG_MAILMERGE
};
};
-ModalDialog DLG_MERGE_CREATE
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 145 , 63 ) ;
- Moveable = TRUE ;
- HelpID = HID_MAIL_MERGE_CREATE_FROM;
- _MAIL_MERGE_STRING_
- FixedLine FL_CREATEFROM
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 80 , 8 ) ;
- Text [ en-US ] = "Create" ;
- };
- RadioButton RB_THISDOC
- {
- HelpID = "sw:RadioButton:DLG_MERGE_CREATE:RB_THISDOC";
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 70 , 10 ) ;
- Check = TRUE;
- TabStop = TRUE ;
- Text [ en-US ] = "From this ~document" ;
- };
- RadioButton RB_TEMPLATE
- {
- HelpID = "sw:RadioButton:DLG_MERGE_CREATE:RB_TEMPLATE";
- Pos = MAP_APPFONT ( 12 , 27 ) ;
- Size = MAP_APPFONT ( 70 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "From a ~template" ;
- };
- OKButton BT_OK
- {
- Pos = MAP_APPFONT ( 89 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- DefButton = TRUE ;
- };
- CancelButton BT_CANCEL
- {
- Pos = MAP_APPFONT ( 89 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
- HelpButton BT_HELP
- {
- Pos = MAP_APPFONT ( 89 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- };
-
-};
ModalDialog DLG_MERGE_FIELD_CONNECTIONS
{
OutputSize = TRUE ;
diff --git a/sw/source/ui/inc/mailmrge.hxx b/sw/source/ui/inc/mailmrge.hxx
index e3ebd534ac3c..0b9c452166cd 100644
--- a/sw/source/ui/inc/mailmrge.hxx
+++ b/sw/source/ui/inc/mailmrge.hxx
@@ -152,18 +152,14 @@ public:
class SwMailMergeCreateFromDlg : public ModalDialog
{
- FixedLine aCreateFromFL;
- RadioButton aThisDocRB;
- RadioButton aUseTemplateRB;
-
- OKButton aOK;
- CancelButton aCancel;
- HelpButton aHelp;
+ RadioButton* m_pThisDocRB;
+ RadioButton* m_pUseTemplateRB;
public:
SwMailMergeCreateFromDlg(Window* pParent);
- ~SwMailMergeCreateFromDlg();
-
- sal_Bool IsThisDocument() const {return aThisDocRB.IsChecked();}
+ bool IsThisDocument() const
+ {
+ return m_pThisDocRB->IsChecked();
+ }
};
class SwMailMergeFieldConnectionsDlg : public ModalDialog
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index 7f3ab45eadd1..70606af4bb62 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -1083,8 +1083,7 @@ void SwView::Execute(SfxRequest &rReq)
SfxViewFrame* pTmpFrame = GetViewFrame();
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialogdiet fail!");
- AbstractMailMergeCreateFromDlg* pDlg = pFact->CreateMailMergeCreateFromDlg( DLG_MERGE_CREATE,
- &pTmpFrame->GetWindow());
+ AbstractMailMergeCreateFromDlg* pDlg = pFact->CreateMailMergeCreateFromDlg(&pTmpFrame->GetWindow());
OSL_ENSURE(pDlg, "Dialogdiet fail!");
if(RET_OK == pDlg->Execute())
bUseCurrentDocument = pDlg->IsThisDocument();
diff --git a/sw/uiconfig/swriter/ui/mailmergedialog.ui b/sw/uiconfig/swriter/ui/mailmergedialog.ui
new file mode 100644
index 000000000000..8b04fc2f375d
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/mailmergedialog.ui
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="MailMergeDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Mail Merge</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="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>
+ <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="document">
+ <property name="label" translatable="yes">From this _document</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">template</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="template">
+ <property name="label" translatable="yes">From a _template</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">document</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>
+ </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">Create</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>