Rebased ref, commits from common ancestor: commit d230e9bb88469e5f2b86c4e456f098ed795eba41 Author: Jan Holesovsky <ke...@collabora.com> Date: Thu Dec 24 08:37:41 2015 +0100
mailmerge: Close dialogs when the operation is completed. Change-Id: Ic7a1c95f78f1b71f785038636d2dd8f9fb37bae7 diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx index 9503446..1e1578d 100644 --- a/sw/source/ui/dbui/mmresultdialogs.cxx +++ b/sw/source/ui/dbui/mmresultdialogs.cxx @@ -529,6 +529,15 @@ int documentEndPageNumber(SwMailMergeConfigItem* pConfigItem, int document) } } +void endDialog(Button* pButton) +{ + vcl::Window* pParent = getNonLayoutParent(pButton); + Dialog *pDialog = dynamic_cast<Dialog*>(pParent); + + if (pDialog && pDialog->IsInExecute()) + pDialog->EndDialog(RET_OK); +} + } // anonymous namespace IMPL_LINK_TYPED(SwMMResultSaveDialog, SaveOutputHdl_Impl, Button*, pButton, void) @@ -538,16 +547,17 @@ IMPL_LINK_TYPED(SwMMResultSaveDialog, SaveOutputHdl_Impl, Button*, pButton, void assert(pConfigItem); SwView* pTargetView = pConfigItem->GetTargetView(); - OSL_ENSURE(pTargetView, "no target view exists"); - if(!pTargetView) - return; + assert(pTargetView); if(m_pSaveAsOneRB->IsChecked()) { OUString sFilter; const OUString sPath = SwMailMergeHelper::CallSaveAsDialog(sFilter); if (sPath.isEmpty()) + { + // just return back to the dialog return; + } uno::Sequence< beans::PropertyValue > aValues(1); beans::PropertyValue* pValues = aValues.getArray(); pValues[0].Name = "FilterName"; @@ -592,7 +602,10 @@ IMPL_LINK_TYPED(SwMMResultSaveDialog, SaveOutputHdl_Impl, Button*, pButton, void OUString sFilter; OUString sPath = SwMailMergeHelper::CallSaveAsDialog(sFilter); if (sPath.isEmpty()) + { + // just return back to the dialog return; + } OUString sTargetTempURL = URIHelper::SmartRel2Abs( INetURLObject(), utl::TempFile::CreateTempName(), URIHelper::GetMaybeFileHdl()); @@ -697,18 +710,22 @@ IMPL_LINK_TYPED(SwMMResultSaveDialog, SaveOutputHdl_Impl, Button*, pButton, void else { xTempDocShell->DoClose(); + endDialog(pButton); return; } } else { xTempDocShell->DoClose(); + endDialog(pButton); break; } } } ::osl::File::remove( sTargetTempURL ); } + + endDialog(pButton); } IMPL_LINK_TYPED(SwMMResultPrintDialog, PrinterChangeHdl_Impl, ListBox&, rBox, void) @@ -757,16 +774,14 @@ IMPL_LINK_TYPED(SwMMResultPrintDialog, PrinterChangeHdl_Impl, ListBox&, rBox, vo pConfigItem->SetSelectedPrinter(rBox.GetSelectEntry()); } -IMPL_LINK_NOARG_TYPED(SwMMResultPrintDialog, PrintHdl_Impl, Button*, void) +IMPL_LINK_TYPED(SwMMResultPrintDialog, PrintHdl_Impl, Button*, pButton, void) { SwView* pView = ::GetActiveView(); SwMailMergeConfigItem* pConfigItem = pView->GetMailMergeConfigItem(); assert(pConfigItem); SwView* pTargetView = pConfigItem->GetTargetView(); - OSL_ENSURE(pTargetView, "no target view exists"); - if(!pTargetView) - return; + assert(pTargetView); sal_uInt32 nBegin = 0; sal_uInt32 nEnd = 0; @@ -810,6 +825,8 @@ IMPL_LINK_NOARG_TYPED(SwMMResultPrintDialog, PrintHdl_Impl, Button*, void) pTargetView->ExecPrint( aProps, false, true ); SfxGetpApp()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE_END, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE_END), pObjSh)); + + endDialog(pButton); } IMPL_LINK_TYPED(SwMMResultPrintDialog, PrinterSetupHdl_Impl, Button*, pButton, void) @@ -867,9 +884,7 @@ IMPL_LINK_TYPED(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, //get the composed document SwView* pTargetView = pConfigItem->GetTargetView(); - OSL_ENSURE(pTargetView, "no target view exists"); - if(!pTargetView) - return; + assert(pTargetView); if(pConfigItem->GetMailServer().isEmpty() || !SwMailMergeHelper::CheckMailAddress(pConfigItem->GetMailAddress()) ) @@ -884,7 +899,7 @@ IMPL_LINK_TYPED(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, } if(nRet != RET_OK && nRet != RET_YES) - return; + return; // back to the dialog } //add the documents sal_uInt32 nBegin = 0; @@ -963,7 +978,10 @@ IMPL_LINK_TYPED(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, pSfxFlt = pFilterContainer->GetFilter4Extension(sExtension, SfxFilterFlags::EXPORT); if(!pSfxFlt) + { + endDialog(pButton); return; + } OUString sMimeType = pSfxFlt->GetMimeType(); if(m_pSubjectED->GetText().isEmpty()) @@ -978,7 +996,7 @@ IMPL_LINK_TYPED(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, m_pSubjectED->SetText(aQuery->GetValue()); } else - return; + return; // back to the dialog } if(!bAsBody && m_pAttachmentED->GetText().isEmpty()) { @@ -999,7 +1017,7 @@ IMPL_LINK_TYPED(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, m_pAttachmentED->SetText(sAttach); } else - return; + return; // back to the dialog } SfxStringItem aFilterName( SID_FILTER_NAME, pSfxFlt->GetFilterName() ); OUString sEMailColumn = m_pMailToLB->GetSelectEntry(); @@ -1007,7 +1025,10 @@ IMPL_LINK_TYPED(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, Reference< sdbcx::XColumnsSupplier > xColsSupp( pConfigItem->GetResultSet(), UNO_QUERY); Reference < container::XNameAccess> xColAccess = xColsSupp.is() ? xColsSupp->getColumns() : nullptr; if(sEMailColumn.isEmpty() || !xColAccess.is() || !xColAccess->hasByName(sEMailColumn)) + { + endDialog(pButton); return; + } OUString sFilterOptions; if(MM_DOCTYPE_TEXT == nDocType) @@ -1195,6 +1216,8 @@ IMPL_LINK_TYPED(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, } pDlg->EnableDesctruction(); ::osl::File::remove( sTargetTempURL ); + + endDialog(pButton); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit a321533a2de20173142f791bc517e8162abe829c Author: Jan Holesovsky <ke...@collabora.com> Date: Wed Dec 23 18:48:47 2015 +0100 mailmerge: Create toolbar buttons for the Save/Print/Email dialogs. Change-Id: Ia983a313a02b470a23244b2844ff01b12593f723 diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu index 4c3ae1a..afaca15 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu @@ -532,6 +532,30 @@ <value>1</value> </prop> </node> + <node oor:name=".uno:MailMergeSaveDocuments" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Save Merged Documents</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:MailMergePrintDocuments" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Print Merged Documents</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:MailMergeEmailDocuments" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Send E-Mail Messages</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> <node oor:name=".uno:SetAnchorToFrame" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Anchor To Frame</value> diff --git a/sw/Library_swui.mk b/sw/Library_swui.mk index 6738e3c..0d20c61 100644 --- a/sw/Library_swui.mk +++ b/sw/Library_swui.mk @@ -169,9 +169,9 @@ $(eval $(call gb_Library_add_exception_objects,swui,\ sw/source/ui/dbui/mmgreetingspage \ sw/source/ui/dbui/mmlayoutpage \ sw/source/ui/dbui/mmmergepage \ - sw/source/ui/dbui/mmoutputpage \ sw/source/ui/dbui/mmoutputtypepage \ sw/source/ui/dbui/mmpreparemergepage \ + sw/source/ui/dbui/mmresultdialogs \ sw/source/ui/dbui/selectdbtabledialog \ )) endif diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index cf49e91..e90f3d0 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -185,6 +185,9 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/mmoutputpage \ sw/uiconfig/swriter/ui/mmoutputtypepage \ sw/uiconfig/swriter/ui/mmpreparepage \ + sw/uiconfig/swriter/ui/mmresultemaildialog \ + sw/uiconfig/swriter/ui/mmresultprintdialog \ + sw/uiconfig/swriter/ui/mmresultsavedialog \ sw/uiconfig/swriter/ui/mmselectpage \ sw/uiconfig/swriter/ui/mmsendmails \ sw/uiconfig/swriter/ui/mmsalutationpage \ diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index b6ed874..bd622fe 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -257,10 +257,13 @@ #define FN_MAILMERGE_NEXT_ENTRY (FN_INSERT + 72) /* mail merge toolbar - go to the next entry */ #define FN_MAILMERGE_LAST_ENTRY (FN_INSERT + 73) /* mail merge toolbar - go to the next entry */ -#define FN_MAILMERGE_CREATE_DOCUMENTS (FN_INSERT + 74) /* mail merge toolbar - create individual documents */ - #define FN_DRAWTEXT_ATTR_DLG (FN_INSERT + 76) /* position DrawText */ +#define FN_MAILMERGE_CREATE_DOCUMENTS (FN_INSERT + 77) /* mail merge toolbar - create the merged document */ +#define FN_MAILMERGE_SAVE_DOCUMENTS (FN_INSERT + 78) /* mail merge toolbar - save merged documents */ +#define FN_MAILMERGE_PRINT_DOCUMENTS (FN_INSERT + 79) /* mail merge toolbar - print merged documents */ +#define FN_MAILMERGE_EMAIL_DOCUMENTS (FN_INSERT + 80) /* mail merge toolbar - email merged documents */ + #define FN_TOOL_ANCHOR_CHAR (FN_INSERT + 84) /* anchor Draw object to character */ #define FN_QRY_INSERT (FN_INSERT + 86) /* insert record selection in to text */ diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index 6fd3e80..b51b280 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -461,6 +461,10 @@ public: // for tabpage virtual CreateTabPage GetTabPageCreatorFunc( sal_uInt16 nId ) = 0; + virtual void ExecuteMMResultSaveDialog() = 0; + virtual void ExecuteMMResultPrintDialog() = 0; + virtual void ExecuteMMResultEmailDialog() = 0; + protected: ~SwAbstractDialogFactory() {} }; diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi index 8c816ad..2b067fc 100644 --- a/sw/sdi/swriter.sdi +++ b/sw/sdi/swriter.sdi @@ -5347,6 +5347,78 @@ SfxVoidItem MailMergeCreateDocuments FN_MAILMERGE_CREATE_DOCUMENTS GroupId = GID_DOCUMENT; ] +SfxVoidItem MailMergeSaveDocuments FN_MAILMERGE_SAVE_DOCUMENTS +() +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable, + FastCall = TRUE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = TRUE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_DOCUMENT; +] + +SfxVoidItem MailMergePrintDocuments FN_MAILMERGE_PRINT_DOCUMENTS +() +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable, + FastCall = TRUE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = TRUE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_DOCUMENT; +] + +SfxVoidItem MailMergeEmailDocuments FN_MAILMERGE_EMAIL_DOCUMENTS +() +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable, + FastCall = TRUE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = TRUE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_DOCUMENT; +] + SfxBoolItem MergeTable FN_TABLE_MERGE_TABLE () [ diff --git a/sw/sdi/wrtapp.sdi b/sw/sdi/wrtapp.sdi index ccaab47..2a9883f 100644 --- a/sw/sdi/wrtapp.sdi +++ b/sw/sdi/wrtapp.sdi @@ -95,6 +95,24 @@ interface StarWriter StateMethod = StateOther ; ] + FN_MAILMERGE_SAVE_DOCUMENTS + [ + ExecMethod = ExecOther ; + StateMethod = StateOther ; + ] + + FN_MAILMERGE_PRINT_DOCUMENTS + [ + ExecMethod = ExecOther ; + StateMethod = StateOther ; + ] + + FN_MAILMERGE_EMAIL_DOCUMENTS + [ + ExecMethod = ExecOther ; + StateMethod = StateOther ; + ] + FN_SET_MODOPT_TBLNUMFMT // status() [ ExecMethod = ExecOther ; diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx index 9674806..2ab5127 100644 --- a/sw/source/ui/dbui/mailmergewizard.cxx +++ b/sw/source/ui/dbui/mailmergewizard.cxx @@ -24,7 +24,6 @@ #include <mmpreparemergepage.hxx> #include <mmmergepage.hxx> #include <mmgreetingspage.hxx> -#include <mmoutputpage.hxx> #include <mmlayoutpage.hxx> #include <mmconfigitem.hxx> #include <swabstdlg.hxx> diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx index a3c8526..0bdcc00 100644 --- a/sw/source/ui/dbui/mmoutputtypepage.cxx +++ b/sw/source/ui/dbui/mmoutputtypepage.cxx @@ -24,6 +24,20 @@ #include <dbui.hrc> #include <swtypes.hxx> +#include <rtl/ref.hxx> +#include <com/sun/star/mail/XSmtpService.hpp> +#include <vcl/svapp.hxx> +#include <vcl/idle.hxx> + +#include <helpid.h> +#include <cmdid.h> +#include <swunohelper.hxx> +#include <mmresultdialogs.hxx> +#include <maildispatcher.hxx> +#include <imaildsplistener.hxx> + +using namespace ::com::sun::star; + SwMailMergeOutputTypePage::SwMailMergeOutputTypePage(SwMailMergeWizard* pParent) : svt::OWizardPage(pParent, "MMOutputTypePage", "modules/swriter/ui/mmoutputtypepage.ui") @@ -73,21 +87,6 @@ IMPL_LINK_NOARG_TYPED(SwMailMergeOutputTypePage, TypeHdl_Impl, Button*, void) m_pWizard->UpdateRoadmap(); } - -#include <rtl/ref.hxx> -#include <com/sun/star/mail/XSmtpService.hpp> -#include <vcl/svapp.hxx> -#include <vcl/idle.hxx> - -#include <helpid.h> -#include <cmdid.h> -#include <swunohelper.hxx> -#include <mmoutputpage.hxx> -#include <maildispatcher.hxx> -#include <imaildsplistener.hxx> - -using namespace ::com::sun::star; - struct SwSendMailDialog_Impl { friend class SwSendMailDialog; diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx similarity index 99% rename from sw/source/ui/dbui/mmoutputpage.cxx rename to sw/source/ui/dbui/mmresultdialogs.cxx index 166851b..9503446 100644 --- a/sw/source/ui/dbui/mmoutputpage.cxx +++ b/sw/source/ui/dbui/mmresultdialogs.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <mmoutputpage.hxx> +#include <mmresultdialogs.hxx> #include <mailmergewizard.hxx> #include <mmconfigitem.hxx> #include <mailmergechildwindow.hxx> @@ -53,7 +53,6 @@ #include <unotools/tempfile.hxx> #include <osl/file.hxx> -#include <mmgreetingspage.hxx> #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <com/sun/star/sdb/XColumn.hpp> diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index a097e03..b8e41f9 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -91,6 +91,7 @@ #include <mailmergewizard.hxx> #include <mailconfigpage.hxx> #include <uiborder.hxx> +#include <mmresultdialogs.hxx> using namespace ::com::sun::star; @@ -1194,4 +1195,22 @@ CreateTabPage SwAbstractDialogFactory_Impl::GetTabPageCreatorFunc( sal_uInt16 nI return pRet; } +void SwAbstractDialogFactory_Impl::ExecuteMMResultSaveDialog() +{ + ScopedVclPtrInstance<SwMMResultSaveDialog> pDialog; + pDialog->Execute(); +} + +void SwAbstractDialogFactory_Impl::ExecuteMMResultPrintDialog() +{ + ScopedVclPtrInstance<SwMMResultPrintDialog> pDialog; + pDialog->Execute(); +} + +void SwAbstractDialogFactory_Impl::ExecuteMMResultEmailDialog() +{ + ScopedVclPtrInstance<SwMMResultEmailDialog> pDialog; + pDialog->Execute(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 45690eb..3c37fce 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -499,6 +499,9 @@ public: // For TabPage virtual CreateTabPage GetTabPageCreatorFunc( sal_uInt16 nId ) override; + virtual void ExecuteMMResultSaveDialog(); + virtual void ExecuteMMResultPrintDialog(); + virtual void ExecuteMMResultEmailDialog(); }; #endif diff --git a/sw/source/ui/dbui/mmoutputpage.hxx b/sw/source/ui/inc/mmresultdialogs.hxx similarity index 100% rename from sw/source/ui/dbui/mmoutputpage.hxx rename to sw/source/ui/inc/mmresultdialogs.hxx diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx index 7432b92..2021a09 100644 --- a/sw/source/uibase/app/apphdl.cxx +++ b/sw/source/uibase/app/apphdl.cxx @@ -226,6 +226,9 @@ void SwModule::StateOther(SfxItemSet &rSet) } break; case FN_MAILMERGE_CREATE_DOCUMENTS: + case FN_MAILMERGE_SAVE_DOCUMENTS: + case FN_MAILMERGE_PRINT_DOCUMENTS: + case FN_MAILMERGE_EMAIL_DOCUMENTS: { SwView* pView = ::GetActiveView(); SwMailMergeConfigItem* pConfigItem = pView->GetMailMergeConfigItem(); @@ -804,6 +807,24 @@ void SwModule::ExecOther(SfxRequest& rReq) if (pConfigItem->GetTargetView()) pConfigItem->GetTargetView()->GetViewFrame()->GetFrame().Appear(); } + case FN_MAILMERGE_SAVE_DOCUMENTS: + { + SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); + pFact->ExecuteMMResultSaveDialog(); + } + break; + case FN_MAILMERGE_PRINT_DOCUMENTS: + { + SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); + pFact->ExecuteMMResultPrintDialog(); + } + break; + case FN_MAILMERGE_EMAIL_DOCUMENTS: + { + SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); + pFact->ExecuteMMResultEmailDialog(); + } + break; #endif } } diff --git a/sw/uiconfig/swform/toolbar/mailmerge.xml b/sw/uiconfig/swform/toolbar/mailmerge.xml index 2ad2e32..7610f2a 100644 --- a/sw/uiconfig/swform/toolbar/mailmerge.xml +++ b/sw/uiconfig/swform/toolbar/mailmerge.xml @@ -17,4 +17,7 @@ <toolbar:toolbaritem xlink:href=".uno:MailMergeLastEntry"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:MailMergeCreateDocuments"/> + <toolbar:toolbaritem xlink:href=".uno:MailMergeSaveDocuments"/> + <toolbar:toolbaritem xlink:href=".uno:MailMergePrintDocuments"/> + <toolbar:toolbaritem xlink:href=".uno:MailMergeEmailDocuments"/> </toolbar:toolbar> diff --git a/sw/uiconfig/swreport/toolbar/mailmerge.xml b/sw/uiconfig/swreport/toolbar/mailmerge.xml index 2ad2e32..7610f2a 100644 --- a/sw/uiconfig/swreport/toolbar/mailmerge.xml +++ b/sw/uiconfig/swreport/toolbar/mailmerge.xml @@ -17,4 +17,7 @@ <toolbar:toolbaritem xlink:href=".uno:MailMergeLastEntry"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:MailMergeCreateDocuments"/> + <toolbar:toolbaritem xlink:href=".uno:MailMergeSaveDocuments"/> + <toolbar:toolbaritem xlink:href=".uno:MailMergePrintDocuments"/> + <toolbar:toolbaritem xlink:href=".uno:MailMergeEmailDocuments"/> </toolbar:toolbar> diff --git a/sw/uiconfig/swriter/toolbar/mailmerge.xml b/sw/uiconfig/swriter/toolbar/mailmerge.xml index 2ad2e32..7610f2a 100644 --- a/sw/uiconfig/swriter/toolbar/mailmerge.xml +++ b/sw/uiconfig/swriter/toolbar/mailmerge.xml @@ -17,4 +17,7 @@ <toolbar:toolbaritem xlink:href=".uno:MailMergeLastEntry"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:MailMergeCreateDocuments"/> + <toolbar:toolbaritem xlink:href=".uno:MailMergeSaveDocuments"/> + <toolbar:toolbaritem xlink:href=".uno:MailMergePrintDocuments"/> + <toolbar:toolbaritem xlink:href=".uno:MailMergeEmailDocuments"/> </toolbar:toolbar> diff --git a/sw/uiconfig/swxform/toolbar/mailmerge.xml b/sw/uiconfig/swxform/toolbar/mailmerge.xml index 2ad2e32..7610f2a 100644 --- a/sw/uiconfig/swxform/toolbar/mailmerge.xml +++ b/sw/uiconfig/swxform/toolbar/mailmerge.xml @@ -17,4 +17,7 @@ <toolbar:toolbaritem xlink:href=".uno:MailMergeLastEntry"/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:MailMergeCreateDocuments"/> + <toolbar:toolbaritem xlink:href=".uno:MailMergeSaveDocuments"/> + <toolbar:toolbaritem xlink:href=".uno:MailMergePrintDocuments"/> + <toolbar:toolbaritem xlink:href=".uno:MailMergeEmailDocuments"/> </toolbar:toolbar> commit 91f192b4b89cd7634ae1d230df636af5ec8f7121 Author: Jan Holesovsky <ke...@collabora.com> Date: Wed Dec 23 17:43:14 2015 +0100 mailmerge: Killed the 'Save, print or send' page. Introduced the appropriate dialogs instead; they are not accessible from the UI yet, though. Change-Id: I54a4af1980e3caa6683bc4406feeb08142c9b8f5 diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx index 992ddd5..6ded0eb 100644 --- a/sw/qa/extras/mailmerge/mailmerge.cxx +++ b/sw/qa/extras/mailmerge/mailmerge.cxx @@ -234,7 +234,7 @@ protected: DECLARE_MAILMERGE_TEST(TestName, filename, datasource, tablename, true, MMTest) int MMTest::documentStartPageNumber( int document ) const -{ // See SwMailMergeOutputPage::documentStartPageNumber() . +{ // See documentStartPageNumber() . SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxMMComponent.get()); CPPUNIT_ASSERT(pTextDoc); SwWrtShell* shell = pTextDoc->GetDocShell()->GetWrtShell(); @@ -365,8 +365,8 @@ DECLARE_SHELL_MAILMERGE_TEST(testPageBoundariesSimpleMailMerge, "simple-mail-mer { // This is like the test above, but this one uses the create-single-document-containing-everything-generated approach, // and verifies that boundaries of the generated sub-documents are correct inside that document. - // These boundaries are done using "SwMailMergeOutputPage::documentStartPageNumber<number>" UNO bookmarks (see also - // SwMailMergeOutputPage::documentStartPageNumber() ). + // These boundaries are done using "documentStartPageNumber<number>" UNO bookmarks (see also + // documentStartPageNumber() ). executeMailMerge(); // Here getPages() works on the source document, so get pages of the resulting one. SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxMMComponent.get()); diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx index 4cb0ada..9674806 100644 --- a/sw/source/ui/dbui/mailmergewizard.cxx +++ b/sw/source/ui/dbui/mailmergewizard.cxx @@ -55,7 +55,6 @@ SwMailMergeWizard::SwMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rItem m_sLayout( SW_RES( ST_LAYOUT )), m_sPrepareMerge( SW_RES( ST_PREPAREMERGE )), m_sMerge( SW_RES( ST_MERGE )), - m_sOutput( SW_RES( ST_OUTPUT )), m_sFinish( SW_RES( ST_FINISH )), m_nRestartPage( MM_DOCUMENTSELECTPAGE ) { @@ -77,7 +76,6 @@ SwMailMergeWizard::SwMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rItem MM_LAYOUTPAGE, MM_PREPAREMERGEPAGE, MM_MERGEPAGE, - MM_OUTPUTPAGE, WZS_INVALID_STATE ); else @@ -89,7 +87,6 @@ SwMailMergeWizard::SwMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rItem MM_LAYOUTPAGE, MM_PREPAREMERGEPAGE, MM_MERGEPAGE, - MM_OUTPUTPAGE, WZS_INVALID_STATE ); @@ -113,7 +110,6 @@ VclPtr<TabPage> SwMailMergeWizard::createPage(WizardState _nState) case MM_LAYOUTPAGE : pRet = VclPtr<SwMailMergeLayoutPage>::Create(this); break; case MM_PREPAREMERGEPAGE : pRet = VclPtr<SwMailMergePrepareMergePage>::Create(this); break; case MM_MERGEPAGE : pRet = VclPtr<SwMailMergeMergePage>::Create(this); break; - case MM_OUTPUTPAGE : pRet = VclPtr<SwMailMergeOutputPage>::Create(this); break; } OSL_ENSURE(pRet, "no page created in ::createPage"); return pRet; @@ -161,7 +157,7 @@ void SwMailMergeWizard::enterState( WizardState _nState ) case MM_ADDRESSBLOCKPAGE : bEnableNext = m_rConfigItem.GetResultSet().is(); break; - case MM_OUTPUTPAGE : + case MM_MERGEPAGE: bEnableNext = false; break; } @@ -190,8 +186,6 @@ OUString SwMailMergeWizard::getStateDisplayName( WizardState _nState ) const return m_sPrepareMerge; case MM_MERGEPAGE: return m_sMerge; - case MM_OUTPUTPAGE: - return m_sOutput; } return OUString(); } @@ -210,8 +204,6 @@ void SwMailMergeWizard::UpdateRoadmap() MM_PREPAREMERGEPAGE > only active if address data has been selected inactive after preparemerge page MM_MERGEPAGE > only active if address data has been selected - - MM_OUTPUTPAGE > only active if address data has been selected */ // enableState( <page id>, false ); @@ -230,7 +222,7 @@ void SwMailMergeWizard::UpdateRoadmap() bool bEnableOutputTypePage = (nCurPage != MM_DOCUMENTSELECTPAGE) || static_cast<svt::OWizardPage*>(pCurPage)->commitPage( ::svt::WizardTypes::eValidate ); - for(sal_uInt16 nPage = MM_DOCUMENTSELECTPAGE; nPage <= MM_OUTPUTPAGE; ++nPage) + for(sal_uInt16 nPage = MM_DOCUMENTSELECTPAGE; nPage <= MM_MERGEPAGE; ++nPage) { bool bEnable = true; switch(nPage) @@ -256,7 +248,6 @@ void SwMailMergeWizard::UpdateRoadmap() // fall-through case MM_PREPAREMERGEPAGE: case MM_MERGEPAGE: - case MM_OUTPUTPAGE: bEnable = bEnable && !m_bDocumentLoad && bEnableOutputTypePage && m_rConfigItem.GetResultSet().is() && bAddressFieldsConfigured && diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx index 4faa0bc..166851b 100644 --- a/sw/source/ui/dbui/mmoutputpage.cxx +++ b/sw/source/ui/dbui/mmoutputpage.cxx @@ -30,6 +30,8 @@ #include <docsh.hxx> #include <IDocumentDeviceAccess.hxx> #include <hintids.hxx> +#include <swmodule.hxx> + #include <editeng/scripttypeitem.hxx> #include <editeng/langitem.hxx> #include <svl/itemset.hxx> @@ -217,40 +219,91 @@ public: void SetBCC(const OUString& rSet) {m_pBCCED->SetText(rSet);} }; -SwMailMergeOutputPage::SwMailMergeOutputPage(SwMailMergeWizard* _pParent) - : svt::OWizardPage(_pParent, "MMOutputPage", - "modules/swriter/ui/mmoutputpage.ui") - , m_sSaveStartST(SW_RES(ST_SAVESTART)) - , m_sSaveMergedST(SW_RES(ST_SAVEMERGED)) - , m_sPrintST(SW_RES(ST_PRINT)) - , m_sSendMailST(SW_RES(ST_SENDMAIL)) - , m_sDefaultAttachmentST(SW_RES(ST_DEFAULTATTACHMENT)) - , m_sNoSubjectST(SW_RES(ST_NOSUBJECT)) - , m_sConfigureMail(SW_RES(ST_CONFIGUREMAIL)) - , m_bCancelSaving(false) - , m_pWizard(_pParent) - , m_pTempPrinter(nullptr) +SwMMResultSaveDialog::SwMMResultSaveDialog(vcl::Window* pParent) + : SfxModalDialog(pParent, "MMResultSaveDialog", "modules/swriter/ui/mmresultsavedialog.ui") { - get(m_pSaveStartDocRB, "savestarting"); - get(m_pSaveMergedDocRB, "savemerged"); - get(m_pPrintRB, "printmerged"); - get(m_pSendMailRB, "sendmerged"); - get(m_pSeparator, "frame"); - get(m_pSaveStartDocPB, "savestartingdoc"); get(m_pSaveAsOneRB, "singlerb"); get(m_pSaveIndividualRB, "individualrb"); - get(m_pPrintAllRB, "printallrb"); - get(m_pSendAllRB, "sendallrb"); get(m_pFromRB, "fromrb"); get(m_pFromNF, "from-nospin"); get(m_pToFT, "toft"); get(m_pToNF, "to-nospin"); - get(m_pSaveNowPB, "savenow"); + get(m_pOKButton, "ok"); + + m_pSaveAsOneRB->SetClickHdl(LINK(this, SwMMResultSaveDialog, DocumentSelectionHdl_Impl)); + m_pSaveIndividualRB->SetClickHdl(LINK(this, SwMMResultSaveDialog, DocumentSelectionHdl_Impl)); + m_pFromRB->SetClickHdl(LINK(this, SwMMResultSaveDialog, DocumentSelectionHdl_Impl)); + + m_pOKButton->SetClickHdl(LINK(this, SwMMResultSaveDialog, SaveOutputHdl_Impl)); +} + +SwMMResultSaveDialog::~SwMMResultSaveDialog() +{ + disposeOnce(); +} + +void SwMMResultSaveDialog::dispose() +{ + m_pSaveAsOneRB.clear(); + m_pSaveIndividualRB.clear(); + m_pFromRB.clear(); + m_pFromNF.clear(); + m_pToFT.clear(); + m_pToNF.clear(); + m_pOKButton.clear(); + + SfxModalDialog::dispose(); +} + +SwMMResultPrintDialog::SwMMResultPrintDialog(vcl::Window* pParent) + : SfxModalDialog(pParent, "MMResultPrintDialog", "modules/swriter/ui/mmresultprintdialog.ui") + , m_pTempPrinter(nullptr) +{ get(m_pPrinterFT, "printerft"); get(m_pPrinterLB, "printers"); m_pPrinterLB->SetStyle(m_pPrinterLB->GetStyle() | WB_SORT); get(m_pPrinterSettingsPB, "printersettings"); - get(m_pPrintNowPB, "printnow"); + get(m_pPrintAllRB, "printallrb"); + get(m_pFromRB, "fromrb"); + get(m_pFromNF, "from-nospin"); + get(m_pToFT, "toft"); + get(m_pToNF, "to-nospin"); + get(m_pOKButton, "ok"); + + m_pPrinterLB->SetSelectHdl(LINK(this, SwMMResultPrintDialog, PrinterChangeHdl_Impl)); + m_pPrinterSettingsPB->SetClickHdl(LINK(this, SwMMResultPrintDialog, PrinterSetupHdl_Impl)); + + m_pPrintAllRB->SetClickHdl(LINK(this, SwMMResultPrintDialog, DocumentSelectionHdl_Impl)); + m_pFromRB->SetClickHdl(LINK(this, SwMMResultPrintDialog, DocumentSelectionHdl_Impl)); + + m_pOKButton->SetClickHdl(LINK(this, SwMMResultPrintDialog, PrintHdl_Impl)); + + FillInPrinterSettings(); +} + +SwMMResultPrintDialog::~SwMMResultPrintDialog() +{ + disposeOnce(); +} + +void SwMMResultPrintDialog::dispose() +{ + m_pPrinterFT.clear(); + m_pPrinterLB.clear(); + m_pPrinterSettingsPB.clear(); + m_pPrintAllRB.clear(); + m_pFromRB.clear(); + m_pFromNF.clear(); + m_pToFT.clear(); + m_pToNF.clear(); + m_pOKButton.clear(); + + SfxModalDialog::dispose(); +} + +SwMMResultEmailDialog::SwMMResultEmailDialog(vcl::Window* pParent) + : SfxModalDialog(pParent, "MMResultEmailDialog", "modules/swriter/ui/mmresultemaildialog.ui") +{ get(m_pMailToFT, "mailtoft"); get(m_pMailToLB, "mailto"); get(m_pCopyToPB, "copyto"); @@ -261,74 +314,32 @@ SwMailMergeOutputPage::SwMailMergeOutputPage(SwMailMergeWizard* _pParent) get(m_pAttachmentGroup, "attachgroup"); get(m_pAttachmentED, "attach"); get(m_pSendAsPB, "sendassettings"); - get(m_pSendDocumentsPB, "sendnow"); - - SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); - // #i51949# hide e-Mail option if e-Mail is not supported - if(!rConfigItem.IsMailAvailable()) - m_pSendMailRB->Hide(); - - Link<Button*,void> aLink = LINK(this, SwMailMergeOutputPage, OutputTypeHdl_Impl); - m_pSaveStartDocRB->SetClickHdl(aLink); - m_pSaveMergedDocRB->SetClickHdl(aLink); - m_pPrintRB->SetClickHdl(aLink); - m_pSendMailRB->SetClickHdl(aLink); - m_pSaveStartDocRB->Check(); - m_pPrintAllRB->Check(); - m_pSaveAsOneRB->Check(); - m_pSendAllRB->Check(); - - m_pSaveStartDocPB->SetClickHdl(LINK(this, SwMailMergeOutputPage, SaveStartHdl_Impl)); - m_pSaveNowPB->SetClickHdl(LINK(this, SwMailMergeOutputPage, SaveOutputHdl_Impl)); - m_pPrinterLB->SetSelectHdl(LINK(this, SwMailMergeOutputPage, PrinterChangeHdl_Impl)); - m_pPrintNowPB->SetClickHdl(LINK(this, SwMailMergeOutputPage, PrintHdl_Impl)); - m_pPrinterSettingsPB->SetClickHdl(LINK(this, SwMailMergeOutputPage, PrinterSetupHdl_Impl)); - - m_pSendAsPB->SetClickHdl(LINK(this, SwMailMergeOutputPage, SendAsHdl_Impl)), - m_pSendDocumentsPB->SetClickHdl(LINK(this, SwMailMergeOutputPage, SendDocumentsHdl_Impl)), - m_pSendAsLB->SetSelectHdl(LINK(this, SwMailMergeOutputPage, SendTypeHdl_Impl)); - - OutputTypeHdl_Impl(m_pSaveStartDocRB); - - m_pCopyToPB->SetClickHdl(LINK(this, SwMailMergeOutputPage, CopyToHdl_Impl)); - - m_pSaveAsOneRB->SetClickHdl(LINK(this, SwMailMergeOutputPage, DocumentSelectionHdl_Impl)); - m_pSaveIndividualRB->SetClickHdl(LINK(this, SwMailMergeOutputPage, DocumentSelectionHdl_Impl)); - m_pPrintAllRB->SetClickHdl(LINK(this, SwMailMergeOutputPage, DocumentSelectionHdl_Impl)); - m_pSendAllRB->SetClickHdl(LINK(this, SwMailMergeOutputPage, DocumentSelectionHdl_Impl)); - - m_pFromRB->SetClickHdl(LINK(this, SwMailMergeOutputPage, DocumentSelectionHdl_Impl)); - //#i63267# printing might be disabled - m_pPrintRB->Enable(!Application::GetSettings().GetMiscSettings().GetDisablePrinting()); + get(m_pSendAllRB, "sendallrb"); + get(m_pFromRB, "fromrb"); + get(m_pFromNF, "from-nospin"); + get(m_pToFT, "toft"); + get(m_pToNF, "to-nospin"); + get(m_pOKButton, "ok"); + + m_pCopyToPB->SetClickHdl(LINK(this, SwMMResultEmailDialog, CopyToHdl_Impl)); + m_pSendAsPB->SetClickHdl(LINK(this, SwMMResultEmailDialog, SendAsHdl_Impl)); + m_pSendAsLB->SetSelectHdl(LINK(this, SwMMResultEmailDialog, SendTypeHdl_Impl)); + + m_pSendAllRB->SetClickHdl(LINK(this, SwMMResultEmailDialog, DocumentSelectionHdl_Impl)); + m_pFromRB->SetClickHdl(LINK(this, SwMMResultEmailDialog, DocumentSelectionHdl_Impl)); + + m_pOKButton->SetClickHdl(LINK(this, SwMMResultEmailDialog, SendDocumentsHdl_Impl)); + + FillInEmailSettings(); } -SwMailMergeOutputPage::~SwMailMergeOutputPage() +SwMMResultEmailDialog::~SwMMResultEmailDialog() { disposeOnce(); } -void SwMailMergeOutputPage::dispose() +void SwMMResultEmailDialog::dispose() { - m_pTempPrinter.disposeAndClear(); - m_pSaveStartDocRB.clear(); - m_pSaveMergedDocRB.clear(); - m_pPrintRB.clear(); - m_pSendMailRB.clear(); - m_pSeparator.clear(); - m_pSaveStartDocPB.clear(); - m_pSaveAsOneRB.clear(); - m_pSaveIndividualRB.clear(); - m_pPrintAllRB.clear(); - m_pSendAllRB.clear(); - m_pFromRB.clear(); - m_pFromNF.clear(); - m_pToFT.clear(); - m_pToNF.clear(); - m_pSaveNowPB.clear(); - m_pPrinterFT.clear(); - m_pPrinterLB.clear(); - m_pPrinterSettingsPB.clear(); - m_pPrintNowPB.clear(); m_pMailToFT.clear(); m_pMailToLB.clear(); m_pCopyToPB.clear(); @@ -338,13 +349,17 @@ void SwMailMergeOutputPage::dispose() m_pSendAsLB.clear(); m_pAttachmentGroup.clear(); m_pAttachmentED.clear(); - m_pSendAsPB.clear(); - m_pSendDocumentsPB.clear(); - m_pWizard.clear(); - svt::OWizardPage::dispose(); + m_pSendAllRB.clear(); + m_pFromRB.clear(); + m_pFromNF.clear(); + m_pToFT.clear(); + m_pToNF.clear(); + m_pOKButton.clear(); + + SfxModalDialog::dispose(); } -void SwMailMergeOutputPage::ActivatePage() +void SwMMResultPrintDialog::FillInPrinterSettings() { //fill printer ListBox const std::vector<OUString>& rPrinters = Printer::GetPrinterQueues(); @@ -357,20 +372,30 @@ void SwMailMergeOutputPage::ActivatePage() } } - SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); - SwView* pTargetView = rConfigItem.GetTargetView(); + SwView* pView = ::GetActiveView(); + SwMailMergeConfigItem* pConfigItem = pView->GetMailMergeConfigItem(); + assert(pConfigItem); + + SwView* pTargetView = pConfigItem->GetTargetView(); OSL_ENSURE(pTargetView, "no target view exists"); if(pTargetView) { SfxPrinter* pPrinter = pTargetView->GetWrtShell().getIDocumentDeviceAccess().getPrinter( true ); - m_pPrinterLB->SelectEntry( pPrinter->GetName() ); - m_pToNF->SetValue( rConfigItem.GetMergedDocumentCount() ); - m_pToNF->SetMax( rConfigItem.GetMergedDocumentCount() ); + m_pPrinterLB->SelectEntry(pPrinter->GetName()); + m_pToNF->SetValue(pConfigItem->GetMergedDocumentCount()); + m_pToNF->SetMax(pConfigItem->GetMergedDocumentCount()); } - m_pPrinterLB->SelectEntry( rConfigItem.GetSelectedPrinter() ); + m_pPrinterLB->SelectEntry(pConfigItem->GetSelectedPrinter()); +} - SwView* pSourceView = rConfigItem.GetSourceView(); +void SwMMResultEmailDialog::FillInEmailSettings() +{ + SwView* pView = ::GetActiveView(); + SwMailMergeConfigItem* pConfigItem = pView->GetMailMergeConfigItem(); + assert(pConfigItem); + + SwView* pSourceView = pConfigItem->GetSourceView(); OSL_ENSURE(pSourceView, "no source view exists"); if(pSourceView) { @@ -382,105 +407,7 @@ void SwMailMergeOutputPage::ActivatePage() INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET )); } } -} - -bool SwMailMergeOutputPage::canAdvance() const -{ - return false; -} - -IMPL_LINK_TYPED(SwMailMergeOutputPage, OutputTypeHdl_Impl, Button*, pButton, void) -{ - vcl::Window* aControls[] = - { - m_pSaveStartDocPB, - m_pSaveAsOneRB, m_pSaveIndividualRB, - m_pFromRB, m_pFromNF, m_pToFT, m_pToNF, - m_pSaveNowPB, - m_pPrinterFT, m_pPrinterLB, m_pPrinterSettingsPB, m_pPrintAllRB, - m_pPrintNowPB, - m_pMailToFT, m_pMailToLB, m_pCopyToPB, - m_pSubjectFT, m_pSubjectED, - m_pSendAsFT, m_pSendAsLB, m_pSendAsPB, - m_pAttachmentGroup, - m_pSendAllRB, m_pSendDocumentsPB, - nullptr - }; - SetUpdateMode(true); - vcl::Window** pControl = aControls; - do - { - (*pControl)->Show(false); - - } while(*(++pControl)); - - if (m_pSaveStartDocRB == pButton) - { - m_pSaveStartDocPB->Show(); - m_pSeparator->set_label(m_sSaveStartST); - - } - else if (m_pSaveMergedDocRB == pButton) - { - Control* aSaveMergedControls[] = - { - m_pSaveAsOneRB, m_pSaveIndividualRB, - m_pFromRB, m_pFromNF, m_pToFT, m_pToNF, - m_pSaveNowPB, - nullptr - }; - Control** pSaveMergeControl = aSaveMergedControls; - do - { - (*pSaveMergeControl)->Show(); - - } while(*(++pSaveMergeControl)); - if(!m_pFromRB->IsChecked() && !m_pSaveAsOneRB->IsChecked()) - { - m_pSaveIndividualRB->Check(); - } - m_pSeparator->set_label(m_sSaveMergedST); - } - else if (m_pPrintRB == pButton) - { - Control* aPrintControls[] = - { - m_pFromRB, m_pFromNF, m_pToFT, m_pToNF, - m_pPrinterFT, m_pPrinterLB, m_pPrinterSettingsPB, m_pPrintAllRB, - m_pPrintNowPB, - nullptr - }; - Control** pPrinterControl = aPrintControls; - do - { - (*pPrinterControl)->Show(); - - } while(*(++pPrinterControl)); - if(!m_pFromRB->IsChecked()) - m_pPrintAllRB->Check(); - - m_pSeparator->set_label(m_sPrintST); - } - else - { - vcl::Window* aMailControls[] = - { - m_pFromRB, m_pFromNF, m_pToFT, m_pToNF, - m_pMailToFT, m_pMailToLB, m_pCopyToPB, - m_pSubjectFT, m_pSubjectED, - m_pSendAsFT, m_pSendAsLB, m_pSendAsPB, - m_pAttachmentGroup, - m_pSendAllRB, m_pSendDocumentsPB, nullptr - }; - vcl::Window** pMailControl = aMailControls; - do - { - (*pMailControl)->Show(); - - } while(*(++pMailControl)); - if(!m_pFromRB->IsChecked()) - m_pSendAllRB->Check(); if(m_pAttachmentED->GetText().isEmpty()) { OUString sAttach( m_sDefaultAttachmentST ); @@ -490,13 +417,11 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, OutputTypeHdl_Impl, Button*, pButton, voi m_pAttachmentED->SetText( sAttach ); } - m_pSeparator->set_label(m_sSendMailST); //fill mail address ListBox if(!m_pMailToLB->GetEntryCount()) { - SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); //select first column - uno::Reference< sdbcx::XColumnsSupplier > xColsSupp( rConfigItem.GetResultSet(), uno::UNO_QUERY); + uno::Reference< sdbcx::XColumnsSupplier > xColsSupp(pConfigItem->GetResultSet(), uno::UNO_QUERY); //get the name of the actual columns uno::Reference < container::XNameAccess> xColAccess = xColsSupp.is() ? xColsSupp->getColumns() : nullptr; uno::Sequence< OUString > aFields; @@ -508,10 +433,9 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, OutputTypeHdl_Impl, Button*, pButton, voi m_pMailToLB->SelectEntryPos(0); // then select the right one - may not be available - const ResStringArray& rHeaders = rConfigItem.GetDefaultAddressHeaders(); + const ResStringArray& rHeaders = pConfigItem->GetDefaultAddressHeaders(); OUString sEMailColumn = rHeaders.GetString( MM_PART_E_MAIL ); - Sequence< OUString> aAssignment = - rConfigItem.GetColumnAssignment( rConfigItem.GetCurrentDBData() ); + Sequence< OUString> aAssignment = pConfigItem->GetColumnAssignment(pConfigItem->GetCurrentDBData()); if(aAssignment.getLength() > MM_PART_E_MAIL && !aAssignment[MM_PART_E_MAIL].isEmpty()) sEMailColumn = aAssignment[MM_PART_E_MAIL]; m_pMailToLB->SelectEntry(sEMailColumn); @@ -519,13 +443,17 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, OutputTypeHdl_Impl, Button*, pButton, voi m_pSendAsLB->SelectEntryPos(3); SendTypeHdl_Impl(*m_pSendAsLB); } - } - m_pFromRB->GetClickHdl().Call(m_pFromRB->IsChecked() ? m_pFromRB.get() : nullptr); +} - SetUpdateMode(false); +IMPL_LINK_TYPED(SwMMResultSaveDialog, DocumentSelectionHdl_Impl, Button*, pButton, void) +{ + bool bEnableFromTo = pButton == m_pFromRB; + m_pFromNF->Enable(bEnableFromTo); + m_pToFT->Enable(bEnableFromTo); + m_pToNF->Enable(bEnableFromTo); } -IMPL_LINK_TYPED(SwMailMergeOutputPage, DocumentSelectionHdl_Impl, Button*, pButton, void) +IMPL_LINK_TYPED(SwMMResultPrintDialog, DocumentSelectionHdl_Impl, Button*, pButton, void) { bool bEnableFromTo = pButton == m_pFromRB; m_pFromNF->Enable(bEnableFromTo); @@ -533,7 +461,15 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, DocumentSelectionHdl_Impl, Button*, pButt m_pToNF->Enable(bEnableFromTo); } -IMPL_LINK_TYPED(SwMailMergeOutputPage, CopyToHdl_Impl, Button*, pButton, void) +IMPL_LINK_TYPED(SwMMResultEmailDialog, DocumentSelectionHdl_Impl, Button*, pButton, void) +{ + bool bEnableFromTo = pButton == m_pFromRB; + m_pFromNF->Enable(bEnableFromTo); + m_pToFT->Enable(bEnableFromTo); + m_pToNF->Enable(bEnableFromTo); +} + +IMPL_LINK_TYPED(SwMMResultEmailDialog, CopyToHdl_Impl, Button*, pButton, void) { ScopedVclPtrInstance< SwCopyToDialog > pDlg(pButton); pDlg->SetCC(m_sCC ); @@ -545,57 +481,19 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, CopyToHdl_Impl, Button*, pButton, void) } } -IMPL_LINK_TYPED(SwMailMergeOutputPage, SaveStartHdl_Impl, Button*, pButton, void) -{ - SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); - SwView* pSourceView = rConfigItem.GetSourceView(); - OSL_ENSURE( pSourceView, "source view missing"); - if(pSourceView) - { - SfxViewFrame* pSourceViewFrame = pSourceView->GetViewFrame(); - uno::Reference< frame::XFrame > xFrame = - pSourceViewFrame->GetFrame().GetFrameInterface(); - xFrame->getContainerWindow()->setVisible(sal_True); - pSourceViewFrame->GetDispatcher()->Execute(SID_SAVEDOC, SfxCallMode::SYNCHRON); - xFrame->getContainerWindow()->setVisible(sal_False); - SwDocShell* pDocShell = pSourceView->GetDocShell(); - //if the document has been saved its URL has to be stored for - // later use and it can be closed now - if(pDocShell->HasName() && !pDocShell->IsModified()) - { - INetURLObject aURL = pDocShell->GetMedium()->GetURLObject(); - //update the attachment name - if(m_pAttachmentED->GetText().isEmpty()) - { - if ( pDocShell->HasName() ) - { - m_pAttachmentED->SetText(aURL.getName( - INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET )); - } - } - - rConfigItem.AddSavedDocument( - aURL.GetMainURL(INetURLObject::DECODE_TO_IURI)); - pButton->Enable(false); - m_pWizard->enableButtons(WizardButtonFlags::FINISH, true); - pButton->Enable(false); - - } - } -} - -IMPL_LINK_NOARG_TYPED(SwMailMergeOutputPage, SaveCancelHdl_Impl, Button*, void) +IMPL_LINK_NOARG_TYPED(SwMMResultSaveDialog, SaveCancelHdl_Impl, Button*, void) { m_bCancelSaving = true; } -int SwMailMergeOutputPage::documentStartPageNumber( int document ) const +namespace { + +int documentStartPageNumber(SwMailMergeConfigItem* pConfigItem, int document) { - SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); - SwView* pTargetView = rConfigItem.GetTargetView(); + SwView* pTargetView = pConfigItem->GetTargetView(); assert( pTargetView ); SwCursorShell& shell = pTargetView->GetWrtShell(); - const SwDocMergeInfo& info = rConfigItem.GetDocumentMergeInfo( document ); + const SwDocMergeInfo& info = pConfigItem->GetDocumentMergeInfo(document); sal_uInt16 page, dummy; shell.Push(); shell.GotoMark( info.startPageInTarget ); @@ -604,16 +502,15 @@ int SwMailMergeOutputPage::documentStartPageNumber( int document ) const return page; } -int SwMailMergeOutputPage::documentEndPageNumber( int document ) const +int documentEndPageNumber(SwMailMergeConfigItem* pConfigItem, int document) { - SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); - SwView* pTargetView = rConfigItem.GetTargetView(); + SwView* pTargetView = pConfigItem->GetTargetView(); assert( pTargetView ); SwWrtShell& shell = pTargetView->GetWrtShell(); - if( document < int( rConfigItem.GetMergedDocumentCount()) - 1 ) + if (document < int(pConfigItem->GetMergedDocumentCount()) - 1) { // Go to the page before the starting page of the next merged document. - const SwDocMergeInfo& info = rConfigItem.GetDocumentMergeInfo( document + 1 ); + const SwDocMergeInfo& info = pConfigItem->GetDocumentMergeInfo( document + 1 ); sal_uInt16 page, dummy; shell.Push(); shell.GotoMark( info.startPageInTarget ); @@ -633,10 +530,15 @@ int SwMailMergeOutputPage::documentEndPageNumber( int document ) const } } -IMPL_LINK_TYPED(SwMailMergeOutputPage, SaveOutputHdl_Impl, Button*, pButton, void) +} // anonymous namespace + +IMPL_LINK_TYPED(SwMMResultSaveDialog, SaveOutputHdl_Impl, Button*, pButton, void) { - SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); - SwView* pTargetView = rConfigItem.GetTargetView(); + SwView* pView = ::GetActiveView(); + SwMailMergeConfigItem* pConfigItem = pView->GetMailMergeConfigItem(); + assert(pConfigItem); + + SwView* pTargetView = pConfigItem->GetTargetView(); OSL_ENSURE(pTargetView, "no target view exists"); if(!pTargetView) return; @@ -679,14 +581,14 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, SaveOutputHdl_Impl, Button*, pButton, voi if(m_pSaveIndividualRB->IsChecked()) { nBegin = 0; - nEnd = rConfigItem.GetMergedDocumentCount(); + nEnd = pConfigItem->GetMergedDocumentCount(); } else { nBegin = static_cast< sal_Int32 >(m_pFromNF->GetValue() - 1); nEnd = static_cast< sal_Int32 >(m_pToNF->GetValue()); - if(nEnd > rConfigItem.GetMergedDocumentCount()) - nEnd = rConfigItem.GetMergedDocumentCount(); + if(nEnd > pConfigItem->GetMergedDocumentCount()) + nEnd = pConfigItem->GetMergedDocumentCount(); } OUString sFilter; OUString sPath = SwMailMergeHelper::CallSaveAsDialog(sFilter); @@ -724,14 +626,13 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, SaveOutputHdl_Impl, Button*, pButton, voi ErrorHandler::HandleError( nErrorCode ); } - SwView* pSourceView = rConfigItem.GetSourceView(); + SwView* pSourceView = pConfigItem->GetSourceView(); ScopedVclPtrInstance< PrintMonitor > aSaveMonitor(this, false, PrintMonitor::MONITOR_TYPE_SAVE); aSaveMonitor->m_pDocName->SetText(pSourceView->GetDocShell()->GetTitle(22)); - aSaveMonitor->SetCancelHdl(LINK(this, SwMailMergeOutputPage, SaveCancelHdl_Impl)); + aSaveMonitor->SetCancelHdl(LINK(this, SwMMResultSaveDialog, SaveCancelHdl_Impl)); aSaveMonitor->m_pPrinter->SetText( INetURLObject( sPath ).getFSysPath( INetURLObject::FSYS_DETECT ) ); m_bCancelSaving = false; aSaveMonitor->Show(); - m_pWizard->enableButtons(WizardButtonFlags::CANCEL, false); for(sal_uInt32 nDoc = nBegin; nDoc < nEnd && !m_bCancelSaving; ++nDoc) { @@ -765,7 +666,7 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, SaveOutputHdl_Impl, Button*, pButton, voi pTempView->GetDocShell()->GetDoc()->ReplaceDocumentProperties( *pTargetView->GetDocShell()->GetDoc(), true ); pTargetView->GetWrtShell().PastePages(pTempView->GetWrtShell(), - documentStartPageNumber( nDoc ), documentEndPageNumber( nDoc )); + documentStartPageNumber(pConfigItem, nDoc), documentEndPageNumber(pConfigItem, nDoc)); pTargetView->GetWrtShell().EndAction(); //then save it OUString sOutPath = aURL.GetMainURL(INetURLObject::DECODE_TO_IURI); @@ -809,13 +710,15 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, SaveOutputHdl_Impl, Button*, pButton, voi } ::osl::File::remove( sTargetTempURL ); } - m_pWizard->enableButtons(WizardButtonFlags::CANCEL, true); - m_pWizard->enableButtons(WizardButtonFlags::FINISH, true); } -IMPL_LINK_TYPED(SwMailMergeOutputPage, PrinterChangeHdl_Impl, ListBox&, rBox, void) +IMPL_LINK_TYPED(SwMMResultPrintDialog, PrinterChangeHdl_Impl, ListBox&, rBox, void) { - SwView *const pTargetView = m_pWizard->GetConfigItem().GetTargetView(); + SwView* pView = ::GetActiveView(); + SwMailMergeConfigItem* pConfigItem = pView->GetMailMergeConfigItem(); + assert(pConfigItem); + + SwView *const pTargetView = pConfigItem->GetTargetView(); SfxPrinter *const pDocumentPrinter = pTargetView->GetWrtShell() .getIDocumentDeviceAccess().getPrinter(true); if (pDocumentPrinter && rBox.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND) @@ -851,38 +754,42 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, PrinterChangeHdl_Impl, ListBox&, rBox, vo } else m_pPrinterSettingsPB->Disable(); - m_pWizard->GetConfigItem().SetSelectedPrinter( rBox.GetSelectEntry() ); + + pConfigItem->SetSelectedPrinter(rBox.GetSelectEntry()); } -IMPL_LINK_NOARG_TYPED(SwMailMergeOutputPage, PrintHdl_Impl, Button*, void) +IMPL_LINK_NOARG_TYPED(SwMMResultPrintDialog, PrintHdl_Impl, Button*, void) { - SwView* pTargetView = m_pWizard->GetConfigItem().GetTargetView(); + SwView* pView = ::GetActiveView(); + SwMailMergeConfigItem* pConfigItem = pView->GetMailMergeConfigItem(); + assert(pConfigItem); + + SwView* pTargetView = pConfigItem->GetTargetView(); OSL_ENSURE(pTargetView, "no target view exists"); if(!pTargetView) return; sal_uInt32 nBegin = 0; sal_uInt32 nEnd = 0; - SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); if(m_pPrintAllRB->IsChecked()) { nBegin = 0; - nEnd = rConfigItem.GetMergedDocumentCount(); + nEnd = pConfigItem->GetMergedDocumentCount(); } else { nBegin = static_cast< sal_Int32 >(m_pFromNF->GetValue() - 1); nEnd = static_cast< sal_Int32 >(m_pToNF->GetValue()); - if(nEnd > rConfigItem.GetMergedDocumentCount()) - nEnd = rConfigItem.GetMergedDocumentCount(); + if(nEnd > pConfigItem->GetMergedDocumentCount()) + nEnd = pConfigItem->GetMergedDocumentCount(); } - rConfigItem.SetPrintRange( (sal_uInt16)nBegin, (sal_uInt16)nEnd ); + pConfigItem->SetPrintRange((sal_uInt16)nBegin, (sal_uInt16)nEnd); - OUString sPages(OUString::number( documentStartPageNumber( nBegin ))); + OUString sPages(OUString::number(documentStartPageNumber(pConfigItem, nBegin))); sPages += " - "; - sPages += OUString::number( documentEndPageNumber( nEnd - 1 )); + sPages += OUString::number(documentEndPageNumber(pConfigItem, nEnd - 1)); - pTargetView->SetMailMergeConfigItem(&rConfigItem, 0, false); + pTargetView->SetMailMergeConfigItem(pConfigItem, 0, false); if(m_pTempPrinter) { SfxPrinter *const pDocumentPrinter = pTargetView->GetWrtShell() @@ -895,7 +802,6 @@ IMPL_LINK_NOARG_TYPED(SwMailMergeOutputPage, PrintHdl_Impl, Button*, void) SfxObjectShell* pObjSh = pTargetView->GetViewFrame()->GetObjectShell(); SfxGetpApp()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE), pObjSh)); SfxBoolItem aMergeSilent(SID_SILENT, false); - m_pWizard->enableButtons(WizardButtonFlags::CANCEL, false); uno::Sequence < beans::PropertyValue > aProps( 2 ); aProps[0]. Name = "MonitorVisible"; @@ -905,12 +811,9 @@ IMPL_LINK_NOARG_TYPED(SwMailMergeOutputPage, PrintHdl_Impl, Button*, void) pTargetView->ExecPrint( aProps, false, true ); SfxGetpApp()->NotifyEvent(SfxEventHint(SW_EVENT_MAIL_MERGE_END, SwDocShell::GetEventName(STR_SW_EVENT_MAIL_MERGE_END), pObjSh)); - - m_pWizard->enableButtons(WizardButtonFlags::CANCEL, true); - m_pWizard->enableButtons(WizardButtonFlags::FINISH, true); } -IMPL_LINK_TYPED(SwMailMergeOutputPage, PrinterSetupHdl_Impl, Button*, pButton, void) +IMPL_LINK_TYPED(SwMMResultPrintDialog, PrinterSetupHdl_Impl, Button*, pButton, void) { if( !m_pTempPrinter ) PrinterChangeHdl_Impl(*m_pPrinterLB); @@ -918,7 +821,7 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, PrinterSetupHdl_Impl, Button*, pButton, v m_pTempPrinter->Setup(pButton); } -IMPL_LINK_TYPED(SwMailMergeOutputPage, SendTypeHdl_Impl, ListBox&, rBox, void) +IMPL_LINK_TYPED(SwMMResultEmailDialog, SendTypeHdl_Impl, ListBox&, rBox, void) { sal_uLong nDocType = reinterpret_cast<sal_uLong>(rBox.GetSelectEntryData()); bool bEnable = MM_DOCTYPE_HTML != nDocType && MM_DOCTYPE_TEXT != nDocType; @@ -943,29 +846,34 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, SendTypeHdl_Impl, ListBox&, rBox, void) } } -IMPL_LINK_TYPED(SwMailMergeOutputPage, SendAsHdl_Impl, Button*, pButton, void) +IMPL_LINK_TYPED(SwMMResultEmailDialog, SendAsHdl_Impl, Button*, /*pButton*/, void) { + /* TODO FIXME this currently tries to connect to the wizard, fix that, or + instantiate it when needed or something VclPtr<SwMailBodyDialog> pDlg = VclPtr<SwMailBodyDialog>::Create(pButton, m_pWizard); pDlg->SetBody(m_sBody); if(RET_OK == pDlg->Execute()) { m_sBody = pDlg->GetBody(); } + */ } // Send documents as e-mail -IMPL_LINK_TYPED(SwMailMergeOutputPage, SendDocumentsHdl_Impl, Button*, pButton, void) +IMPL_LINK_TYPED(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, void) { - SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); + SwView* pView = ::GetActiveView(); + SwMailMergeConfigItem* pConfigItem = pView->GetMailMergeConfigItem(); + assert(pConfigItem); //get the composed document - SwView* pTargetView = rConfigItem.GetTargetView(); + SwView* pTargetView = pConfigItem->GetTargetView(); OSL_ENSURE(pTargetView, "no target view exists"); if(!pTargetView) return; - if(rConfigItem.GetMailServer().isEmpty() || - !SwMailMergeHelper::CheckMailAddress(rConfigItem.GetMailAddress()) ) + if(pConfigItem->GetMailServer().isEmpty() || + !SwMailMergeHelper::CheckMailAddress(pConfigItem->GetMailAddress()) ) { ScopedVclPtrInstance< QueryBox > aQuery(pButton, WB_YES_NO_CANCEL, m_sConfigureMail); sal_uInt16 nRet = aQuery->Execute(); @@ -985,14 +893,14 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, SendDocumentsHdl_Impl, Button*, pButton, if(m_pSendAllRB->IsChecked()) { nBegin = 0; - nEnd = rConfigItem.GetMergedDocumentCount(); + nEnd = pConfigItem->GetMergedDocumentCount(); } else { nBegin = static_cast< sal_Int32 >(m_pFromNF->GetValue() - 1); nEnd = static_cast< sal_Int32 >(m_pToNF->GetValue()); - if(nEnd > rConfigItem.GetMergedDocumentCount()) - nEnd = rConfigItem.GetMergedDocumentCount(); + if(nEnd > pConfigItem->GetMergedDocumentCount()) + nEnd = pConfigItem->GetMergedDocumentCount(); } bool bAsBody = false; rtl_TextEncoding eEncoding = ::osl_getThreadTextEncoding(); @@ -1097,7 +1005,7 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, SendDocumentsHdl_Impl, Button*, pButton, SfxStringItem aFilterName( SID_FILTER_NAME, pSfxFlt->GetFilterName() ); OUString sEMailColumn = m_pMailToLB->GetSelectEntry(); OSL_ENSURE( !sEMailColumn.isEmpty(), "No email column selected"); - Reference< sdbcx::XColumnsSupplier > xColsSupp( rConfigItem.GetResultSet(), UNO_QUERY); + Reference< sdbcx::XColumnsSupplier > xColsSupp( pConfigItem->GetResultSet(), UNO_QUERY); Reference < container::XNameAccess> xColAccess = xColsSupp.is() ? xColsSupp->getColumns() : nullptr; if(sEMailColumn.isEmpty() || !xColAccess.is() || !xColAccess->hasByName(sEMailColumn)) return; @@ -1129,7 +1037,7 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, SendDocumentsHdl_Impl, Button*, pButton, xStore->storeToURL( sTargetTempURL, aValues ); //create the send dialog - VclPtr<SwSendMailDialog> pDlg = VclPtr<SwSendMailDialog>::Create( pButton, rConfigItem ); + VclPtr<SwSendMailDialog> pDlg = VclPtr<SwSendMailDialog>::Create(pButton, *pConfigItem); pDlg->SetDocumentCount( nEnd ); pDlg->ShowDialog(); //help to force painting the dialog @@ -1139,8 +1047,7 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, SendDocumentsHdl_Impl, Button*, pButton, Application::Reschedule(); for(sal_uInt32 nDoc = nBegin; nDoc < nEnd; ++nDoc) { - m_pWizard->EnterWait(); - SwDocMergeInfo& rInfo = rConfigItem.GetDocumentMergeInfo(nDoc); + SwDocMergeInfo& rInfo = pConfigItem->GetDocumentMergeInfo(nDoc); //now extract a document from the target document // the shell will be closed at the end, but it is more safe to use SfxObjectShellLock here @@ -1161,7 +1068,7 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, SendDocumentsHdl_Impl, Button*, pButton, pTempView->GetDocShell()->GetDoc()->ReplaceDefaults( *pTargetView->GetDocShell()->GetDoc()); pTempView->GetDocShell()->GetDoc()->ReplaceDocumentProperties( *pTargetView->GetDocShell()->GetDoc(), true ); pTargetView->GetWrtShell().PastePages(pTempView->GetWrtShell(), - documentStartPageNumber( nDoc ), documentEndPageNumber( nDoc )); + documentStartPageNumber(pConfigItem, nDoc), documentEndPageNumber(pConfigItem, nDoc)); pTargetView->GetWrtShell().EndAction(); //then save it @@ -1186,7 +1093,7 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, SendDocumentsHdl_Impl, Button*, pButton, } xTempDocShell->DoClose(); - sal_Int32 nTarget = rConfigItem.MoveResultSet(rInfo.nDBRow); + sal_Int32 nTarget = pConfigItem->MoveResultSet(rInfo.nDBRow); OSL_ENSURE( nTarget == rInfo.nDBRow, "row of current document could not be selected"); (void)nTarget; OSL_ENSURE( !sEMailColumn.isEmpty(), "No email column selected"); @@ -1235,30 +1142,30 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, SendDocumentsHdl_Impl, Button*, pButton, aDesc.sAttachmentName = sAttachment; aDesc.sMimeType = sMimeType; - if(rConfigItem.IsGreetingLine(true)) + if(pConfigItem->IsGreetingLine(true)) { - OUString sNameColumn = rConfigItem.GetAssignedColumn(MM_PART_LASTNAME); + OUString sNameColumn = pConfigItem->GetAssignedColumn(MM_PART_LASTNAME); OUString sName = lcl_GetColumnValueOf(sNameColumn, xColAccess); OUString sGreeting; - if(!sName.isEmpty() && rConfigItem.IsIndividualGreeting(true)) + if(!sName.isEmpty() && pConfigItem->IsIndividualGreeting(true)) { - OUString sGenderColumn = rConfigItem.GetAssignedColumn(MM_PART_GENDER); - const OUString& sFemaleValue = rConfigItem.GetFemaleGenderValue(); + OUString sGenderColumn = pConfigItem->GetAssignedColumn(MM_PART_GENDER); + const OUString& sFemaleValue = pConfigItem->GetFemaleGenderValue(); OUString sGenderValue = lcl_GetColumnValueOf(sGenderColumn, xColAccess); SwMailMergeConfigItem::Gender eGenderType = sGenderValue == sFemaleValue ? SwMailMergeConfigItem::FEMALE : SwMailMergeConfigItem::MALE; sGreeting = SwAddressPreview::FillData( - rConfigItem.GetGreetings(eGenderType) - [rConfigItem.GetCurrentGreeting(eGenderType)], - rConfigItem); + pConfigItem->GetGreetings(eGenderType) + [pConfigItem->GetCurrentGreeting(eGenderType)], + *pConfigItem); } else { sGreeting = - rConfigItem.GetGreetings(SwMailMergeConfigItem::NEUTRAL) - [rConfigItem.GetCurrentGreeting(SwMailMergeConfigItem::NEUTRAL)]; + pConfigItem->GetGreetings(SwMailMergeConfigItem::NEUTRAL) + [pConfigItem->GetCurrentGreeting(SwMailMergeConfigItem::NEUTRAL)]; } sGreeting += "\n"; @@ -1284,15 +1191,11 @@ IMPL_LINK_TYPED(SwMailMergeOutputPage, SendDocumentsHdl_Impl, Button*, pButton, //stop creating of data when dialog has been closed if(!pDlg->IsVisible()) { - m_pWizard->LeaveWait(); break; } - m_pWizard->LeaveWait(); } pDlg->EnableDesctruction(); ::osl::File::remove( sTargetTempURL ); - - m_pWizard->enableButtons(WizardButtonFlags::FINISH, true); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dbui/mmoutputpage.hxx b/sw/source/ui/dbui/mmoutputpage.hxx index 5657543..521bc4d 100644 --- a/sw/source/ui/dbui/mmoutputpage.hxx +++ b/sw/source/ui/dbui/mmoutputpage.hxx @@ -43,91 +43,111 @@ namespace com{ namespace sun{ namespace star{ } }}} -class SwMailMergeOutputPage : public svt::OWizardPage +/// Dialog implementing the saving as of the result document. +class SwMMResultSaveDialog : public SfxModalDialog { - VclPtr<RadioButton> m_pSaveStartDocRB; - VclPtr<RadioButton> m_pSaveMergedDocRB; - VclPtr<RadioButton> m_pPrintRB; - VclPtr<RadioButton> m_pSendMailRB; - - VclPtr<VclFrame> m_pSeparator; - - VclPtr<PushButton> m_pSaveStartDocPB; - VclPtr<RadioButton> m_pSaveAsOneRB; VclPtr<RadioButton> m_pSaveIndividualRB; - VclPtr<RadioButton> m_pPrintAllRB; //has to be here for tab control reasons - VclPtr<RadioButton> m_pSendAllRB; //has to be here for tab control reasons - //this group is used in save and print VclPtr<RadioButton> m_pFromRB; VclPtr<NumericField> m_pFromNF; VclPtr<FixedText> m_pToFT; VclPtr<NumericField> m_pToNF; - VclPtr<PushButton> m_pSaveNowPB; + VclPtr<Button> m_pOKButton; + + bool m_bCancelSaving; + + DECL_LINK_TYPED(SaveOutputHdl_Impl, Button* , void); + DECL_LINK_TYPED(SaveCancelHdl_Impl, Button*, void); + DECL_LINK_TYPED(DocumentSelectionHdl_Impl, Button*, void); + +public: + SwMMResultSaveDialog(vcl::Window* pParent = nullptr); + virtual ~SwMMResultSaveDialog(); + + virtual void dispose() override; +}; + +/// Dialog implementing the printing of the result document. +class SwMMResultPrintDialog : public SfxModalDialog +{ VclPtr<FixedText> m_pPrinterFT; VclPtr<ListBox> m_pPrinterLB; VclPtr<PushButton> m_pPrinterSettingsPB; - VclPtr<PushButton> m_pPrintNowPB; + VclPtr<RadioButton> m_pPrintAllRB; + + VclPtr<RadioButton> m_pFromRB; + VclPtr<NumericField> m_pFromNF; + VclPtr<FixedText> m_pToFT; + VclPtr<NumericField> m_pToNF; + + VclPtr<Button> m_pOKButton; + + VclPtr<Printer> m_pTempPrinter; + + DECL_LINK_TYPED(PrinterChangeHdl_Impl, ListBox&,void ); + DECL_LINK_TYPED(PrintHdl_Impl, Button*, void); + DECL_LINK_TYPED(PrinterSetupHdl_Impl, Button*, void ); + DECL_LINK_TYPED(DocumentSelectionHdl_Impl, Button*, void); + + void FillInPrinterSettings(); + +public: + SwMMResultPrintDialog(vcl::Window* pParent = nullptr); + virtual ~SwMMResultPrintDialog(); + + virtual void dispose() override; +}; + +/// Dialog implementing the sending as email of the result document. +class SwMMResultEmailDialog : public SfxModalDialog +{ VclPtr<FixedText> m_pMailToFT; VclPtr<ListBox> m_pMailToLB; VclPtr<PushButton> m_pCopyToPB; + VclPtr<FixedText> m_pSubjectFT; VclPtr<Edit> m_pSubjectED; + VclPtr<FixedText> m_pSendAsFT; VclPtr<ListBox> m_pSendAsLB; + VclPtr<PushButton> m_pSendAsPB; + VclPtr<VclContainer> m_pAttachmentGroup; VclPtr<Edit> m_pAttachmentED; - VclPtr<PushButton> m_pSendAsPB; - VclPtr<PushButton> m_pSendDocumentsPB; - //some FixedLine labels - OUString m_sSaveStartST; - OUString m_sSaveMergedST; - OUString m_sPrintST; - OUString m_sSendMailST; + VclPtr<RadioButton> m_pSendAllRB; + + VclPtr<RadioButton> m_pFromRB; + VclPtr<NumericField> m_pFromNF; + VclPtr<FixedText> m_pToFT; + VclPtr<NumericField> m_pToNF; + + VclPtr<Button> m_pOKButton; - //misc strings OUString m_sDefaultAttachmentST; OUString m_sNoSubjectST; OUString m_sConfigureMail; - OUString m_sBody; - - bool m_bCancelSaving; - - VclPtr<SwMailMergeWizard> m_pWizard; - - //some dialog data - VclPtr<Printer> m_pTempPrinter; OUString m_sCC; OUString m_sBCC; - DECL_LINK_TYPED(OutputTypeHdl_Impl, Button*, void); + OUString m_sBody; + DECL_LINK_TYPED(CopyToHdl_Impl, Button*, void); - DECL_LINK_TYPED(SaveStartHdl_Impl, Button*, void ); - DECL_LINK_TYPED(SaveOutputHdl_Impl, Button* , void); - DECL_LINK_TYPED(PrinterChangeHdl_Impl, ListBox&,void ); - DECL_LINK_TYPED(PrintHdl_Impl, Button*, void); - DECL_LINK_TYPED(PrinterSetupHdl_Impl, Button*, void ); DECL_LINK_TYPED(SendTypeHdl_Impl, ListBox&, void); DECL_LINK_TYPED(SendAsHdl_Impl, Button*, void); DECL_LINK_TYPED(SendDocumentsHdl_Impl, Button*, void); DECL_LINK_TYPED(DocumentSelectionHdl_Impl, Button*, void); - DECL_LINK_TYPED(SaveCancelHdl_Impl, Button*, void); - int documentStartPageNumber( int document ) const; - int documentEndPageNumber( int document ) const; + void FillInEmailSettings(); -protected: - virtual bool canAdvance() const override; - virtual void ActivatePage() override; public: - SwMailMergeOutputPage( SwMailMergeWizard* _pParent); - virtual ~SwMailMergeOutputPage(); - virtual void dispose() override; + SwMMResultEmailDialog(vcl::Window* pParent = nullptr); + virtual ~SwMMResultEmailDialog(); + virtual void dispose() override; }; struct SwMailDescriptor diff --git a/sw/source/uibase/inc/mailmergewizard.hxx b/sw/source/uibase/inc/mailmergewizard.hxx index 1c198c4..a8d6e54 100644 --- a/sw/source/uibase/inc/mailmergewizard.hxx +++ b/sw/source/uibase/inc/mailmergewizard.hxx @@ -32,7 +32,6 @@ class SwMailMergeConfigItem; #define MM_LAYOUTPAGE 4 #define MM_PREPAREMERGEPAGE 5 #define MM_MERGEPAGE 6 -#define MM_OUTPUTPAGE 7 class SwMailMergeWizard : public ::svt::RoadmapWizard { diff --git a/sw/uiconfig/swriter/ui/mmresultemaildialog.ui b/sw/uiconfig/swriter/ui/mmresultemaildialog.ui new file mode 100644 index 0000000..222629f --- /dev/null +++ b/sw/uiconfig/swriter/ui/mmresultemaildialog.ui @@ -0,0 +1,398 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.18.3 --> +<interface> + <requires lib="gtk+" version="3.0"/> + <object class="GtkDialog" id="MMResultEmailDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">E-Mail merged document</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">Send Documents</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> + </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="frame"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">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="GtkGrid" id="grid5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkLabel" id="mailtoft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">T_o</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">mailto</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkComboBoxText" id="mailto"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="copyto"> + <property name="label" translatable="yes">_Copy to...</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="subjectft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">S_ubject</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">subject</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="subject"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="sendasft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Sen_d as</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">sendas</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="sendas"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">2</property> + </packing> + </child> + <child> + <object class="GtkButton" id="sendassettings"> + <property name="label" translatable="yes">Pr_operties...</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="hexpand">False</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">2</property> + </packing> + </child> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="attachgroup"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkEntry" id="attach"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="attachft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Name of the a_ttachment</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">attach</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">E-Mail options</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">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="can_focus">False</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="left_padding">12</property> + <child> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkRadioButton" id="sendallrb"> + <property name="label" translatable="yes">S_end all documents</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">singlerb</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkGrid" id="grid3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkRadioButton" id="fromrb"> + <property name="label" translatable="yes">_From</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">singlerb</property> + <accessibility> + <relation type="label-for" target="from-nospin"/> + </accessibility> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="toft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">_To</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">to-nospin</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="from-nospin"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="text" translatable="yes">1</property> + <accessibility> + <relation type="labelled-by" target="fromrb"/> + </accessibility> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="to-nospin"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="text">1</property> + </object> + <packing> + <property name="left_attach">3</property> + <property name="top_attach">0</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">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">Send records</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">2</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> diff --git a/sw/uiconfig/swriter/ui/mmresultprintdialog.ui b/sw/uiconfig/swriter/ui/mmresultprintdialog.ui new file mode 100644 index 0000000..6036fd9 --- /dev/null +++ b/sw/uiconfig/swriter/ui/mmresultprintdialog.ui @@ -0,0 +1,293 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.18.3 --> +<interface> + <requires lib="gtk+" version="3.0"/> + <object class="GtkDialog" id="MMResultPrintDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Print merged document</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">Print Documents</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> + </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="frame"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkGrid" id="grid5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkLabel" id="printerft"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">_Printer</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">printers</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkComboBoxText" id="printers"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="printersettings"> + <property name="label" translatable="yes">P_roperties...</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="left_attach">2</property> + <property name="top_attach">0</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Printer options</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">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="can_focus">False</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="left_padding">12</property> + <child> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkRadioButton" id="printallrb"> ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits