From 2a200a271c134bdd91658f6b34213b4a77f3295f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 24 Mar 2014 13:46:31 +0000 Subject: convert mail merge prepare page to .ui Change-Id: I7bfd0a5b3f5ce5d548bf711ffb82b85a126fec2b --- sw/AllLangResTarget_sw.mk | 1 - sw/UIConfig_swriter.mk | 1 + sw/inc/dbui.hrc | 1 - sw/inc/helpid.h | 1 - sw/source/ui/dbui/mmpreparemergepage.cxx | 76 ++++--- sw/source/ui/dbui/mmpreparemergepage.hrc | 38 ---- sw/source/ui/dbui/mmpreparemergepage.hxx | 24 +-- sw/source/ui/dbui/mmpreparemergepage.src | 124 ------------ sw/uiconfig/swriter/ui/mmpreparepage.ui | 328 +++++++++++++++++++++++++++++++ 9 files changed, 370 insertions(+), 224 deletions(-) delete mode 100644 sw/source/ui/dbui/mmpreparemergepage.hrc delete mode 100644 sw/source/ui/dbui/mmpreparemergepage.src create mode 100644 sw/uiconfig/swriter/ui/mmpreparepage.ui (limited to 'sw') diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk index 99df02bd351c..001c39e51dbf 100644 --- a/sw/AllLangResTarget_sw.mk +++ b/sw/AllLangResTarget_sw.mk @@ -97,7 +97,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\ sw/source/ui/dbui/mmgreetingspage.src \ sw/source/ui/dbui/mmmergepage.src \ sw/source/ui/dbui/mmoutputpage.src \ - sw/source/ui/dbui/mmpreparemergepage.src \ sw/source/ui/dbui/selectdbtabledialog.src \ sw/source/ui/dialog/dialog.src \ sw/source/ui/dochdl/dochdl.src \ diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index ebb66820462c..e06de32f0763 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -167,6 +167,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/mmcreatingdialog \ sw/uiconfig/swriter/ui/mmlayoutpage \ sw/uiconfig/swriter/ui/mmoutputtypepage \ + sw/uiconfig/swriter/ui/mmpreparepage \ sw/uiconfig/swriter/ui/mmselectpage \ sw/uiconfig/swriter/ui/mmsalutationpage \ sw/uiconfig/swriter/ui/paradialog \ diff --git a/sw/inc/dbui.hrc b/sw/inc/dbui.hrc index 33996c531dfa..280090166e63 100644 --- a/sw/inc/dbui.hrc +++ b/sw/inc/dbui.hrc @@ -27,7 +27,6 @@ #define DLG_MAILMERGEWIZARD (RC_DBUI_BEGIN + 3) #define DLG_MM_DOCSELECT_PAGE (RC_DBUI_BEGIN + 4) #define DLG_MM_OUTPUTTYPE_PAGE (RC_DBUI_BEGIN + 5) -#define DLG_MM_PREPAREMERGE_PAGE (RC_DBUI_BEGIN + 8) #define DLG_MM_MERGE_PAGE (RC_DBUI_BEGIN + 9) #define DLG_MM_OUTPUT_PAGE (RC_DBUI_BEGIN + 10) #define DLG_MM_ADDRESSLISTDIALOG (RC_DBUI_BEGIN + 11) diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index c4a7d88d4643..8eebb159e537 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -364,7 +364,6 @@ #define HID_PRINT_AS_MERGE "SW_HID_PRINT_AS_MERGE" #define HID_MODULE_TOOLBOX "SW_HID_MODULE_TOOLBOX" -#define HID_MM_PREPAREMERGEPAGE "SW_HID_MM_PREPAREMERGEPAGE" #define HID_MM_MERGEPAGE "SW_HID_MM_MERGEPAGE" #define HID_MM_OUTPUTPAGE "SW_HID_MM_OUTPUTPAGE" #define HID_MM_SELECTDBTABLEDDIALOG "SW_HID_MM_SELECTDBTABLEDDIALOG" diff --git a/sw/source/ui/dbui/mmpreparemergepage.cxx b/sw/source/ui/dbui/mmpreparemergepage.cxx index 218d158c4422..60f800fa99ee 100644 --- a/sw/source/ui/dbui/mmpreparemergepage.cxx +++ b/sw/source/ui/dbui/mmpreparemergepage.cxx @@ -29,44 +29,33 @@ #include #include -#include - #include using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdbc; -SwMailMergePrepareMergePage::SwMailMergePrepareMergePage( SwMailMergeWizard* _pParent) : - svt::OWizardPage( _pParent, SW_RES(DLG_MM_PREPAREMERGE_PAGE)), - m_aHeaderFI(this, SW_RES( FI_HEADER ) ), - m_aPreviewFI(this, SW_RES( FI_PREVIEW ) ), - m_aRecipientFT(this, SW_RES( FT_RECIPIENT ) ), - m_aFirstPB(this, SW_RES( PB_FIRST ) ), - m_aPrevPB(this, SW_RES( PB_PREV ) ), - m_aRecordED(this, SW_RES( ED_RECORD ) ), - m_aNextPB(this, SW_RES( PB_NEXT ) ), - m_aLastPB(this, SW_RES( PB_LAST ) ), - m_ExcludeCB(this, SW_RES( CB_EXCLUDE ) ), - m_aNoteHeaderFL(this, SW_RES( FL_NOTEHEADER ) ), - m_aEditFI(this, SW_RES( FI_EDIT ) ), - m_aEditPB(this, SW_RES( PB_EDIT ) ), - m_pWizard(_pParent) +SwMailMergePrepareMergePage::SwMailMergePrepareMergePage( SwMailMergeWizard* _pParent) + : svt::OWizardPage(_pParent, "MMPreparePage", "modules/swriter/ui/mmpreparepage.ui") + , m_pWizard(_pParent) { - FreeResource(); - m_aEditPB.SetClickHdl( LINK( this, SwMailMergePrepareMergePage, EditDocumentHdl_Impl)); - Link aMoveLink(LINK( this, SwMailMergePrepareMergePage, MoveHdl_Impl)); - m_aFirstPB.SetClickHdl( aMoveLink ); - m_aPrevPB.SetClickHdl( aMoveLink ); - m_aNextPB.SetClickHdl( aMoveLink ); - m_aLastPB.SetClickHdl( aMoveLink ); - m_aRecordED.SetActionHdl( aMoveLink ); - m_ExcludeCB.SetClickHdl(LINK(this, SwMailMergePrepareMergePage, ExcludeHdl_Impl)); - aMoveLink.Call(&m_aRecordED); -} + get(m_pFirstPB, "first"); + get(m_pPrevPB, "prev"); + get(m_pRecordED, "record-nospin"); + get(m_pNextPB, "next"); + get(m_pLastPB, "last"); + get(m_pExcludeCB, "exclude"); + get(m_pEditPB, "edit"); -SwMailMergePrepareMergePage::~SwMailMergePrepareMergePage() -{ + m_pEditPB->SetClickHdl( LINK( this, SwMailMergePrepareMergePage, EditDocumentHdl_Impl)); + Link aMoveLink(LINK( this, SwMailMergePrepareMergePage, MoveHdl_Impl)); + m_pFirstPB->SetClickHdl( aMoveLink ); + m_pPrevPB->SetClickHdl( aMoveLink ); + m_pNextPB->SetClickHdl( aMoveLink ); + m_pLastPB->SetClickHdl( aMoveLink ); + m_pRecordED->SetModifyHdl( aMoveLink ); + m_pExcludeCB->SetClickHdl(LINK(this, SwMailMergePrepareMergePage, ExcludeHdl_Impl)); + aMoveLink.Call(m_pRecordED); } IMPL_LINK_NOARG(SwMailMergePrepareMergePage, EditDocumentHdl_Impl) @@ -78,35 +67,36 @@ IMPL_LINK_NOARG(SwMailMergePrepareMergePage, EditDocumentHdl_Impl) IMPL_LINK( SwMailMergePrepareMergePage, MoveHdl_Impl, void*, pCtrl) { + fprintf(stderr, "move\n"); SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); sal_Int32 nPos = rConfigItem.GetResultSetPosition(); - if(pCtrl == &m_aFirstPB) + if (pCtrl == m_pFirstPB) { rConfigItem.MoveResultSet(1); } - else if(pCtrl == &m_aPrevPB) + else if (pCtrl == m_pPrevPB) { rConfigItem.MoveResultSet(nPos - 1); } - else if(pCtrl == &m_aRecordED) + else if (pCtrl == m_pRecordED) { - rConfigItem.MoveResultSet( static_cast< sal_Int32 >(m_aRecordED.GetValue()) ); + rConfigItem.MoveResultSet( static_cast< sal_Int32 >(m_pRecordED->GetValue()) ); } - else if(pCtrl == &m_aNextPB) + else if (pCtrl == m_pNextPB) rConfigItem.MoveResultSet(nPos + 1); - else if(pCtrl == &m_aLastPB) + else if (pCtrl == m_pLastPB) rConfigItem.MoveResultSet(-1); nPos = rConfigItem.GetResultSetPosition(); - m_aRecordED.SetValue(nPos); + m_pRecordED->SetValue(nPos); bool bIsFirst; bool bIsLast; bool bValid = rConfigItem.IsResultSetFirstLast(bIsFirst, bIsLast); - m_aFirstPB.Enable(bValid && !bIsFirst); - m_aPrevPB.Enable(bValid && !bIsFirst); - m_aNextPB.Enable(bValid && !bIsLast); - m_aLastPB.Enable(bValid && !bIsLast); - m_ExcludeCB.Check(rConfigItem.IsRecordExcluded( rConfigItem.GetResultSetPosition() )); + m_pFirstPB->Enable(bValid && !bIsFirst); + m_pPrevPB->Enable(bValid && !bIsFirst); + m_pNextPB->Enable(bValid && !bIsLast); + m_pLastPB->Enable(bValid && !bIsLast); + m_pExcludeCB->Check(rConfigItem.IsRecordExcluded( rConfigItem.GetResultSetPosition() )); //now the record has to be merged into the source document const SwDBData& rDBData = rConfigItem.GetCurrentDBData(); @@ -144,7 +134,7 @@ IMPL_LINK( SwMailMergePrepareMergePage, ExcludeHdl_Impl, CheckBox*, pBox) void SwMailMergePrepareMergePage::ActivatePage() { - MoveHdl_Impl(&m_aRecordED); + MoveHdl_Impl(m_pRecordED); } /*------------------------------------------------------------------------- diff --git a/sw/source/ui/dbui/mmpreparemergepage.hrc b/sw/source/ui/dbui/mmpreparemergepage.hrc deleted file mode 100644 index 24103d312af3..000000000000 --- a/sw/source/ui/dbui/mmpreparemergepage.hrc +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef _MAILMERGEPREPAREMERGEPAGE_HRC -#define _MAILMERGEPREPAREMERGEPAGE_HRC - -#define FI_HEADER 1 -#define FI_PREVIEW 2 -#define PB_FIRST 3 -#define PB_PREV 4 -#define ED_RECORD 5 -#define PB_NEXT 6 -#define PB_LAST 7 -#define CB_EXCLUDE 8 -#define FI_EDIT 9 -#define PB_EDIT 10 -#define FL_NOTEHEADER 11 - -#define FT_RECIPIENT 13 - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mmpreparemergepage.hxx b/sw/source/ui/dbui/mmpreparemergepage.hxx index 34b7c8ce2873..d92cce1c5918 100644 --- a/sw/source/ui/dbui/mmpreparemergepage.hxx +++ b/sw/source/ui/dbui/mmpreparemergepage.hxx @@ -24,25 +24,19 @@ #include #include #include -#include "actctrl.hxx" class SwMailMergeWizard; class SwMailMergePrepareMergePage : public svt::OWizardPage { - SwBoldFixedInfo m_aHeaderFI; - FixedInfo m_aPreviewFI; - FixedText m_aRecipientFT; - PushButton m_aFirstPB; - PushButton m_aPrevPB; - NumEditAction m_aRecordED; - PushButton m_aNextPB; - PushButton m_aLastPB; - CheckBox m_ExcludeCB; + PushButton* m_pFirstPB; + PushButton* m_pPrevPB; + NumericField* m_pRecordED; + PushButton* m_pNextPB; + PushButton* m_pLastPB; + CheckBox* m_pExcludeCB; - FixedLine m_aNoteHeaderFL; - FixedInfo m_aEditFI; - PushButton m_aEditPB; + PushButton* m_pEditPB; SwMailMergeWizard* m_pWizard; @@ -54,9 +48,7 @@ class SwMailMergePrepareMergePage : public svt::OWizardPage virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ); public: - SwMailMergePrepareMergePage( SwMailMergeWizard* _pParent); - ~SwMailMergePrepareMergePage(); - + SwMailMergePrepareMergePage( SwMailMergeWizard* _pParent); }; #endif diff --git a/sw/source/ui/dbui/mmpreparemergepage.src b/sw/source/ui/dbui/mmpreparemergepage.src deleted file mode 100644 index 8816f7a5fda1..000000000000 --- a/sw/source/ui/dbui/mmpreparemergepage.src +++ /dev/null @@ -1,124 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#include -#include -#include - -TabPage DLG_MM_PREPAREMERGE_PAGE -{ - HelpID = HID_MM_PREPAREMERGEPAGE ; - Size = MAP_APPFONT ( 260 , 250 ) ; - Hide = TRUE ; - - FixedText FI_HEADER - { - Pos = MAP_APPFONT ( 6 , 8 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text[ en-US ] = "Preview and edit the document"; - }; - - FixedText FI_PREVIEW - { - Pos = MAP_APPFONT ( 6 , 27 ) ; - Size = MAP_APPFONT ( 248 , 26 ) ; - WordBreak = TRUE; - Text[ en-US ] = "The preview of a merged document is visible now. To see the preview of another document click one of the arrows."; - }; - FixedText FT_RECIPIENT - { - Pos = MAP_APPFONT ( 12 , 58 ) ; - Size = MAP_APPFONT ( 50 , 8 ) ; - Text[ en-US ] = "~Recipient"; - }; - - PushButton PB_FIRST - { - HelpID = "sw:PushButton:DLG_MM_PREPAREMERGE_PAGE:PB_FIRST"; - Pos = MAP_APPFONT ( 75 , 55 ) ; - Size = MAP_APPFONT ( 20 , 14 ) ; - Text = "|<" ; - QuickHelpText [en-US] = "First"; - }; - PushButton PB_PREV - { - HelpID = "sw:PushButton:DLG_MM_PREPAREMERGE_PAGE:PB_PREV"; - Pos = MAP_APPFONT ( 98 , 55 ) ; - Size = MAP_APPFONT ( 20 , 14 ) ; - Text = "<" ; - QuickHelpText [en-US] = "Previous"; - }; - NumericField ED_RECORD - { - HelpID = "sw:NumericField:DLG_MM_PREPAREMERGE_PAGE:ED_RECORD"; - Pos = MAP_APPFONT ( 121 , 56 ) ; - Size = MAP_APPFONT ( 20 , 12 ) ; - Border = TRUE ; - Left = TRUE ; - First = 1 ; - Minimum = 1 ; - Repeat = TRUE ; - Spin = FALSE ; - TabStop = TRUE ; - }; - PushButton PB_NEXT - { - HelpID = "sw:PushButton:DLG_MM_PREPAREMERGE_PAGE:PB_NEXT"; - Pos = MAP_APPFONT ( 144 , 55 ) ; - Size = MAP_APPFONT ( 20 , 14 ) ; - Text = ">" ; - QuickHelpText [en-US] = "Next"; - }; - PushButton PB_LAST - { - HelpID = "sw:PushButton:DLG_MM_PREPAREMERGE_PAGE:PB_LAST"; - Pos = MAP_APPFONT ( 167 , 55 ) ; - Size = MAP_APPFONT ( 20 , 14 ) ; - Text = ">|" ; - QuickHelpText [en-US] = "Last"; - }; - CheckBox CB_EXCLUDE - { - HelpID = "sw:CheckBox:DLG_MM_PREPAREMERGE_PAGE:CB_EXCLUDE"; - Pos = MAP_APPFONT ( 75, 77 ) ; - Size = MAP_APPFONT ( 179 , 10 ) ; - Text[ en-US ] = "E~xclude this recipient"; - }; - FixedLine FL_NOTEHEADER - { - Pos = MAP_APPFONT ( 6 , 100 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - Text[ en-US ] = "Edit Document"; - }; - FixedText FI_EDIT - { - Pos = MAP_APPFONT ( 12 , 122 ) ; - Size = MAP_APPFONT ( 242 , 60 ) ; - WordBreak = TRUE; - Text[ en-US ] = "Write or edit your document now if you have not already done so. The changes will effect all merged documents.\n\nClicking 'Edit Document...' will temporarily reduce the wizard to a small window so you can edit the mail merge document. After editing the document, return to the wizard by clicking 'Return to Mail Merge Wizard' in the small window." ; - }; - PushButton PB_EDIT - { - HelpID = "sw:PushButton:DLG_MM_PREPAREMERGE_PAGE:PB_EDIT"; - Pos = MAP_APPFONT ( 90 , 185 ) ; - Size = MAP_APPFONT ( 80 , 14 ) ; - Text[ en-US ] = "~Edit Document..."; - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/uiconfig/swriter/ui/mmpreparepage.ui b/sw/uiconfig/swriter/ui/mmpreparepage.ui new file mode 100644 index 000000000000..d6a7cf5b9ebe --- /dev/null +++ b/sw/uiconfig/swriter/ui/mmpreparepage.ui @@ -0,0 +1,328 @@ + + + + + + 1 + 65535 + 1 + 10 + + + True + False + True + True + 6 + vertical + 12 + + + True + False + True + True + 0 + none + + + True + False + True + True + 6 + 12 + + + True + False + True + True + 12 + + + True + False + True + 6 + + + True + False + True + 0 + 0 + The preview of a merged document is visible now. To see the preview of another document click one of the arrows. + True + 56 + + + 0 + 0 + 1 + 1 + + + + + True + False + 6 + 12 + + + True + False + 0 + 0 + _Recipient + True + + + 0 + 0 + 1 + 1 + + + + + True + False + center + True + 6 + 12 + + + |< + True + True + True + First + + + 0 + 0 + 1 + 1 + + + + + < + True + True + True + Previous + + + 1 + 0 + 1 + 1 + + + + + > + True + True + True + Next + + + 3 + 0 + 1 + 1 + + + + + >| + True + True + True + Last + + + 4 + 0 + 1 + 1 + + + + + True + True + adjustment1 + 1 + + + 2 + 0 + 1 + 1 + + + + + E_xclude this recipient + True + True + False + center + True + 0 + True + + + 0 + 1 + 5 + 1 + + + + + 1 + 0 + 1 + 1 + + + + + 0 + 1 + 1 + 1 + + + + + 0 + 0 + 1 + 1 + + + + + + + + + True + False + Preview document + + + + + + + + False + True + 0 + + + + + True + False + True + True + 0 + none + + + True + False + True + True + 6 + 12 + + + True + False + True + True + 12 + + + True + False + True + 6 + + + True + False + True + 0 + 0 + Write or edit your document now if you have not already done so. The changes will affect all merged documents. + +Clicking 'Edit Document...' will temporarily reduce the wizard to a small window so you can edit the mail merge document. After editing the document, return to the wizard by clicking 'Return to Mail Merge Wizard' in the small window. + True + 56 + + + 0 + 0 + 1 + 1 + + + + + _Edit Document... + True + True + True + center + True + + + 0 + 1 + 1 + 1 + + + + + 0 + 0 + 1 + 1 + + + + + + + + + True + False + Edit document + + + + + + + + False + True + 1 + + + + -- cgit